Question: Emboss In Biopython Asequence And Bsequence
gravatar for Maria
6.0 years ago by
Maria150 wrote:

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 • 3.0k views
ADD COMMENTlink modified 11 months ago by Biostar ♦♦ 20 • written 6.0 years ago by Maria150
gravatar for Peter
6.0 years ago by
Scotland, UK
Peter5.8k wrote:

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 - 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 COMMENTlink modified 4.2 years ago • written 6.0 years ago by Peter5.8k

is there equivalent in MafftCommandline?

ADD REPLYlink written 3.5 years ago by Medhat8.6k
Please log in to add an answer.


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