-
Notifications
You must be signed in to change notification settings - Fork 44
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
bowtie build #12
base: master
Are you sure you want to change the base?
bowtie build #12
Conversation
Merge branch 'master' of https://github.com/jkanbar/tcga-1
taxa_levels, | ||
read_per_taxa): | ||
"""Absolute abundance of number of reads matching a defined taxa level. | ||
Parameters |
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.
newline please
taxonomic_abundances= [] | ||
for report_fp in kraken_mpa_report_fp: | ||
with open(report_fp) as report_fp: | ||
for line in report_fp: |
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.
would it be possible to break this parser out? seems like a logical point for decomposition. i'm not seeing a paired unit test or set of tests either...?
taxonomic_abundances.append(taxonomy_parse) | ||
|
||
taxonomies = set([k for k, v in | ||
collections.Counter(taxonomic_abundances).iteritems() |
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.
this is a py2 codebase?
output_filename): | ||
|
||
"""Return sets for sample IDs and taxonomy strings. | ||
Parameters |
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.
newline please
|
||
|
||
@click.command() | ||
|
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.
remove the extra newline please
with open(scores_repophlan_fp) as scores_repophlan_f: | ||
# header | ||
line = scores_repophlan_f.readline() | ||
line = line.strip().split('\t') |
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.
yea... i think pandas would be so nice here
# only want tax_ids for genomes passing quality filter | ||
if genome_id in genomes: | ||
tax_id = line[tax_id_idx] | ||
# tax_id must be an integer, if not check the field |
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.
that sucks. has this bug been reported to the repophlan maintainers?
taxid = info[1] | ||
genome_fp_name = basename(splitext(genome_fp)[0]) | ||
# check FNA file exists for genome | ||
if genome_fp_name != "": |
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.
if genome_fp_name:
output_fp = join(repophlan_scores_filtered_genomes_dp, | ||
genome_fp_name) | ||
# skip files already modified (e.g. from previous run) | ||
if not isfile(output_fp): |
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.
should this be os.path.exists
?
"""Edit qualified genomes' labels to Kraken format. | ||
""" | ||
# .fna.bz2 genomes folder | ||
all_genomes_bz2_dp = sys.argv[1] |
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.
:(
Continuing from #10