i am blasting sequences from a fasta file individually since the output will be handled differently depending on the quality of the hit.
currently i have this, which works fine:
blast_handle = Blastx_Command(stdin=seq_record.format("fasta"))
however, this involves writing the output to a temporary xml file and then reading it with NCBIXML.parse(file), which is quite slow.
NCBIXML.read() or parse() expects a file, so as far as i understand, it cannot directly take the standard output.
does anyone know a way to take the stdout from the Blastx_Command and somehow turn that into a BlastRecord?
thanks in advance
thanks DK, with some tweaking, that worked. here was the final command:
result_handle = os.popen("echo ""+seq_record.format("fasta")+"" | "+str(Blastx_Command)) record = NCBIXML.read(result_handle)