Skip to content

Commit

Permalink
attempt fix blast report
Browse files Browse the repository at this point in the history
  • Loading branch information
gregdenay committed Jul 25, 2024
1 parent 65cdbdc commit 2b904c1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion workflow/envs/blast.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ channels:
- bioconda
- defaults
dependencies:
- blast=2.16.0
- blast=2.12.0
1 change: 0 additions & 1 deletion workflow/rules/blast.smk
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ rule blast_otus:
-qcov_hsp_perc {params.qcov} $masking \
-outfmt '6 qseqid sseqid evalue pident bitscore sacc staxid length mismatch gaps stitle' \
-num_threads {threads} \
-mt_mode 1 \
2> {log}
sed -i '1 i\query\tsubject\tevalue\tidentity\tbitscore\tsubject_acc\tsubject_taxid\talignment_length\tmismatch\tgaps\tsubject_name' {output.report}
Expand Down
16 changes: 8 additions & 8 deletions workflow/scripts/blast_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def main(otus_in, blast_in, filtered_in, lca_in, report_out, bit_diff, sample):
if not os.path.isfile(blast_in) or os.stat(blast_in).st_size == 0:
with open(report_out, "a") as fo:
fo.write("\t".join([
sample,
str(sample),
"-",
"-",
"0",
Expand All @@ -82,8 +82,8 @@ def main(otus_in, blast_in, filtered_in, lca_in, report_out, bit_diff, sample):
if bhits == 0:
with open(report_out, "a") as fo:
fo.write("\t".join([
sample,
otu,
str(sample),
str(otu),
str(size),
"0",
"0",
Expand All @@ -106,18 +106,18 @@ def main(otus_in, blast_in, filtered_in, lca_in, report_out, bit_diff, sample):

with open(report_out, "a") as fo:
fo.write("\t".join([
sample,
otu,
str(sample),
str(otu),
str(size),
str(bhits),
str(bit_best),
str(bit_low),
str(bit_thr),
str(shits),
cons["Consensus"].values[0],
cons["Rank"].values[0],
str(cons["Consensus"].values[0]),
str(cons["Rank"].values[0]),
str(cons["Taxid"].values[0]),
cons["Disambiguation"].values[0],
str(cons["Disambiguation"].values[0]),
f"../{blast_in}",
f"../{filtered_in}"
])+"\n")
Expand Down

0 comments on commit 2b904c1

Please sign in to comment.