Search in sources :

Example 16 with GeneFeature

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

the class GeneFeatureTest method test3_1.

@Test
public void test3_1() throws Exception {
    GeneFeature f1 = createWithOffsets(1, 3, -2, 0);
    assertEquals(createWithOffsets(1, 3, -3, 2), new GeneFeature(f1, -1, 2));
}
Also used : GeneFeature(io.repseq.core.GeneFeature) Test(org.junit.Test)

Example 17 with GeneFeature

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

the class GeneFeatureTest method test2.

@Test(expected = IllegalArgumentException.class)
public void test2() throws Exception {
    GeneFeature f1 = create(1, 5), f2 = create(3, 7);
    new GeneFeature(f1, f2);
}
Also used : GeneFeature(io.repseq.core.GeneFeature) Test(org.junit.Test)

Example 18 with GeneFeature

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

the class GeneFeatureTest method testIntersection11.

@Test
public void testIntersection11() throws Exception {
    GeneFeature f1, f2;
    f1 = create(7, 9);
    f2 = create(1, 5, 7, 9, 10, 12);
    Assert.assertEquals(create(7, 9), GeneFeature.intersection(f2, f1));
}
Also used : GeneFeature(io.repseq.core.GeneFeature) Test(org.junit.Test)

Example 19 with GeneFeature

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

the class GeneFeatureTest method testIntersection5.

@Test
public void testIntersection5() throws Exception {
    GeneFeature f1, f2;
    f1 = create(1, 5, 7, 9, 10, 12);
    f2 = create(2, 5, 7, 9, 10, 11);
    Assert.assertEquals(create(2, 5, 7, 9, 10, 11), GeneFeature.intersection(f1, f2));
    Assert.assertEquals(create(2, 5, 7, 9, 10, 11), GeneFeature.intersection(f2, f1));
    f1 = create(2, 5, 7, 9, 10, 12);
    f2 = create(1, 5, 7, 9, 10, 11);
    Assert.assertEquals(create(2, 5, 7, 9, 10, 11), GeneFeature.intersection(f1, f2));
    Assert.assertEquals(create(2, 5, 7, 9, 10, 11), GeneFeature.intersection(f2, f1));
    f1 = create(8, 9, 10, 11);
    f2 = create(1, 5, 7, 9, 10, 12);
    Assert.assertEquals(create(8, 9, 10, 11), GeneFeature.intersection(f1, f2));
    Assert.assertEquals(create(8, 9, 10, 11), GeneFeature.intersection(f2, f1));
}
Also used : GeneFeature(io.repseq.core.GeneFeature) Test(org.junit.Test)

Example 20 with GeneFeature

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

the class GeneFeatureTest method test1.

@Test
public void test1() throws Exception {
    GeneFeature f1, f2, f3, expected, actual;
    f1 = create(1, 3);
    f2 = create(4, 5);
    expected = create(new int[] { 1, 3, 4, 5 });
    actual = new GeneFeature(f1, f2);
    assertEquals(expected, actual);
    f1 = create(1, 5);
    f2 = create(5, 6);
    f3 = create(6, 9);
    expected = create(1, 9);
    actual = new GeneFeature(f1, f2, f3);
    assertEquals(expected, actual);
    f1 = create(1, 5);
    f2 = create(6, 7);
    f3 = create(7, 9);
    expected = create(1, 5, 6, 9);
    actual = new GeneFeature(f1, f2, f3);
    assertEquals(expected, actual);
    f1 = create(1, 5);
    f2 = create(8, 10);
    f3 = create(11, 12);
    expected = create(1, 5, 8, 10, 11, 12);
    actual = new GeneFeature(f1, f2, f3);
    assertEquals(expected, actual);
}
Also used : GeneFeature(io.repseq.core.GeneFeature) Test(org.junit.Test)

Aggregations

GeneFeature (io.repseq.core.GeneFeature)41 Test (org.junit.Test)23 NucleotideSequence (com.milaboratory.core.sequence.NucleotideSequence)10 GeneType (io.repseq.core.GeneType)9 VDJCGene (io.repseq.core.VDJCGene)6 NSequenceWithQuality (com.milaboratory.core.sequence.NSequenceWithQuality)3 VDJCAlignments (com.milaboratory.mixcr.basictypes.VDJCAlignments)3 ReferencePoint (io.repseq.core.ReferencePoint)3 VDJCLibrary (io.repseq.core.VDJCLibrary)3 VDJCLibraryRegistry (io.repseq.core.VDJCLibraryRegistry)3 Pattern (java.util.regex.Pattern)3 SequenceRead (com.milaboratory.core.io.sequence.SequenceRead)2 AminoAcidSequence (com.milaboratory.core.sequence.AminoAcidSequence)2 Clone (com.milaboratory.mixcr.basictypes.Clone)2 VDJCHit (com.milaboratory.mixcr.basictypes.VDJCHit)2 VDJCAlignerParameters (com.milaboratory.mixcr.vdjaligners.VDJCAlignerParameters)2 IntArrayList (com.milaboratory.util.IntArrayList)2 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 Well19937c (org.apache.commons.math3.random.Well19937c)2