Question: Pariwise Local And Global Alignment
gravatar for Thaman
8.6 years ago by
Thaman3.2k wrote:


I like to build python script which can take fasta file and can run either pairwise local or global alignment of all sequences in a fasta file and completing by printing scores in the tables.

I read Bio.pairwise2 but couldn't find in detail how to intake fasta file and moreover pairwise2 seems to be slow alignment module. Is there any alternative beside pariwise2 if not then what are my options?

pairwise local alignment • 4.7k views
ADD COMMENTlink modified 8.6 years ago by Simon Cockell7.3k • written 8.6 years ago by Thaman3.2k
gravatar for Simon Cockell
8.6 years ago by
Simon Cockell7.3k
Simon Cockell7.3k wrote:

As Neil notes, the EMBOSS package provides the functionality you are after, and BioPython has decent wrappers for constructing command line calls:

From the BioPython docs:

>>> from Bio.Emboss.Applications import WaterCommandline
>>> cline = WaterCommandline(gapopen=10, gapextend=0.5)
>>> cline.asequence = "asis:ACCCGGGCGCGGT"
>>> cline.bsequence = "asis:ACCCGAGCGCGGT"
>>> cline.outfile = "temp_water.txt"
>>> print cline
water -outfile=temp_water.txt -asequence=asis:ACCCGGGCGCGGT -bsequence=asis:ACCCGAGCGCGGT -gapopen=10 -gapextend=0.5
>>> cline
WaterCommandline(cmd='water', outfile='temp_water.txt', asequence='asis:ACCCGGGCGCGGT', bsequence='asis:ACCCGAGCGCGGT', gapopen=10, gapextend=0.5)

You would typically run the command line via a standard Python operating system call (e.g. using the subprocess module).

ADD COMMENTlink modified 3 months ago by RamRS19k • written 8.6 years ago by Simon Cockell7.3k
gravatar for Pierre Lindenbaum
8.6 years ago by
France/Nantes/Institut du Thorax - INSERM UMR1087
Pierre Lindenbaum115k wrote:

The entry about the Needleman-Wunsch algorithm in wikipedia contains a nice pseudocode that should be easy to implement.

ADD COMMENTlink written 8.6 years ago by Pierre Lindenbaum115k
gravatar for Neilfws
8.6 years ago by
Sydney, Australia
Neilfws48k wrote:

The EMBOSS package implements global alignment (stretcher, needle) and local alignment (matcher, supermatcher, water). I believe that Biopython has a Bio.Emboss module to interact with EMBOSS. Otherwise, it should not be too difficult to call the programs from python and parse the output.

ADD COMMENTlink written 8.6 years ago by Neilfws48k
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: 1218 users visited in the last hour