EMBOSS needle question
3
1
Entering edit mode
10.4 years ago
mossig89 ▴ 10

After giving up on installing EMBOSS on windows platform, I installed it on Lubuntu after I copied and unziped the EMBOSS-6.5.7.tar.gz in my the library folder for python 2.7 which is within the anaconda interpreters folder (since I'm using spyder IDE for python) then I navigated to that directory using lubuntu terminal and typed the following commands:

./configure
make

after that in a folder named scripts I created three files

>HBA_HUMAN
MVLSPADKTNVKAAWGKVGAHAGEYGAEALERMFLSFPTTKTYFPHFDLSHGSAQVKGHG
KKVADALTNAVAHVDDMPNALSALSDLHAHKLRVDPVNFKLLSHCLLVTLAAHLPAEFTP
AVHASLDKFLASVSTVLTSKYR

in a file alpha.fasta, and secondly in a file beta.fasta:

>HBB_HUMAN
MVHLTPEEKSAVTALWGKVNVDEVGGEALGRLLVVYPWTQRFFESFGDLSTPDAVMGNPK
VKAHGKKVLGAFSDGLAHLDNLKGTFATLSELHCDKLHVDPENFRLLGNVLVCVLAHHFG
KEFTPPVQAAYQKVVAGVANALAHKYH

and a third file called needle.py containing the following script:

from Bio.Emboss.Applications import NeedleCommandline
needle_cline = NeedleCommandline(asequence="alpha.faa", bsequence="beta.faa",
                                  gapopen=10, gapextend=0.5,outfile="needle.txt")
print(needle_cline)

all this script is doing is that it's printing what's saved in needle_cline which is:

needle -outfile=needle.txt -asequence=alpha.faa -bsequence=beta.faa -gapopen=10 -gapextend=0.5

however I was hoping that I would get a fourth file named needle.txt which would contain the two sequences of contained in the files alpha.fasta and beta.fasta that are aligned together. I cant figure out why this function is not working, even though I have installed Biopython and EMBOSS. Thanks!

sequence • 5.6k views
ADD COMMENT
0
Entering edit mode

it seems to be working now. After I restarted my system I ran the same code again and this time it worked... its seems like the system needed to be restarted for some reason after couple weeks of nonstop functioning. Thanks anyhow.

ADD REPLY
0
Entering edit mode
10.4 years ago
Asaf 10k
>>> stdout, stderr = needle_cline()
>>> print stdout + stderr
ADD COMMENT
0
Entering edit mode

executing the command:

>>> stdout, stderr = needle_cline()

I got the following output:

  traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/mossig/anaconda/lib/python2.7/site-packages/Bio/Application/__init__.py", line 513, in __call__
    stdout_str, stderr_str)
Bio.Application.ApplicationError: Non-zero return code 1 from 'needle -outfile=needle.txt -asequence=alpha.fasta -bsequence=beta.fasta -gapopen=10 -gapextend=0.5', message 'Needleman-Wunsch global alignment of two sequences'
ADD REPLY
0
Entering edit mode
10.4 years ago
Neilfws 49k

If all that you typed was "./configure, make", then you have not installed EMBOSS. The last step is "(sudo) make install". Also, there is no need to work in the python lib directory. EMBOSS is separate to Biopython; the latter just provides a wrapper to its command line arguments.

If you're working on Ubuntu, EMBOSS should be available in the repository and is easily installed (as is Biopython) using sudo apt-get install emboss.

ADD COMMENT
0
Entering edit mode

as per your suggestion to use sudo apt-get install emboss first I removed EMBOSS using sudo apt-get remove EMBOSS, & sudo apt-get autoremove EMBOSS. Then I hit the command sudo apt-get install emboss, I got the following:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  dialign emboss-data emboss-lib libhpdf-2.2.1 libmysqlclient18 libpq5
  mysql-common primer3
Suggested packages:
  emboss-doc emboss-test embassy clustalw ncbi-epcr
The following NEW packages will be installed:
  dialign emboss emboss-data emboss-lib libhpdf-2.2.1 libmysqlclient18 libpq5
  mysql-common primer3
0 upgraded, 9 newly installed, 0 to remove and 186 not upgraded.
Need to get 65.4 MB/66.0 MB of archives.
After this operation, 497 MB of additional disk space will be used.

After clicking yes it installed EMBOSS on my system, after that I executed the same script that I mentioned on my first question, it still remained the same, and did not create the output file needle.txt, in the directory of the script.

ADD REPLY
0
Entering edit mode
10.4 years ago
Juke34 8.9k

The error that you mention is just that python (and you computer in general) don't know where find the "needle" executable. Type the command which needle to know the path till needle.

As example you have as result: "path/to/exec/bin/needle"

Then, in the terminal where you want to launch your script tape: "export PATH=${PATH}:path/to/exec/bin"

Now if you type needle in the terminal needle should start.

Now your script should works. In this case, you have to save the export command in ~/.bashrc or ~/.profile file, to keep the access to this exec even after closing your terminal.

ADD COMMENT

Login before adding your answer.

Traffic: 2203 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6