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);
}
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);
}
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);
}
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;
}
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);
}
Aggregations