Question: Emboss In Biopython Asequence And Bsequence
gravatar for Maria
4.3 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 • 2.3k views
ADD COMMENTlink modified 4.3 years ago by Peter5.6k • written 4.3 years ago by Maria150
gravatar for Peter
4.3 years ago by
Scotland, UK
Peter5.6k 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 2.5 years ago • written 4.3 years ago by Peter5.6k

is there equivalent in MafftCommandline?

ADD REPLYlink written 21 months ago by Medhat7.5k
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: 901 users visited in the last hour