[Biopython] Unix pipes and APIs like NcbiblastxCommandline()
Ivan Gregoretti
ivangreg at gmail.com
Tue Oct 21 20:56:20 UTC 2014
Hello everybody
Can somebody suggest a way to run an API like NcbiblastxCommandline()
but directing the output to standard output?
For instance, this is the conventional execution with output directed
to a file, in this case opuntia.csv:
from Bio.Blast.Applications import NcbiblastxCommandline
blastx_cline = NcbiblastxCommandline("/mnt/shared/ncbi-blast-2.2.29+/blastx",
query="opuntia.fasta", db="nr", evalue=0.001, outfmt=10,
out="opuntia.csv")
Now, what I would like to know is how to run this API with something like
out="/dev/stdout" instead of out="opuntia.csv".
In other words, I seek to avoid the creation of opuntia.csv.
Optional context:
I can currently execute local blast from within Python and direct its
output to a pipe (i.e. subprocess.Popen...). I am now interested in
trying the API way as it is likely to be more robust than my
implementation and already tested by a very large number of users.
Thank you,
Ivan
Ivan Gregoretti, PhD
Bioinformatics
More information about the Biopython
mailing list