This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Pairwise alignment from Multiple alignment MAFFT file

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

0 answers

No answers yet.

Log in to answer this question.