pythonbioinformaticsbiopythondna-sequencesequence-alignment

Codon alignment via Python?


I have pairs of coding DNA sequences which I wish to perform pairwise codon alignments via Python, I have "half completed" the process.

So far..

I wish to..

Question

I would appreciate suggestions for programs/code (called from Python) that can transfer gaps from aligned peptide sequence pairs onto codons of the corresponding nucleotide sequence pairs. Or programs/code that can carry out the pairwise codon alignment from scratch.

enter image description here


Solution

  • All you need to do is split the nucleotide sequence into triplets. Each amino-acid is a triplet, each gap is three gaps. so in pseudo code:

    for x in range(0, len(aminoacid)):
        if x != "-":
           print nucleotide[3x:3x+3]
        else:
           print "---"