Question: Pariwise Local And Global Alignment
4
gravatar for Thaman
3.9 years ago by
Thaman2.9k
Finland
Thaman2.9k wrote:

Hi,

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?

ADD COMMENTlink modified 3.9 years ago by Simon Cockell6.6k • written 3.9 years ago by Thaman2.9k
8
gravatar for Simon Cockell
3.9 years ago by
Simon Cockell6.6k
Newcastle
Simon Cockell6.6k 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 written 3.9 years ago by Simon Cockell6.6k
4
gravatar for Pierre Lindenbaum
3.9 years ago by
France
Pierre Lindenbaum58k wrote:

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

ADD COMMENTlink written 3.9 years ago by Pierre Lindenbaum58k
3
gravatar for Neilfws
3.9 years ago by
Neilfws41k
Sydney, Australia
Neilfws41k 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 3.9 years ago by Neilfws41k
Please log in to add an answer.

Help
Access
  • RSS
  • Stats
  • API

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