Search in sources :

Example 1 with AffineGapAlignmentScoring

use of com.milaboratory.core.alignment.AffineGapAlignmentScoring in project mixcr by milaboratory.

the class TargetMergerTest method test1.

@Test
public void test1() throws Exception {
    // acgatgggcgcaa     atatagggagctccgatcgacatcgagTTTTTtatcgccctggtacgatcccggtgacaaagcgttc   ggacctgtctggacgctagaacgcag
    // acgatgggcgcaa                          atcgggtatcgccctggtacgatAccggtga aaagcgttc   ggacctgtctggacgctagaacgcag
    // acgatgggcgcaa     atatagg agctAcgatcgacatcgggtatcgccc                              ggacctgtctggacgctagaacgcag
    final NucleotideSequence seq1 = new NucleotideSequence("atatagg agctAcgatcgacatcgAgtatcgccc                           ".replace(" ", ""));
    final NucleotideSequence seq2 = new NucleotideSequence("                     atcgggtatcgccctggtacgatAccggtga aaagcgttc".replace(" ", ""));
    final NucleotideSequence merg = new NucleotideSequence("atatagg agctAcgatcgacatcgggtatcgccctggtacgatAccggtga aaagcgttc".replace(" ", ""));
    final NucleotideSequence reference = new NucleotideSequence("acgatgggcgcaa     atatagggagctccgatcgacatcgagTTTTTtatcgccctggtacgatcccggtgacaaagcgttc   ggacctgtctggacgctagaacgcag".replace(" ", ""));
    AffineGapAlignmentScoring<NucleotideSequence> scoring = new AffineGapAlignmentScoring<>(NucleotideSequence.ALPHABET, 8, -5, -8, -1);
    final Alignment<NucleotideSequence> al1 = Aligner.alignLocal(scoring, reference, seq1);
    final Alignment<NucleotideSequence> al2 = Aligner.alignLocal(scoring, reference, seq2);
    final Alignment<NucleotideSequence> merge = TargetMerger.merge(scoring, 10, merg, 20, al1, al2);
    System.out.println(al1 + "\n\n" + al2 + "\n\n" + merge);
    Assert.assertEquals(merg.getRange(merge.getSequence2Range()), AlignmentUtils.getAlignedSequence2Part(merge));
}
Also used : NucleotideSequence(com.milaboratory.core.sequence.NucleotideSequence) AffineGapAlignmentScoring(com.milaboratory.core.alignment.AffineGapAlignmentScoring) Test(org.junit.Test)

Aggregations

AffineGapAlignmentScoring (com.milaboratory.core.alignment.AffineGapAlignmentScoring)1 NucleotideSequence (com.milaboratory.core.sequence.NucleotideSequence)1 Test (org.junit.Test)1