Search in sources :

Example 61 with NucleotideSequence

use of com.milaboratory.core.sequence.NucleotideSequence in project repseqio by repseqio.

the class SequenceResolverTest method rawHttpTest1.

@Test
public void rawHttpTest1() throws Exception {
    Path dir = TempFileManager.getTempDir().toPath().toAbsolutePath();
    Path work = dir.resolve("work");
    Files.createDirectories(work);
    Path cache = dir.resolve("cache");
    Files.createDirectories(cache);
    SequenceResolvers.initDefaultResolver(cache);
    SequenceResolver defaultResolver = SequenceResolvers.getDefault();
    NucleotideSequence seq = defaultResolver.resolve(new SequenceAddress("http://files.milaboratory.com/test-data/test.fa#testRecord")).getRegion(new Range(10, 30).inverse());
    Assert.assertEquals(new NucleotideSequence("GCTCCACCACAAGACACTCT"), seq);
}
Also used : Path(java.nio.file.Path) NucleotideSequence(com.milaboratory.core.sequence.NucleotideSequence) Range(com.milaboratory.core.Range) SingleFastqReaderTest(com.milaboratory.core.io.sequence.fastq.SingleFastqReaderTest) Test(org.junit.Test)

Example 62 with NucleotideSequence

use of com.milaboratory.core.sequence.NucleotideSequence in project repseqio by repseqio.

the class SequenceBaseTest method test4m.

@Test
public void test4m() throws Exception {
    SequenceBase base = new SequenceBase();
    base.put("A1", 100, new NucleotideSequence("ATTAGACACACAC"));
    base.put("A1", 18, new NucleotideSequence("CAC"));
    base.put("A1", 10, new NucleotideSequence("ATTAGACACACAC"));
    assertEquals(new NucleotideSequence("ATTAGACACAC"), base.get("A1", new Range(10, 21)));
    assertEquals(new NucleotideSequence("TTAG"), base.get("A1", new Range(101, 105)));
}
Also used : NucleotideSequence(com.milaboratory.core.sequence.NucleotideSequence) Range(com.milaboratory.core.Range) Test(org.junit.Test)

Example 63 with NucleotideSequence

use of com.milaboratory.core.sequence.NucleotideSequence in project repseqio by repseqio.

the class SequenceBaseTest method test5m.

@Test
public void test5m() throws Exception {
    SequenceBase base = new SequenceBase();
    base.put("A1", 100, new NucleotideSequence("ATTAGACACACAC"));
    base.put("A1", 10, new NucleotideSequence("ATTAGACACACAC"));
    base.put("A1", 18, new NucleotideSequence("CAC"));
    assertEquals(new NucleotideSequence("ATTAGACACAC"), base.get("A1", new Range(10, 21)));
    assertEquals(new NucleotideSequence("TTAG"), base.get("A1", new Range(101, 105)));
}
Also used : NucleotideSequence(com.milaboratory.core.sequence.NucleotideSequence) Range(com.milaboratory.core.Range) Test(org.junit.Test)

Example 64 with NucleotideSequence

use of com.milaboratory.core.sequence.NucleotideSequence in project repseqio by repseqio.

the class SequenceBaseTest method test2e.

@Test(expected = IllegalArgumentException.class)
public void test2e() throws Exception {
    SequenceBase base = new SequenceBase();
    base.put("A1", 10, new NucleotideSequence("ATTAGACACACAC"));
    base.put("A1", 20, new NucleotideSequence("TACATA"));
}
Also used : NucleotideSequence(com.milaboratory.core.sequence.NucleotideSequence) Test(org.junit.Test)

Example 65 with NucleotideSequence

use of com.milaboratory.core.sequence.NucleotideSequence in project repseqio by repseqio.

the class SequenceBaseTest method test2.

@Test
public void test2() throws Exception {
    SequenceBase base = new SequenceBase();
    base.put("A1", 10, new NucleotideSequence("ATTAGACACACAC"));
    base.put("A1", 20, new NucleotideSequence("CACATA"));
    assertEquals(new NucleotideSequence("ACACA"), base.get("A1", new Range(19, 24)));
}
Also used : NucleotideSequence(com.milaboratory.core.sequence.NucleotideSequence) Range(com.milaboratory.core.Range) Test(org.junit.Test)

Aggregations

NucleotideSequence (com.milaboratory.core.sequence.NucleotideSequence)81 Test (org.junit.Test)32 Range (com.milaboratory.core.Range)19 VDJCGene (io.repseq.core.VDJCGene)15 GeneType (io.repseq.core.GeneType)14 NSequenceWithQuality (com.milaboratory.core.sequence.NSequenceWithQuality)13 GeneFeature (io.repseq.core.GeneFeature)9 VDJCAlignments (com.milaboratory.mixcr.basictypes.VDJCAlignments)8 VDJCHit (com.milaboratory.mixcr.basictypes.VDJCHit)8 ReferencePoint (io.repseq.core.ReferencePoint)7 VDJCLibrary (io.repseq.core.VDJCLibrary)7 ArrayList (java.util.ArrayList)7 VDJCAlignerParameters (com.milaboratory.mixcr.vdjaligners.VDJCAlignerParameters)6 AlignmentHit (com.milaboratory.core.alignment.batch.AlignmentHit)5 PairedRead (com.milaboratory.core.io.sequence.PairedRead)5 AminoAcidSequence (com.milaboratory.core.sequence.AminoAcidSequence)5 Path (java.nio.file.Path)5 Alignment (com.milaboratory.core.alignment.Alignment)4 Pattern (java.util.regex.Pattern)4 AlignmentHelper (com.milaboratory.core.alignment.AlignmentHelper)3