-
Notifications
You must be signed in to change notification settings - Fork 1
New feature/fwd and rev reads v2 #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
406df2a
Replaced dictionary with dataframe; added a small statistic
30919e4
Improved the way the average most likely variable region is shown; fi…
d719271
added pandas as a dependency
d9544bf
fixed an Error where unpaired reads lead to missing index in average …
9d1d5a9
Merge branch 'New_Feature/fwd-and-rev-reads_v2' of https://github.com…
sjanssen2 f20c62e
more pythonic imports
sjanssen2 3394f13
add setup routine for python to properly register modules
sjanssen2 a9ad793
add first regression test
sjanssen2 26a6cd6
Merge pull request #17 from jlab/stefansfixes
JGroos-16 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,8 @@ | ||
.coverage | ||
coverage.lcov | ||
bowtie2.1.bt2 | ||
bowtie2.2.bt2 | ||
bowtie2.3.bt2 | ||
bowtie2.4.bt2 | ||
bowtie2.rev.1.bt2 | ||
bowtie2.rev.2.bt2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,18 @@ | |
from os import path as p | ||
|
||
|
||
def write(region, seq_chrom, annoted_ref): | ||
region = {'V1_start': '', 'V1_end': '', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't see the reason why you "initialize" the dict with "empty" strings. Can't you check for presents of the key in downstream code? |
||
'V2_start': '', 'V2_end': '', | ||
'V3_start': '', 'V3_end': '', | ||
'V4_start': '', 'V4_end': '', | ||
'V5_start': '', 'V5_end': '', | ||
'V6_start': '', 'V6_end': '', | ||
'V7_start': '', 'V7_end': '', | ||
'V8_start': '', 'V8_end': '', | ||
'V9_start': '', 'V9_end': ''} | ||
|
||
|
||
def write(seq_chrom, annoted_ref): | ||
with open(annoted_ref, 'a') as t: | ||
if region['V1_start'] != '': | ||
for counter, key in enumerate(region): | ||
|
@@ -20,7 +31,7 @@ def write(region, seq_chrom, annoted_ref): | |
t.write(words) | ||
|
||
|
||
def index(line, region): | ||
def index(line): | ||
boundary = {'V1_start': 189, 'V1_end': 471, | ||
'V2_start': 485, 'V2_end': 1867, | ||
'V3_start': 1915, 'V3_end': 2231, | ||
|
@@ -36,29 +47,19 @@ def index(line, region): | |
list1 = ''.join(str(e) for e in list1) | ||
list1 = list1.replace('-', '') | ||
region[key] = int(list1.index('1')) + 1 | ||
return region | ||
|
||
|
||
def main(): | ||
file_ = f'{p.dirname(p.dirname(__file__))}/85_otus_aligned.fasta' | ||
annoted_ref = f'{p.dirname(p.dirname(__file__))}/annoted_ref.bed' | ||
with open(file_, 'r') as f: | ||
for line in f: | ||
region = {'V1_start': '', 'V1_end': '', | ||
'V2_start': '', 'V2_end': '', | ||
'V3_start': '', 'V3_end': '', | ||
'V4_start': '', 'V4_end': '', | ||
'V5_start': '', 'V5_end': '', | ||
'V6_start': '', 'V6_end': '', | ||
'V7_start': '', 'V7_end': '', | ||
'V8_start': '', 'V8_end': '', | ||
'V9_start': '', 'V9_end': ''} | ||
if line.startswith('>'): | ||
seq_chrom = line[1:] | ||
seq_chrom = seq_chrom.strip('\n') | ||
else: | ||
index(line, region) | ||
write(region, seq_chrom, annoted_ref) | ||
index(line) | ||
write(seq_chrom, annoted_ref) | ||
|
||
|
||
if __name__ == '__main__': | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,3 +17,4 @@ Requirements: | |
bowtie2 | ||
samtools | ||
bedtools | ||
Module: pandas |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,4 @@ dependencies: | |
- flake8 | ||
- nose | ||
- coverage >= 6 # to ensure lcov option is available | ||
- pandas |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/usr/bin/env python | ||
|
||
from setuptools import find_packages, setup | ||
|
||
classifiers = [ | ||
'Development Status :: 1 - Pre-Alpha', | ||
'License :: OSI Approved :: BSD License', | ||
'Environment :: Console', | ||
'Topic :: Software Development :: Libraries :: Application Frameworks', | ||
'Topic :: Scientific/Engineering', | ||
'Topic :: Scientific/Engineering :: Bio-Informatics', | ||
'Programming Language :: Python', | ||
'Programming Language :: Python :: 3', | ||
'Programming Language :: Python :: 3.3', | ||
'Programming Language :: Python :: 3.4', | ||
'Operating System :: Unix', | ||
'Operating System :: POSIX', | ||
'Operating System :: MacOS :: MacOS X', | ||
'Operating System :: Microsoft :: Windows'] | ||
|
||
|
||
description = 'VXdetector' | ||
|
||
|
||
setup(name='vxdetector', | ||
version='1.0.0', | ||
license='BSD', | ||
#description=description, | ||
#long_description=long_description, | ||
#keywords=keywords, | ||
classifiers=classifiers, | ||
author="Johannes Groos", | ||
author_email="Johannes.Groos@bio.uni-giessen.de", | ||
maintainer="http://jlab.bio", | ||
maintainer_email="stefan.m.janssen@gmail.com", | ||
url='https://github.com/jlab/algorithm_vxdetector/', | ||
test_suite='nose.collector', | ||
packages=find_packages(), | ||
install_requires=[ | ||
#'click >= 6', | ||
#'scikit-bio >= 0.4.0', | ||
], | ||
#extras_require={'test': ["nose", "pep8", "flake8"], | ||
# 'coverage': ["coverage"]} | ||
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you might want to be more flexible (as you don't know how many parts will be generated) by using wildcards, i.e.
bowtie2.*.bt2