Skip to content

Commit

Permalink
Fixing typo and tweaking version
Browse files Browse the repository at this point in the history
  • Loading branch information
akrinos committed Apr 4, 2022
1 parent 2a77709 commit 1475a5e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.1
2.0.2
9 changes: 8 additions & 1 deletion src/EUKulele/manage_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -578,9 +578,16 @@ def manageTaxEstimation(output_dir, mets_or_mags, tax_tab, cutoff_file, consensu
sys.stderr = open(os.path.join(output_dir, "log", "tax_est_" +
alignment_res[t].split("/")[-1].split(".")[0] +\
".err"), "w")
err_file=os.path.join(output_dir, "log", "tax_est_" +
alignment_res[t].split("/")[-1].split(".")[0] +\
".err")
out_file=os.path.join(output_dir, "log", "tax_est_" +
alignment_res[t].split("/")[-1].split(".")[0] +\
".out")
curr_out = place_taxonomy(tax_tab, cutoff_file, consensus_cutoff, consensus_proportion,\
prot_tab, use_salmon_counts, names_to_reads,\
alignment_res[t], outfiles[t], rerun_rules)
alignment_res[t], outfiles[t], rerun_rules,
err_file,out_file)
except:
print("Taxonomic estimation did not complete successfully.",
"Check log file for details.")
Expand Down
9 changes: 6 additions & 3 deletions src/EUKulele/tax_placement.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ def apply_parallel(grouped_data, match_maker, consensus_cutoff, consensus_propor
tax_cutoffs,
classes)
for name, group in grouped_data)
sys.stdout.flush()
return pd.concat(resultdf)

def classify_taxonomy_parallel(df, tax_dict, namestoreads, pdict,
Expand Down Expand Up @@ -255,17 +256,19 @@ def classify_taxonomy_parallel(df, tax_dict, namestoreads, pdict,
else:
# run apply parallel on current chunk
candidate_df = apply_parallel(chunk.groupby('qseqid'),
match_maker, consensus_cutoff, tax_dict,
match_maker, consensus_cutoff, consensus_proportion, tax_dict,
use_counts, tax_cutoffs, classes)
# account for if better maximum percent identity previously achieved
outdf = pd.concat([outdf, candidate_df], axis = 0)
counter = counter + 1
return outdf

def place_taxonomy(tax_file,cutoff_file,consensus_cutoff,consensus_proportion,prot_map_file,
use_counts,names_to_reads,diamond_file,outfile,rerun):
use_counts,names_to_reads,diamond_file,outfile,rerun,err_file="tax_assign.err",
out_file="tax_assign.out"):
''' Find predicted taxonomy using alignment matches. '''

sys.stdout = open(out_file,"w")
sys.stderr = open(err_file,"w")
if (os.path.isfile(outfile)) & (not rerun):
print("Taxonomic placement already complete at", outfile + "; will not re-run step.")
return pd.read_csv(outfile, sep = "\t")
Expand Down

0 comments on commit 1475a5e

Please sign in to comment.