Search in sources :

Example 1 with KAlignerParameters

use of com.milaboratory.core.alignment.kaligner1.KAlignerParameters in project mixcr by milaboratory.

the class JsonOverriderTest method test1.

@Test
public void test1() throws Exception {
    KAlignerParameters parameters = KAlignerParameters.getByName("default");
    KAlignerParameters override = JsonOverrider.override(parameters, KAlignerParameters.class, "floatingLeftBound=true", "scoring.subsMatrix=simple(match=4,mismatch=-9)");
    KAlignerParameters expected = parameters.clone().setFloatingLeftBound(true).setScoring(new LinearGapAlignmentScoring(NucleotideSequence.ALPHABET, 4, -9, parameters.getScoring().getGapPenalty()));
    Assert.assertEquals(expected, override);
}
Also used : KAlignerParameters(com.milaboratory.core.alignment.kaligner1.KAlignerParameters) LinearGapAlignmentScoring(com.milaboratory.core.alignment.LinearGapAlignmentScoring) Test(org.junit.Test)

Example 2 with KAlignerParameters

use of com.milaboratory.core.alignment.kaligner1.KAlignerParameters in project mixcr by milaboratory.

the class JsonOverriderTest method test2.

@Test
public void test2() throws Exception {
    KAlignerParameters parameters = KAlignerParameters.getByName("default");
    KAlignerParameters override = JsonOverrider.override(parameters, KAlignerParameters.class, "floatingLeftBound=true", "subsMatrix=simple(match=4,mismatch=-9)");
    KAlignerParameters expected = parameters.clone().setFloatingLeftBound(true).setScoring(new LinearGapAlignmentScoring(NucleotideSequence.ALPHABET, 4, -9, parameters.getScoring().getGapPenalty()));
    Assert.assertEquals(expected, override);
}
Also used : KAlignerParameters(com.milaboratory.core.alignment.kaligner1.KAlignerParameters) LinearGapAlignmentScoring(com.milaboratory.core.alignment.LinearGapAlignmentScoring) Test(org.junit.Test)

Example 3 with KAlignerParameters

use of com.milaboratory.core.alignment.kaligner1.KAlignerParameters in project mixcr by milaboratory.

the class JsonOverriderTest method test1a.

@Test
public void test1a() throws Exception {
    KAlignerParameters parameters = KAlignerParameters.getByName("default");
    KAlignerParameters override = JsonOverrider.override(parameters, KAlignerParameters.class, "floatingLeftBound=true", "scoring.subsMatrix='simple(match=4,mismatch=-9)'");
    KAlignerParameters expected = parameters.clone().setFloatingLeftBound(true).setScoring(new LinearGapAlignmentScoring(NucleotideSequence.ALPHABET, 4, -9, parameters.getScoring().getGapPenalty()));
    Assert.assertEquals(expected, override);
}
Also used : KAlignerParameters(com.milaboratory.core.alignment.kaligner1.KAlignerParameters) LinearGapAlignmentScoring(com.milaboratory.core.alignment.LinearGapAlignmentScoring) Test(org.junit.Test)

Example 4 with KAlignerParameters

use of com.milaboratory.core.alignment.kaligner1.KAlignerParameters in project mixcr by milaboratory.

the class VDJCAlignerS method extractBatchParameters.

@Override
protected BatchAlignerWithBaseParameters extractBatchParameters(KGeneAlignmentParameters init) {
    final BatchAlignerWithBaseParameters p = init.getParameters().clone();
    if (p instanceof KAlignerParameters) {
        KAlignerParameters p1 = (KAlignerParameters) p;
        p1.setAbsoluteMinScore(init.getMinSumScore());
        p1.setRelativeMinScore(init.getRelativeMinScore());
    } else if (p instanceof KAlignerParameters2) {
        KAlignerParameters2 p2 = (KAlignerParameters2) p;
        p2.setAbsoluteMinScore(init.getMinSumScore());
        p2.setRelativeMinScore(init.getRelativeMinScore());
    } else
        throw new RuntimeException();
    return p;
}
Also used : BatchAlignerWithBaseParameters(com.milaboratory.core.alignment.batch.BatchAlignerWithBaseParameters) KAlignerParameters(com.milaboratory.core.alignment.kaligner1.KAlignerParameters) KAlignerParameters2(com.milaboratory.core.alignment.kaligner2.KAlignerParameters2)

Example 5 with KAlignerParameters

use of com.milaboratory.core.alignment.kaligner1.KAlignerParameters in project mixcr by milaboratory.

the class KGeneAlignmentParametersTest method test1.

@Test
public void test1() throws Exception {
    KGeneAlignmentParameters paramentrs = new KGeneAlignmentParameters(GeneFeature.VRegion, 120, 0.84f, new KAlignerParameters(5, false, false, 1.5f, 0.75f, 1.0f, -0.1f, -0.3f, 4, 10, 15, 2, -10, 40.0f, 0.87f, 7, LinearGapAlignmentScoring.getNucleotideBLASTScoring()));
    String str = GlobalObjectMappers.PRETTY.writeValueAsString(paramentrs);
    System.out.println(str);
    KGeneAlignmentParameters deser = GlobalObjectMappers.PRETTY.readValue(str, KGeneAlignmentParameters.class);
    assertEquals(paramentrs, deser);
    KGeneAlignmentParameters clone = deser.clone();
    assertEquals(paramentrs, clone);
}
Also used : KAlignerParameters(com.milaboratory.core.alignment.kaligner1.KAlignerParameters) Test(org.junit.Test)

Aggregations

KAlignerParameters (com.milaboratory.core.alignment.kaligner1.KAlignerParameters)6 Test (org.junit.Test)5 LinearGapAlignmentScoring (com.milaboratory.core.alignment.LinearGapAlignmentScoring)3 BatchAlignerWithBaseParameters (com.milaboratory.core.alignment.batch.BatchAlignerWithBaseParameters)1 KAlignerParameters2 (com.milaboratory.core.alignment.kaligner2.KAlignerParameters2)1 MergerParameters (com.milaboratory.core.merger.MergerParameters)1