use of com.milaboratory.core.sequence.NucleotideSequence in project repseqio by repseqio.
the class SequenceResolverTest method test1.
@Test
public void test1() 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("nuccore://EU877942.1")).getRegion(new Range(10, 30).inverse());
Assert.assertEquals(new NucleotideSequence("gcgagagcaagcactatggc").getReverseComplement(), seq);
Path someFasta = work.resolve("some_fasta.fasta");
FileUtils.copyToFile(SingleFastqReaderTest.class.getClassLoader().getResourceAsStream("sequences/some_fasta.fasta"), someFasta.toFile());
// Path rootPath = new File(SingleFastqReaderTest.class.getClassLoader().getResource("sequences/some_fasta.fasta")
// .toURI()).toPath().toAbsolutePath().normalize().getParent();
seq = defaultResolver.resolve(new SequenceAddress(work, "file://some_fasta.fasta#24.6jsd21.Tut")).getRegion(new Range(10, 30));
Assert.assertEquals(new NucleotideSequence("ATCCTGGCTTAGAACTAACG"), seq);
}
use of com.milaboratory.core.sequence.NucleotideSequence in project repseqio by repseqio.
the class SequenceBaseTest method test1.
@Test
public void test1() throws Exception {
SequenceBase base = new SequenceBase();
base.put("A1", 10, new NucleotideSequence("ATTAGACACACAC"));
base.put("A1", 30, new NucleotideSequence("ATTACACA"));
base.put("A2", 0, new NucleotideSequence("TATAGACATAAGCA"));
assertNull(base.get("A1", new Range(21, 24)));
assertNull(base.get("A1", new Range(29, 32)));
assertNull(base.get("A3", new Range(29, 32)));
assertEquals(new NucleotideSequence("TAGA"), base.get("A1", new Range(12, 16)));
assertEquals(new NucleotideSequence("TCTA"), base.get("A1", new Range(16, 12)));
assertEquals(new NucleotideSequence("GACA"), base.get("A2", new Range(4, 8)));
}
use of com.milaboratory.core.sequence.NucleotideSequence in project repseqio by repseqio.
the class SequenceBaseTest method test3m.
@Test
public void test3m() throws Exception {
SequenceBase base = new SequenceBase();
base.put("A1", 100, new NucleotideSequence("ATTAGACACACAC"));
base.put("A1", 20, new NucleotideSequence("CACATA"));
base.put("A1", 10, new NucleotideSequence("ATTAGACACACAC"));
assertEquals(new NucleotideSequence("ACACA"), base.get("A1", new Range(19, 24)));
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 test5.
@Test
public void test5() throws Exception {
SequenceBase base = new SequenceBase();
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)));
}
use of com.milaboratory.core.sequence.NucleotideSequence in project repseqio by repseqio.
the class SequenceBaseTest method test3.
@Test
public void test3() throws Exception {
SequenceBase base = new SequenceBase();
base.put("A1", 20, new NucleotideSequence("CACATA"));
base.put("A1", 10, new NucleotideSequence("ATTAGACACACAC"));
assertEquals(new NucleotideSequence("ACACA"), base.get("A1", new Range(19, 24)));
}
Aggregations