Search in sources :

Example 1 with VDJCLibraryId

use of io.repseq.core.VDJCLibraryId in project repseqio by repseqio.

the class BasicGCloneModelTest method test1.

@Test
public void test1() throws Exception {
    GGeneModel geneModel = new BasicGGeneModel(new IndependentVDJCGenesModel(b("TRBV12-2*00", 1.0).put("TRBV12-3*00", 0.0).get(), b("TRBD1*00", 1.0).put("TRBD2*00", 0.0).get(), b("TRBJ1-2*00", 1.0).put("TRBJ1-3*00", 0.0).get(), b("TRBC1*00", 1.0).put("TRBC2*00", 0.0).get()), new IndependentVDJTrimmingModel(new CommonCategoricalGeneTrimmingModel(b(-1, 1.0).get()), new CommonCategoricalDGeneTrimmingModel(b("-2|-3", 1.0).get()), new CommonCategoricalGeneTrimmingModel(b(-4, 1.0).get())), new FixedInsertModel(new NucleotideSequence("ATTA")), new FixedInsertModel(new NucleotideSequence("GACA")));
    BasicGCloneModel model = new BasicGCloneModel(new VDJCLibraryId("default", 9606), new FixedRealModel(1.0), b("TRB", geneModel).get());
    TestUtil.assertJson(model);
    GCloneGenerator gen = model.create(new Well19937c(123), VDJCLibraryRegistry.getDefault());
    GClone clone = gen.sample();
    TestUtil.assertJson(clone);
    GGene trb = clone.genes.get("TRB");
    assertEquals(trb.vdjcGenes.v.getName(), "TRBV12-2*00");
    assertEquals(trb.vdjcGenes.d.getName(), "TRBD1*00");
    assertEquals(trb.vdjcGenes.j.getName(), "TRBJ1-2*00");
    assertEquals(trb.vdjcGenes.c.getName(), "TRBC1*00");
    assertEquals(new VDJTrimming(-1, -4, -2, -3), trb.vdjTrimming);
    assertEquals(new NucleotideSequence("ATTA"), trb.vInsert);
    assertEquals(new NucleotideSequence("GACA"), trb.djInsert);
}
Also used : VDJCLibraryId(io.repseq.core.VDJCLibraryId) Well19937c(org.apache.commons.math3.random.Well19937c) VDJTrimming(io.repseq.gen.VDJTrimming) GGene(io.repseq.gen.GGene) NucleotideSequence(com.milaboratory.core.sequence.NucleotideSequence) GClone(io.repseq.gen.GClone) Test(org.junit.Test)

Aggregations

NucleotideSequence (com.milaboratory.core.sequence.NucleotideSequence)1 VDJCLibraryId (io.repseq.core.VDJCLibraryId)1 GClone (io.repseq.gen.GClone)1 GGene (io.repseq.gen.GGene)1 VDJTrimming (io.repseq.gen.VDJTrimming)1 Well19937c (org.apache.commons.math3.random.Well19937c)1 Test (org.junit.Test)1