Pairwise alignment from Multiple alignment MAFFT file
0
0
Entering edit mode
7.1 years ago

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 = AlignIO.read("beluga slit1 alignment cluster.txt", "clustal")

  print(alignment)

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

  for record in alignment:

  print ("%s %i" % record.id, len(record)))
comparative genomics alignment sequence • 2.1k views
ADD COMMENT
0
Entering edit mode

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 REPLY

Login before adding your answer.

Traffic: 3584 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6