use of samTextViewer.GenomicCoords in project ASCIIGenome by dariober.
the class TrackPileupTest method canConstructFromUnsortedInput.
@Test
public void canConstructFromUnsortedInput() throws ClassNotFoundException, IOException, InvalidGenomicCoordsException, InvalidRecordException, SQLException {
GenomicCoords gc = new GenomicCoords("chr1:1-1000", 80, null, null);
new TrackPileup("test_data/ds051.noindex.sam", gc);
}
use of samTextViewer.GenomicCoords in project ASCIIGenome by dariober.
the class TrackPileupTest method canHandleZeroReads.
@Test
public void canHandleZeroReads() throws ClassNotFoundException, IOException, InvalidGenomicCoordsException, InvalidRecordException, SQLException {
GenomicCoords gc = new GenomicCoords("chr1:1-1000", 80, null, null);
TrackPileup tr = new TrackPileup("test_data/ear045.oxBS.actb.bam", gc);
assertEquals(0, tr.getDepth(gc.getChrom(), gc.getFrom(), gc.getTo()).size());
}
use of samTextViewer.GenomicCoords in project ASCIIGenome by dariober.
the class TrackPileupTest method canCollectCoverageAtOnePos.
@Test
public void canCollectCoverageAtOnePos() throws ClassNotFoundException, IOException, InvalidGenomicCoordsException, InvalidRecordException, SQLException {
GenomicCoords gc = new GenomicCoords("chr7:5588536-5588536", 80, null, null);
TrackPileup tr = new TrackPileup("test_data/ear045.oxBS.actb.bam", gc);
assertEquals(1, tr.getDepth(gc.getChrom(), gc.getFrom(), gc.getTo()).size());
}
use of samTextViewer.GenomicCoords in project ASCIIGenome by dariober.
the class TrackPileupTest method canProcessReadsWithMissingSequence.
@Test
public void canProcessReadsWithMissingSequence() throws ClassNotFoundException, IOException, InvalidGenomicCoordsException, InvalidRecordException, SQLException, InvalidColourException, InvalidConfigException {
GenomicCoords gc = new GenomicCoords("chr7:1-1000", 80, null, null);
TrackPileup tr = new TrackPileup("test_data/missingReadSeq.bam", gc);
tr.setNoFormat(true);
tr.printToScreen();
assertTrue(tr.printToScreen().trim().startsWith("_"));
assertEquals(1, (int) tr.getDepth(gc.getChrom(), gc.getFrom(), gc.getTo()).entrySet().iterator().next().getValue());
}
use of samTextViewer.GenomicCoords in project ASCIIGenome by dariober.
the class TrackPileupTest method canFilterReadsContainingVariants.
@Test
public void canFilterReadsContainingVariants() throws InvalidGenomicCoordsException, IOException, ClassNotFoundException, InvalidRecordException, SQLException, InvalidColourException {
GenomicCoords gc = new GenomicCoords("chr7:1000001-1000081", 100, null, "test_data/chr7.fa");
TrackPileup tp = new TrackPileup("test_data/variant_reads.sam", gc);
tp.setNoFormat(true);
tp.setyMaxLines(10);
// N. reads stacked in this interval before filtering
assertEquals(10, tp.printToScreen().split("\n").length);
tp.setVariantReadInInterval("chr7", 1000001, 1000001, true);
System.err.println(tp.printToScreen());
assertEquals(1, tp.printToScreen().trim().split("\n").length);
}
Aggregations