Emboss In Biopython Asequence And Bsequence
1
0
Entering edit mode
10.4 years ago
Maria ▴ 170

In biopython emboss applications, is it possible that asequence and bsequence attributes of needle/watercommandline object be a variable instead of fasta file ? i.e I want to write the sequence either directly or through variable as shown below

bseq= "aaatttccggtt"
    needle_cline = NeedleCommandline(asequence="acgtggcc", bsequence=bseq,
    ...                                  gapopen=10, gapextend=0.5, outfile="needle.txt")

Is it possible to do it ?

python biopython • 4.7k views
ADD COMMENT
4
Entering edit mode
10.4 years ago
Peter 6.0k

This isn't a Biopython specific thing, but an EMBOSS trick - you can use their pretend file format to give the sequence in place of a filename using asis:aaatttccggtt, see also http://emboss.sourceforge.net/docs/themes/SequenceFormats.html - e.g.

>>> from Bio.Emboss.Applications import NeedleCommandline
>>> aseq = "acgtggcc"
>>> bseq = "aaatttccggtt"
>>> needle_cline = NeedleCommandline(asequence="asis:"+aseq, bsequence="asis:"+bseq, gapopen=10, gapextend=0.5, outfile="needle.txt")
>>> stdout, stderr = needle_cline()
>>> print stdout + stderr
Needleman-Wunsch global alignment of two sequences

Also you might be able to specify you want to read the a-sequences from stdin rather than a file, and supply this when you actually run Needle, e.g. with needle_cline(stdin=aseq) (not tested).

ADD COMMENT
0
Entering edit mode

is there equivalent in MafftCommandline?

ADD REPLY

Login before adding your answer.

Traffic: 1856 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