Here's the relevant part of my code:
query = raw_input("Enter query (fasta)\n")
database2 = raw_input("Enter organism 2 and genome name (fasta) in the format 'organism, genome'\n")
organism2 = database2[0:database1.find(",")]
genomehandle2 = database2[database1.find(",")+2:]
blast2 = NcbiblastnCommandline(query= str(query) + ".fasta", db=str(genomehandle2)+".fa", evalue=1e-10, outfmt=7, out="blast" + str(query) + str(organism2) + ".txt", num_threads=4)
stdout, stderr = blast2()
This works normally for any organism which has a name with 5 characters or fewer. However it's not that there's a limit on the total output handle length, because if I remove the "+str(query)+" it STILL tries to cut the organism name down to 5 characters, and if I keep the query which is way larger than 5 characters in there this still works with any organism name given that it is 5 characters or smaller.
"Enter organism 2 and genome name (fasta) in the format 'organism, genome'
macaq, macfas5" -> This works and starts BLAST
"Enter organism 2 and genome name (fasta) in the format 'organism, genome'
macaque, macfas5" -> This fails and returns the error:
"Traceback (most recent call last):
File "pipeline.py", line 30, in <module>
stdout, stderr = blast2()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Bio/Application/__init__.py", line 523, in __call__
stdout_str, stderr_str)
Bio.Application.ApplicationError: Non-zero return code 1 from 'blastn -out blastmacaq.txt -outfmt 7 -query HERV-K113.fasta -db , macfas5.fa -evalue 1e-10 -num_threads 4', message 'USAGE'"
biopython
blast