use of samTextViewer.GenomicCoords in project ASCIIGenome by dariober.
the class TrackIntervalFeatureTest method canStackFeaturesInOneLine.
@Test
public void canStackFeaturesInOneLine() throws InvalidGenomicCoordsException, IOException, ClassNotFoundException, InvalidRecordException, SQLException {
String intervalFileName = "test_data/overlapped.bed";
GenomicCoords gc = new GenomicCoords("chr1:1-70", 80, null, null);
TrackIntervalFeature tif = new TrackIntervalFeature(intervalFileName, gc);
tif.setNoFormat(true);
tif.setFeatureDisplayMode(FeatureDisplayMode.ONELINE);
String exp = ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>> <<<<<<<<<<";
assertEquals(exp, tif.printToScreen().trim());
}
use of samTextViewer.GenomicCoords in project ASCIIGenome by dariober.
the class TrackIntervalFeatureTest method canHandleGFFWithoutSupeFeatures.
@Test
public void canHandleGFFWithoutSupeFeatures() throws InvalidGenomicCoordsException, IOException, ClassNotFoundException, InvalidRecordException, SQLException, InvalidColourException, InvalidConfigException {
// We have a GFF with only exons. Since there are no "transcripts", there is nothing to group by.
// See also issue #74.
GenomicCoords gc = new GenomicCoords("chr1:11800-20000", 80, null, null);
TrackIntervalFeature tif = new TrackIntervalFeature("test_data/issue74.gff3.gz", gc);
tif.setNoFormat(true);
assertEquals(10, tif.intervalFeatureList.size());
}
use of samTextViewer.GenomicCoords in project ASCIIGenome by dariober.
the class TrackIntervalFeatureTest method canAddNameToGFFTranscript.
@Test
public void canAddNameToGFFTranscript() throws InvalidGenomicCoordsException, IOException, ClassNotFoundException, InvalidRecordException, SQLException, InvalidConfigException {
String intervalFileName = "test_data/Homo_sapiens.GRCh38.86.ENST00000331789.gff3";
GenomicCoords gc = new GenomicCoords("7:5527151-5530709", 80, null, null);
TrackIntervalFeature tif = new TrackIntervalFeature(intervalFileName, gc);
tif.setNoFormat(true);
assertTrue(tif.printToScreen().contains("ACTB-001"));
tif.setNoFormat(false);
assertTrue(tif.printToScreen().trim().startsWith("["));
}
use of samTextViewer.GenomicCoords in project ASCIIGenome by dariober.
the class TrackIntervalFeatureTest method canColorGTFFeaturesByRegex.
@Test
public void canColorGTFFeaturesByRegex() throws InvalidGenomicCoordsException, IOException, ClassNotFoundException, InvalidRecordException, SQLException, InvalidColourException {
GenomicCoords gc = new GenomicCoords("chr1:1-100000", 80, null, null);
TrackIntervalFeature tif = new TrackIntervalFeature("test_data/hg19_genes_head.gtf", gc);
// This is to populate the ideograms.
tif.printToScreen();
List<Argument> colorForRegex = new ArrayList<Argument>();
colorForRegex.add(new Argument("DDX11L1", "216", false));
tif.setColorForRegex(colorForRegex);
assertTrue(tif.printToScreen().contains("216"));
colorForRegex.clear();
// 233:grey7 (almost black)
colorForRegex.add(new Argument("WASH7P", "233", false));
tif.setColorForRegex(colorForRegex);
assertTrue(tif.printToScreen().contains("233"));
assertTrue(tif.printToScreen().contains("216"));
// Foreground color
assertTrue(tif.printToScreen().contains("253"));
// Reset default
tif.setColorForRegex(null);
assertTrue(!tif.printToScreen().contains("216"));
}
use of samTextViewer.GenomicCoords in project ASCIIGenome by dariober.
the class TrackIntervalFeatureTest method canReadUnsortedVCFFromHTTP.
@Test
public void canReadUnsortedVCFFromHTTP() throws IOException, InvalidGenomicCoordsException, ClassNotFoundException, InvalidRecordException, SQLException {
GenomicCoords gc = new GenomicCoords("1:1-1142000", 80, null, null);
TrackIntervalFeature tif = new TrackIntervalFeature("https://raw.githubusercontent.com/dariober/ASCIIGenome/master/test_data/CHD.exon.2010_03.sites.unsorted.vcf", gc);
assertEquals("http", tif.getFilename().substring(0, 4));
assertEquals(3, tif.getIntervalFeatureList().size());
}
Aggregations