Question: Pairwise alignment from Multiple alignment MAFFT file
gravatar for brimaloney24
2.4 years ago by
brimaloney240 wrote:

I have an alignment of a gene across species from MAFFT, I am hoping to create a pairwise alignment of each of the species in this alignment such that each species is compared to each other using Biopython. Seq1 vs Seq2 Seq1 vs Seq3 Seq1 vs Seq4 ect. From there, I hope to be able to pick out all of the nucleotide differences between each pair. currently, I have been able to read in the Mafft file as a clustal format and double checked that each species can be read as a sequence record. I know it will require an iteration and the pairwise2 command but I am a bit lost beyond that

  import itertools, sys 

  from Bio import AlignIO, SeqIO, pairwise2

  alignment ="beluga slit1 alignment cluster.txt", "clustal")


  print ("Alignment length %i" % alignment.get_alignment_length())

  for record in alignment:

  print ("%s %i" %, len(record)))
ADD COMMENTlink written 2.4 years ago by brimaloney240

How is this different to your other question here: C: Resources for absolute Beginner? and analyzing MAFFT alignment in Biopython ??

Also, see the link in my comment on that thread which shows you exactly how to do combinatorial pairwise alignments.

ADD REPLYlink written 2.4 years ago by Joe18k
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: 896 users visited in the last hour