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

Switch blast execution from os to subprocess #63

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions kleborate/blastn.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,10 @@ def run_blastn(db, query, min_cov, min_ident):
cmd += ' -dust no -evalue 1E-20 -word_size 32 -max_target_seqs 10000'
cmd += ' -perc_identity {}'.format(min_ident)

# TODO: switch this over to subprocess
blast_hits = []
f = os.popen(cmd)
f = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True).stdout
for line in f:
blast_hits.append(BlastHit(line))
blast_hits.append(BlastHit(line.decode()))
f.close()

# Toss out low identity and low coverage hits.
Expand Down