Question: EMBOSS needle question
0
gravatar for mossig89
4.1 years ago by
mossig890
Lebanon
mossig890 wrote:

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 whats saved in needle_cline which is:

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

however I was hopping 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 • 2.3k views
ADD COMMENTlink modified 4.1 years ago • written 4.1 years ago by mossig890

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 REPLYlink written 4.1 years ago by mossig890
0
gravatar for Asaf
4.1 years ago by
Asaf4.8k
Israel
Asaf4.8k wrote:
>>> stdout, stderr = needle_cline()
>>> print stdout + stderr
ADD COMMENTlink written 4.1 years ago by Asaf4.8k

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 REPLYlink written 4.1 years ago by mossig890
0
gravatar for Neilfws
4.1 years ago by
Neilfws48k
Sydney, Australia
Neilfws48k wrote:

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 COMMENTlink modified 4.1 years ago • written 4.1 years ago by Neilfws48k

as per your suggestion to use  sudo apt-get install emboss. first I removed EMBOSS using suod 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 yess 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 REPLYlink written 4.1 years ago by mossig890
0
gravatar for Juke-34
4.1 years ago by
Juke-341.2k
Sweden
Juke-341.2k wrote:

The error that you mention is just that python (and you computer in general) don't know where find the "needle" executable. Tape 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 tape "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 COMMENTlink written 4.1 years ago by Juke-341.2k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1741 users visited in the last hour