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