2009-04-10 04:28:17 +08:00
|
|
|
package org.broadinstitute.sting.gatk.traversals;
|
|
|
|
|
|
2010-05-27 06:12:25 +08:00
|
|
|
import net.sf.picard.filter.SamRecordFilter;
|
|
|
|
|
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
|
|
|
|
|
import org.broadinstitute.sting.utils.Utils;
|
|
|
|
|
|
2009-04-10 04:28:17 +08:00
|
|
|
/**
|
|
|
|
|
* Created by IntelliJ IDEA.
|
|
|
|
|
* User: hanna
|
|
|
|
|
* Date: Apr 8, 2009
|
|
|
|
|
* Time: 4:13:40 PM
|
|
|
|
|
*
|
|
|
|
|
* Holds a bunch of basic information about the traversal.
|
|
|
|
|
* TODO: Make this a class that can be passed around from the TraversalEngine to other entries that want to update it.
|
|
|
|
|
*/
|
|
|
|
|
public class TraversalStatistics {
|
|
|
|
|
// Number of records (loci, reads) we've processed
|
|
|
|
|
public static long nRecords;
|
|
|
|
|
// How many reads have we processed, along with those skipped for various reasons
|
2010-03-09 06:44:54 +08:00
|
|
|
public static long nReads;
|
|
|
|
|
public static long nSkippedReads;
|
|
|
|
|
public static long nUnmappedReads;
|
|
|
|
|
public static long nNotPrimary;
|
|
|
|
|
public static long nBadAlignments;
|
|
|
|
|
public static long nSkippedIndels;
|
|
|
|
|
public static long nDuplicates;
|
2010-05-27 06:12:25 +08:00
|
|
|
public static Map<Class, Long> counter = new HashMap<Class, Long>();
|
2009-04-10 04:28:17 +08:00
|
|
|
|
|
|
|
|
static {
|
|
|
|
|
reset();
|
|
|
|
|
}
|
|
|
|
|
|
2010-05-27 06:12:25 +08:00
|
|
|
public static void incrementFilter(SamRecordFilter filter) {
|
|
|
|
|
long c = 0;
|
|
|
|
|
if ( counter.containsKey(filter.getClass()) ) {
|
|
|
|
|
c = counter.get(filter.getClass());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
counter.put(filter.getClass(), c + 1L);
|
|
|
|
|
}
|
|
|
|
|
|
2009-04-10 04:28:17 +08:00
|
|
|
public static void reset() {
|
|
|
|
|
nRecords = 0;
|
|
|
|
|
nReads = 0;
|
|
|
|
|
nSkippedReads = 0;
|
|
|
|
|
nUnmappedReads = 0;
|
|
|
|
|
nNotPrimary = 0;
|
|
|
|
|
nBadAlignments = 0;
|
|
|
|
|
nSkippedIndels = 0;
|
2009-04-17 09:27:36 +08:00
|
|
|
nDuplicates = 0;
|
2009-04-10 04:28:17 +08:00
|
|
|
}
|
|
|
|
|
}
|