use of com.github.lindenb.jvarkit.util.bio.fasta.FastaSequence in project jvarkit by lindenb.
the class TestNg01 method testRefGenomeFactoryForFile.
@Test
public void testRefGenomeFactoryForFile() throws IOException {
final ReferenceGenomeFactory rgf = new ReferenceGenomeFactory();
rgf.setBufferSize(2);
final ReferenceGenome ref = rgf.open(TOY_FA);
final FastaSequenceReader fsr = new FastaSequenceReader();
final List<FastaSequence> seqs = fsr.readAll(new File(TOY_FA));
Assert.assertEquals(seqs.size(), ref.size());
for (int i = 0; i < seqs.size(); i++) {
Assert.assertEquals(ref.getContig(i).length(), seqs.get(i).length());
Assert.assertEquals(ref.getContig(i).getContig(), seqs.get(i).getName());
for (int x = 0; x < ref.getContig(i).length(); ++x) {
Assert.assertEquals(ref.getContig(i).charAt(x), seqs.get(i).charAt(x));
}
}
ref.close();
}
Aggregations