Conditional support for PerformanceTrackingQuerySource to measure Tribble / GATK bridge performance
-- Removed DEBUG option, instead use MEASURE_TRIBBLE_QUERY_PERFORMANCE in RMDTrackerBuilder
This commit is contained in:
parent
2b97017871
commit
ac49b8d26b
|
|
@ -26,8 +26,11 @@ package org.broadinstitute.sting.gatk.refdata.tracks;
|
|||
import net.sf.samtools.SAMSequenceDictionary;
|
||||
import net.sf.samtools.util.CloseableIterator;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.broad.tribble.Feature;
|
||||
import org.broad.tribble.FeatureCodec;
|
||||
import org.broad.tribble.FeatureSource;
|
||||
import org.broad.tribble.iterators.CloseableTribbleIterator;
|
||||
import org.broad.tribble.source.PerformanceLoggingFeatureSource;
|
||||
import org.broadinstitute.sting.gatk.refdata.utils.FeatureToGATKFeatureIterator;
|
||||
import org.broadinstitute.sting.gatk.refdata.utils.GATKFeature;
|
||||
import org.broadinstitute.sting.utils.GenomeLoc;
|
||||
|
|
@ -47,7 +50,6 @@ import java.io.IOException;
|
|||
*/
|
||||
public class RMDTrack {
|
||||
private final static Logger logger = Logger.getLogger(RMDTrackBuilder.class);
|
||||
private final static boolean DEBUG = false;
|
||||
|
||||
// the basics of a track:
|
||||
private final Class type; // our type
|
||||
|
|
@ -113,8 +115,10 @@ public class RMDTrack {
|
|||
}
|
||||
|
||||
public CloseableIterator<GATKFeature> query(GenomeLoc interval) throws IOException {
|
||||
if ( DEBUG ) logger.debug("Issuing query for %s: " + interval);
|
||||
return new FeatureToGATKFeatureIterator(genomeLocParser, reader.query(interval.getContig(),interval.getStart(),interval.getStop()), this.getName());
|
||||
CloseableTribbleIterator<Feature> iter = reader.query(interval.getContig(),interval.getStart(),interval.getStop());
|
||||
if ( RMDTrackBuilder.MEASURE_TRIBBLE_QUERY_PERFORMANCE )
|
||||
logger.warn("Query " + getName() + ":" + ((PerformanceLoggingFeatureSource)reader).getPerformanceLog());
|
||||
return new FeatureToGATKFeatureIterator(genomeLocParser, iter, this.getName());
|
||||
}
|
||||
|
||||
public void close() {
|
||||
|
|
|
|||
|
|
@ -27,20 +27,21 @@ package org.broadinstitute.sting.gatk.refdata.tracks;
|
|||
import net.sf.samtools.SAMSequenceDictionary;
|
||||
import net.sf.samtools.SAMSequenceRecord;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.broad.tribble.*;
|
||||
import org.broad.tribble.FeatureCodec;
|
||||
import org.broad.tribble.FeatureSource;
|
||||
import org.broad.tribble.Tribble;
|
||||
import org.broad.tribble.TribbleException;
|
||||
import org.broad.tribble.index.Index;
|
||||
import org.broad.tribble.index.IndexFactory;
|
||||
import org.broad.tribble.source.BasicFeatureSource;
|
||||
import org.broad.tribble.source.PerformanceLoggingFeatureSource;
|
||||
import org.broad.tribble.util.LittleEndianOutputStream;
|
||||
import org.broadinstitute.sting.commandline.Tags;
|
||||
import org.broadinstitute.sting.gatk.arguments.ValidationExclusion;
|
||||
import org.broadinstitute.sting.gatk.refdata.ReferenceDependentFeatureCodec;
|
||||
import org.broadinstitute.sting.gatk.refdata.utils.RMDTriplet;
|
||||
import org.broadinstitute.sting.gatk.refdata.utils.RMDTriplet.RMDStorageType;
|
||||
import org.broadinstitute.sting.utils.GenomeLocParser;
|
||||
import org.broadinstitute.sting.utils.SequenceDictionaryUtils;
|
||||
import org.broadinstitute.sting.utils.Utils;
|
||||
import org.broadinstitute.sting.utils.classloader.PluginManager;
|
||||
import org.broadinstitute.sting.utils.collections.Pair;
|
||||
import org.broadinstitute.sting.utils.exceptions.ReviewedStingException;
|
||||
import org.broadinstitute.sting.utils.exceptions.UserException;
|
||||
|
|
@ -51,7 +52,10 @@ import org.broadinstitute.sting.utils.instrumentation.Sizeof;
|
|||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
|
||||
|
||||
|
||||
|
|
@ -70,6 +74,7 @@ public class RMDTrackBuilder { // extends PluginManager<FeatureCodec> {
|
|||
* our log, which we use to capture anything from this class
|
||||
*/
|
||||
private final static Logger logger = Logger.getLogger(RMDTrackBuilder.class);
|
||||
public final static boolean MEASURE_TRIBBLE_QUERY_PERFORMANCE = false;
|
||||
|
||||
// a constant we use for marking sequence dictionary entries in the Tribble index property list
|
||||
public static final String SequenceDictionaryPropertyPredicate = "DICT:";
|
||||
|
|
@ -214,7 +219,10 @@ public class RMDTrackBuilder { // extends PluginManager<FeatureCodec> {
|
|||
sequenceDictionary = getSequenceDictionaryFromProperties(index);
|
||||
}
|
||||
|
||||
featureSource = new BasicFeatureSource(inputFile.getAbsolutePath(), index, createCodec(descriptor, name));
|
||||
if ( MEASURE_TRIBBLE_QUERY_PERFORMANCE )
|
||||
featureSource = new PerformanceLoggingFeatureSource(inputFile.getAbsolutePath(), index, createCodec(descriptor, name));
|
||||
else
|
||||
featureSource = new BasicFeatureSource(inputFile.getAbsolutePath(), index, createCodec(descriptor, name));
|
||||
}
|
||||
catch (TribbleException e) {
|
||||
throw new UserException(e.getMessage());
|
||||
|
|
|
|||
Loading…
Reference in New Issue