Search in sources :

Example 1 with FirstOfPairFilter

use of filter.FirstOfPairFilter in project ASCIIGenome by dariober.

the class UtilsTest method canCountReadsInWindow.

@Test
public void canCountReadsInWindow() throws InvalidGenomicCoordsException, IOException {
    GenomicCoords gc = new GenomicCoords("chr7:5522436-5613572", 80, samSeqDict, fastaFile);
    List<SamRecordFilter> filters = new ArrayList<SamRecordFilter>();
    // Same as
    filters.add(new MappingQualityFilter(30));
    // samtools view -q 30 -f 64
    filters.add(new FirstOfPairFilter(true));
    long t0 = System.currentTimeMillis();
    for (int i = 0; i < 10; i++) {
        assertEquals(42770, Utils.countReadsInWindow("test_data/ear045.oxBS.actb.bam", gc, filters));
    }
    long t1 = System.currentTimeMillis();
    System.out.println("TIME TO FILTER: " + (t1 - t0));
    gc = new GenomicCoords("chr7:5524838-5611878", 80, samSeqDict, fastaFile);
}
Also used : MappingQualityFilter(htsjdk.samtools.filter.MappingQualityFilter) SamRecordFilter(htsjdk.samtools.filter.SamRecordFilter) FirstOfPairFilter(filter.FirstOfPairFilter) ArrayList(java.util.ArrayList) Test(org.junit.Test)

Aggregations

FirstOfPairFilter (filter.FirstOfPairFilter)1 MappingQualityFilter (htsjdk.samtools.filter.MappingQualityFilter)1 SamRecordFilter (htsjdk.samtools.filter.SamRecordFilter)1 ArrayList (java.util.ArrayList)1 Test (org.junit.Test)1