From 73d41bfa24b686bdfcf6176529ecef3e8ddbee80 Mon Sep 17 00:00:00 2001 From: depristo Date: Fri, 3 Sep 2010 12:52:33 +0000 Subject: [PATCH] CountLoci nows writes out to a file for Queue status tracking. VariantAnnotatorEngine has a special group None that doesn't add any annotations; useful for those who are testing UG performance git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@4202 348d0f76-0448-11de-a6fe-93d51630548a --- .../annotator/VariantAnnotatorEngine.java | 34 ++++++++++--------- .../gatk/walkers/qc/CountLociWalker.java | 7 ++++ 2 files changed, 25 insertions(+), 16 deletions(-) diff --git a/java/src/org/broadinstitute/sting/gatk/walkers/annotator/VariantAnnotatorEngine.java b/java/src/org/broadinstitute/sting/gatk/walkers/annotator/VariantAnnotatorEngine.java index a28152f06..199ad777e 100755 --- a/java/src/org/broadinstitute/sting/gatk/walkers/annotator/VariantAnnotatorEngine.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/annotator/VariantAnnotatorEngine.java @@ -98,22 +98,24 @@ public class VariantAnnotatorEngine { HashSet classes = new HashSet(); // get the classes from the provided groups (interfaces) - for ( String group : annotationGroupsToUse ) { - Class interfaceClass = classMap.get(group); - if ( interfaceClass == null ) - interfaceClass = classMap.get(group + "Annotation"); - if ( interfaceClass == null ) - throw new StingException("Class " + group + " is not found; please check that you have specified the class name correctly"); - classes.addAll(PackageUtils.getClassesImplementingInterface(interfaceClass)); - } - // get the specific classes provided - for ( String annotation : annotationsToUse ) { - Class annotationClass = classMap.get(annotation); - if ( annotationClass == null ) - annotationClass = classMap.get(annotation + "Annotation"); - if ( annotationClass == null ) - throw new StingException("Class " + annotation + " is not found; please check that you have specified the class name correctly"); - classes.add(annotationClass); + if ( annotationGroupsToUse.size() != 1 || ! annotationGroupsToUse.get(0).toLowerCase().equals("none") ) { + for ( String group : annotationGroupsToUse ) { + Class interfaceClass = classMap.get(group); + if ( interfaceClass == null ) + interfaceClass = classMap.get(group + "Annotation"); + if ( interfaceClass == null ) + throw new StingException("Class " + group + " is not found; please check that you have specified the class name correctly"); + classes.addAll(PackageUtils.getClassesImplementingInterface(interfaceClass)); + } + // get the specific classes provided + for ( String annotation : annotationsToUse ) { + Class annotationClass = classMap.get(annotation); + if ( annotationClass == null ) + annotationClass = classMap.get(annotation + "Annotation"); + if ( annotationClass == null ) + throw new StingException("Class " + annotation + " is not found; please check that you have specified the class name correctly"); + classes.add(annotationClass); + } } // get the instances diff --git a/java/src/org/broadinstitute/sting/gatk/walkers/qc/CountLociWalker.java b/java/src/org/broadinstitute/sting/gatk/walkers/qc/CountLociWalker.java index e5480c6b3..ebbdd9193 100755 --- a/java/src/org/broadinstitute/sting/gatk/walkers/qc/CountLociWalker.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/qc/CountLociWalker.java @@ -1,16 +1,23 @@ package org.broadinstitute.sting.gatk.walkers.qc; +import net.sf.samtools.SAMFileWriter; +import org.broadinstitute.sting.commandline.Output; import org.broadinstitute.sting.gatk.contexts.AlignmentContext; import org.broadinstitute.sting.gatk.contexts.ReferenceContext; import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; import org.broadinstitute.sting.gatk.walkers.LocusWalker; import org.broadinstitute.sting.gatk.walkers.TreeReducible; +import java.io.PrintStream; + /** * Walks over the input data set, calculating the total number of covered loci for diagnostic purposes. * Simplest example of a locus walker. */ public class CountLociWalker extends LocusWalker implements TreeReducible { + @Output(doc="Write count to this file instead of STDOUT") + PrintStream out; + public Integer map(RefMetaDataTracker tracker, ReferenceContext ref, AlignmentContext context) { return 1; }