我想用来MafftCommandline
对齐我的数据,但出现以下错误:
Traceback (most recent call last):
File "C:\Users\Rimvis\Desktop\asd\bioinformatika2_Working.py", line 35, in <mo
dule>
stdout, stderr = mafftCline() # Note that MAFFT will write the alignment to
stdout, which you may want to save to a file and then parse
File "C:\Python27\lib\site-packages\Bio\Application\__init__.py", line 475, in
__call__
shell=(sys.platform!="win32"))
File "C:\Python27\lib\subprocess.py", line 679, in __init__
errread, errwrite)
File "C:\Python27\lib\subprocess.py", line 896, in _execute_child
startupinfo)
WindowsError: [Error 2] The system cannot find the file specified
我的代码如下:
dataToProcess = "dataToProcess.fa"
file = open(dataToProcess, "w")
arrayOfSequences = []
for sequence in blast.alignments:
if sequence.length > blast.alignments[0].length * 80 / 100:
sequenceToAppend = SeqRecord(Seq(sequence.hsps[0].sbjct), id=sequence.title)
arrayOfSequences.append(sequenceToAppend)
SeqIO.write(arrayOfSequences, file, "fasta")
file.close()
maffPath = "..\mafft-win\mafft.bat"
mafftCline = MafftCommandline(maffPath, input=dataToProcess)
stdout, stderr = mafftCline() # Note that MAFFT will write the alignment to stdout, which you may want to save to a file and then parse
alignedData = "aligned.fa"
alignedFile = open(alignedData, "w")
alignedFile.write(stdout)
alignedFile.close()
aligned = AlignIO.read(alignedData, "fasta")
我以本教程为例