use of samTextViewer.GenomicCoords in project ASCIIGenome by dariober.
the class TrackIntervalFeatureTest method canShowHideFeatureByRegexFilters.
@Test
public void canShowHideFeatureByRegexFilters() throws InvalidGenomicCoordsException, IOException, ClassNotFoundException, InvalidRecordException, SQLException {
String intervalFileName = "test_data/hg19_genes_head.gtf.gz";
GenomicCoords gc = new GenomicCoords("chr1:10000-100000", 80, null, null);
TrackIntervalFeature tif = new TrackIntervalFeature(intervalFileName, gc);
tif.setNoFormat(true);
tif.setShowHideRegex(Pattern.compile(Filter.DEFAULT_SHOW_REGEX.getValue()), Pattern.compile("\texon\t"));
assertEquals(3, tif.getIntervalFeatureList().size());
tif.setShowHideRegex(Pattern.compile("WASH7P"), Pattern.compile("^$"));
assertTrue(tif.getIntervalFeatureList().size() == 11);
}
use of samTextViewer.GenomicCoords in project ASCIIGenome by dariober.
the class TrackIntervalFeatureTest method canShowAndHide_findNextRegex.
@Test
public void canShowAndHide_findNextRegex() throws IOException, InvalidGenomicCoordsException, ClassNotFoundException, InvalidRecordException, SQLException {
GenomicCoords gc = new GenomicCoords("chr1:1", 80, null, null);
String intervalFileName = "test_data/hg19_genes_head.gtf.gz";
TrackIntervalFeature tif = new TrackIntervalFeature(intervalFileName, gc);
tif.setShowHideRegex(Pattern.compile(".*exon.*"), Pattern.compile(".*DDX11L1.*"));
GenomicCoords curr = tif.findNextMatch(gc, Pattern.compile(".*gene_id.*"));
assertEquals(14362, (int) curr.getFrom());
}
use of samTextViewer.GenomicCoords in project ASCIIGenome by dariober.
the class TrackIntervalFeatureTest method canChangeFeatureName2.
@Test
public void canChangeFeatureName2() throws Exception {
// GFF with features that are not transcript (e.g. "chromosome")
String intervalFileName = "test_data/Homo_sapiens.GRCh38.86.chromosome.7.gff3.gz";
GenomicCoords gc = new GenomicCoords("7:1-1000", 80, null, null);
TrackIntervalFeature tif = new TrackIntervalFeature(intervalFileName, gc);
tif.setNoFormat(true);
assertTrue(tif.printToScreen().contains("chromosome:7"));
tif.setGtfAttributeForName("Alias");
System.err.println(tif.printToScreen());
assertTrue(tif.printToScreen().contains("CM000669"));
}
use of samTextViewer.GenomicCoords in project ASCIIGenome by dariober.
the class TrackIntervalFeatureTest method canReadFromHTTP.
@Test
public void canReadFromHTTP() throws IOException, InvalidGenomicCoordsException, ClassNotFoundException, InvalidRecordException, SQLException {
GenomicCoords gc = new GenomicCoords("chr1:1-1000", 80, null, null);
TrackIntervalFeature tif = new TrackIntervalFeature("https://raw.githubusercontent.com/dariober/ASCIIGenome/master/test_data/refSeq.bed", gc);
assertEquals("http", tif.getFilename().substring(0, 4));
assertEquals(2, tif.getIntervalFeatureList().size());
}
use of samTextViewer.GenomicCoords in project ASCIIGenome by dariober.
the class TrackIntervalFeatureTest method canReadTabixVCFFromHTTP.
@Test
public void canReadTabixVCFFromHTTP() throws IOException, InvalidGenomicCoordsException, ClassNotFoundException, InvalidRecordException, SQLException {
String bgzFn = "https://raw.githubusercontent.com/dariober/ASCIIGenome/master/test_data/CHD.exon.2010_03.sites.vcf.gz";
GenomicCoords gc = new GenomicCoords("1:1-2000000", 80, null, null);
TrackIntervalFeature tif = new TrackIntervalFeature(bgzFn, gc);
assertEquals(3, tif.getIntervalFeatureList().size());
assertEquals("http", tif.getWorkFilename().substring(0, 4));
}
Aggregations