[Biojava-dev] A question about multiple alignment

Shahab Kamali skamali at cs.uwaterloo.ca
Fri Sep 16 17:56:21 UTC 2011


Hi,
I am using BioJava in a pattern mining project. I want to align a set  
of relatively short sequences. For example to align {"ABCE", "ABCE",  
"ADE", "ADE").

This is a part of my code:

SubstitutionMatrix<AminoAcidCompound> matrix = new
                     SimpleSubstitutionMatrix<AminoAcidCompound>();
GuideTree<ProteinSequence, AminoAcidCompound> gt = new  
GuideTree<ProteinSequence,  
AminoAcidCompound>(lst,Alignments.getAllPairsScorers(lst,
                    Alignments.PairwiseSequenceScorerType.GLOBAL,  new
                    SimpleGapPenalty((short)0,(short)0), matrix));
	    Profile<ProteinSequence, AminoAcidCompound> profile =  
Alignments.getProgressiveAlignment(gt,Alignments.ProfileProfileAlignerType.GLOBAL, new  
SimpleGapPenalty((short)0,(short)0),matrix);

The result of the above code is:
ABCE
ABCE
AD-E
AD-E

But what I need is
A-BCE
A-BCE
AD--E
AD--E
or
ABC-E
ABC-E
A--DE
A--DE

Do you have any suggestion?
Thanks,
Shahab






More information about the biojava-dev mailing list