Search in sources :

Example 1 with ReadNegativeStrandFilter

use of filter.ReadNegativeStrandFilter in project ASCIIGenome by dariober.

the class UtilsTest method canCountReadsInWindow2.

@Test
public void canCountReadsInWindow2() throws InvalidGenomicCoordsException, IOException {
    GenomicCoords gc = new GenomicCoords("chr7:5524838-5611878", 80, samSeqDict, fastaFile);
    List<SamRecordFilter> filters = new ArrayList<SamRecordFilter>();
    assertEquals(100377, Utils.countReadsInWindow("test_data/ear045.oxBS.actb.bam", gc, filters));
    filters.add(new AlignedFilter(true));
    assertEquals(100265, Utils.countReadsInWindow("test_data/ear045.oxBS.actb.bam", gc, filters));
    filters = new ArrayList<SamRecordFilter>();
    filters.add(new AlignedFilter(true));
    filters.add(new ReadNegativeStrandFilter(false));
    assertEquals(50157, Utils.countReadsInWindow("test_data/ear045.oxBS.actb.bam", gc, filters));
    filters = new ArrayList<SamRecordFilter>();
    filters.add(new AlignedFilter(true));
    filters.add(new ReadNegativeStrandFilter(true));
    assertEquals(50108, Utils.countReadsInWindow("test_data/ear045.oxBS.actb.bam", gc, filters));
    filters = FlagToFilter.flagToFilterList(80, 1026);
    assertEquals(2729, Utils.countReadsInWindow("test_data/ear045.oxBS.actb.bam", gc, filters));
    filters = FlagToFilter.flagToFilterList(80, 1026);
    filters.add(new MappingQualityFilter(30));
    assertEquals(1592, Utils.countReadsInWindow("test_data/ear045.oxBS.actb.bam", gc, filters));
}
Also used : MappingQualityFilter(htsjdk.samtools.filter.MappingQualityFilter) SamRecordFilter(htsjdk.samtools.filter.SamRecordFilter) AlignedFilter(htsjdk.samtools.filter.AlignedFilter) ArrayList(java.util.ArrayList) ReadNegativeStrandFilter(filter.ReadNegativeStrandFilter) Test(org.junit.Test)

Aggregations

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