Skip to content
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

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

bowtie build #12

wants to merge 11 commits into from

Conversation

jkanbar
Copy link

@jkanbar jkanbar commented Nov 2, 2016

Continuing from #10

taxa_levels,
read_per_taxa):
"""Absolute abundance of number of reads matching a defined taxa level.
Parameters
Copy link
Member

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:
Copy link
Member

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()
Copy link
Member

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

newline please



@click.command()

Copy link
Member

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')
Copy link
Member

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
Copy link
Member

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 != "":
Copy link
Member

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):
Copy link
Member

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]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants