1

I am trying to locally align a set of around 100, very long (>8000 sequence) sequences using the biopython wrapper for EMBOSS.

Essentially I need to locally align each sequence in my fasta file against every other sequence in that fasta file. Thus far I have tried to run the very basic code below:

from Bio.Emboss.Applications import NeedleCommandline
from Bio import AlignIO

seq_fname1 = 'gross-alignment.fasta'
seq_fname2 = 'gross-alignment.fasta'
needle_fname = 'pairwise_output.txt'
needle_cli = NeedleCommandline(asequence=seq_fname1, \
                               bsequence=seq_fname2, \
                               gapopen=10, \
                               gapextend=0.5, \
                               outfile=needle_fname)

"""This generates the needle file"""
needle_cli() 
"""That parses the needle file, aln[0] and aln[1] contain the aligned
first and second sequence in the usual format (e.g. - for a gap)"""
aln = AlignIO.read(needle_file, "emboss") 
print aln

But I get the following error when I do so:

C:\WINDOWS\system32\cmd.exe /c (python ^<C:\Users\User\AppData\Local\Temp\VIiAAD1.tmp) Traceback (most recent call last): File "<stdin>", line 14, in <module> File "C:\Python27\lib\site-packages\Bio\Application\__init__.py", line 495, in __call__ shell=use_shell) File "C:\Python27\Lib\subprocess.py", line 711, in __init__ errread, errwrite) File "C:\Python27\Lib\subprocess.py", line 959, in _execute_child startupinfo) WindowsError: [Error 2] The system cannot find the file specified shell returned 1 Hit any key to close this window...

I can't figure what the cause of this error is, any help would be very much appreciated.

Dider
  • 367
  • 1
  • 3
  • 17
  • 1
    Can you put needle _fname = 'c:\\pairwise_output.txt' and try? – be_good_do_good Jul 25 '16 at 18:15
  • @be_good_do_good I tired as you suggested but I get the exact same error. I tired both using the absolute path and copying exactly what you had. Same error both times. – Dider Jul 25 '16 at 18:24
  • 1
    needle_cli() --> what is the exact filename that it is generating? – be_good_do_good Jul 25 '16 at 18:44
  • @be_good_do_good Actually it's not generating any file, it should be generating a file called 'pairwise_output.txt' but it isn't generating anything. – Dider Jul 25 '16 at 18:51
  • 1
    can you try absolute paths for seq_fname1, seq_fname2 as well? Also, i hope you are trying this out in elevated command prompt – be_good_do_good Jul 25 '16 at 18:57
  • 1
    @be_good_do_good Wow, looks like it was the elevated command prompt that did the trick. Thanks very much! – Dider Jul 25 '16 at 19:11

1 Answers1

0

can you try absolute paths for seq_fname1, seq_fname2 as well? Also, i hope you are trying this out in elevated command prompt

Moving it to answer from comments :)

be_good_do_good
  • 4,311
  • 3
  • 28
  • 42