Search in sources :

Example 81 with GenomicCoords

use of samTextViewer.GenomicCoords in project ASCIIGenome by dariober.

the class TrackIntervalFeatureTest method canPrintGenotypeMatrix.

@Test
public void canPrintGenotypeMatrix() throws InvalidGenomicCoordsException, IOException, ClassNotFoundException, InvalidRecordException, SQLException {
    GenomicCoords gc = new GenomicCoords("1:577583-759855", 80, null, null);
    String intervalFileName = "test_data/ALL.wgs.mergedSV.v8.20130502.svs.genotypes.vcf.gz";
    TrackIntervalFeature tif = new TrackIntervalFeature(intervalFileName, gc);
    tif.setNoFormat(true);
    assertTrue(tif.printToScreen().contains("HG00096"));
}
Also used : GenomicCoords(samTextViewer.GenomicCoords) Test(org.junit.Test)

Example 82 with GenomicCoords

use of samTextViewer.GenomicCoords in project ASCIIGenome by dariober.

the class TrackIntervalFeatureTest method transcriptGFFToOneLine.

@Test
public void transcriptGFFToOneLine() throws InvalidGenomicCoordsException, IOException, ClassNotFoundException, InvalidRecordException, SQLException {
    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);
    System.out.println("PRINTING:" + tif.printToScreen());
    assertTrue(tif.printToScreen().startsWith("uuuuu"));
    assertTrue(tif.printToScreen().endsWith("www"));
    tif.setNoFormat(false);
    assertTrue(tif.printToScreen().trim().startsWith("["));
}
Also used : GenomicCoords(samTextViewer.GenomicCoords) Test(org.junit.Test)

Example 83 with GenomicCoords

use of samTextViewer.GenomicCoords in project ASCIIGenome by dariober.

the class TrackIntervalFeatureTest method canPrintGtfFeatures.

@Test
public void canPrintGtfFeatures() throws IOException, InvalidGenomicCoordsException, ClassNotFoundException, InvalidRecordException, SQLException, InvalidConfigException {
    String intervalFileName = "test_data/refSeq.bed";
    GenomicCoords gc = new GenomicCoords("chr1:1-70", 80, null, null);
    TrackIntervalFeature tif = new TrackIntervalFeature(intervalFileName, gc);
    tif.setNoFormat(true);
    assertEquals(2, tif.getIntervalFeatureList().size());
    assertEquals("||||", tif.printToScreen().substring(0, 4));
    tif.setNoFormat(false);
    // trim is necessary to remove escape \033
    assertTrue(tif.printToScreen().trim().startsWith("["));
    assertTrue(tif.printToScreen().length() > 100);
}
Also used : GenomicCoords(samTextViewer.GenomicCoords) Test(org.junit.Test)

Example 84 with GenomicCoords

use of samTextViewer.GenomicCoords in project ASCIIGenome by dariober.

the class TrackIntervalFeatureTest method canHideTitle.

@Test
public void canHideTitle() throws ClassNotFoundException, InvalidColourException, IOException, InvalidGenomicCoordsException, InvalidRecordException, SQLException {
    // See issue #42
    String intervalFileName = "test_data/hg19.gencode_genes_v19.gtf.gz";
    GenomicCoords gc = new GenomicCoords("chr7", 80, null, null);
    TrackIntervalFeature tif = new TrackIntervalFeature(intervalFileName, gc);
    tif.setHideTitle(true);
    assertEquals("", tif.getTitle());
}
Also used : GenomicCoords(samTextViewer.GenomicCoords) Test(org.junit.Test)

Example 85 with GenomicCoords

use of samTextViewer.GenomicCoords in project ASCIIGenome by dariober.

the class TrackIntervalFeatureTest method canReadFileWithComments.

@Test
public void canReadFileWithComments() throws IOException, InvalidGenomicCoordsException, ClassNotFoundException, InvalidRecordException, SQLException {
    GenomicCoords gc = new GenomicCoords("chr1:1-1000000", 80, null, null);
    String intervalFileName = "test_data/refSeq.bed";
    TrackIntervalFeature tif = new TrackIntervalFeature(intervalFileName, gc);
    assertEquals(2, tif.getFeaturesInInterval("chr1", 0, 100000).size());
}
Also used : GenomicCoords(samTextViewer.GenomicCoords) Test(org.junit.Test)

Aggregations

GenomicCoords (samTextViewer.GenomicCoords)156 Test (org.junit.Test)147 File (java.io.File)10 ArrayList (java.util.ArrayList)9 Config (coloring.Config)8 VCFFileReader (htsjdk.variant.vcf.VCFFileReader)8 VCFHeader (htsjdk.variant.vcf.VCFHeader)8 SAMRecord (htsjdk.samtools.SAMRecord)6 InvalidCommandLineException (exceptions.InvalidCommandLineException)3 InvalidGenomicCoordsException (exceptions.InvalidGenomicCoordsException)1 MappingQualityFilter (htsjdk.samtools.filter.MappingQualityFilter)1 SamRecordFilter (htsjdk.samtools.filter.SamRecordFilter)1 IOException (java.io.IOException)1 TrackReads (tracks.TrackReads)1