Bring CombineVariants back to public since it's used for SG. I needed to break ChromosomeCountConstants out of ChromosomeCounts to make this work.
This commit is contained in:
parent
c87ad8c0ef
commit
676e79542a
|
|
@ -35,10 +35,8 @@ import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.AnnotatorCompa
|
||||||
import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.InfoFieldAnnotation;
|
import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.InfoFieldAnnotation;
|
||||||
import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.StandardAnnotation;
|
import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.StandardAnnotation;
|
||||||
import org.broadinstitute.sting.utils.genotyper.PerReadAlleleLikelihoodMap;
|
import org.broadinstitute.sting.utils.genotyper.PerReadAlleleLikelihoodMap;
|
||||||
import org.broadinstitute.variant.vcf.VCFConstants;
|
|
||||||
import org.broadinstitute.variant.vcf.VCFHeaderLine;
|
import org.broadinstitute.variant.vcf.VCFHeaderLine;
|
||||||
import org.broadinstitute.variant.vcf.VCFInfoHeaderLine;
|
import org.broadinstitute.variant.vcf.VCFInfoHeaderLine;
|
||||||
import org.broadinstitute.variant.vcf.VCFStandardHeaderLines;
|
|
||||||
import org.broadinstitute.variant.variantcontext.VariantContext;
|
import org.broadinstitute.variant.variantcontext.VariantContext;
|
||||||
import org.broadinstitute.variant.variantcontext.VariantContextUtils;
|
import org.broadinstitute.variant.variantcontext.VariantContextUtils;
|
||||||
|
|
||||||
|
|
@ -52,12 +50,6 @@ import java.util.*;
|
||||||
*/
|
*/
|
||||||
public class ChromosomeCounts extends InfoFieldAnnotation implements StandardAnnotation, ActiveRegionBasedAnnotation {
|
public class ChromosomeCounts extends InfoFieldAnnotation implements StandardAnnotation, ActiveRegionBasedAnnotation {
|
||||||
|
|
||||||
public static final String[] keyNames = { VCFConstants.ALLELE_NUMBER_KEY, VCFConstants.ALLELE_COUNT_KEY, VCFConstants.ALLELE_FREQUENCY_KEY };
|
|
||||||
public static final VCFInfoHeaderLine[] descriptions = {
|
|
||||||
VCFStandardHeaderLines.getInfoLine(VCFConstants.ALLELE_FREQUENCY_KEY),
|
|
||||||
VCFStandardHeaderLines.getInfoLine(VCFConstants.ALLELE_COUNT_KEY),
|
|
||||||
VCFStandardHeaderLines.getInfoLine(VCFConstants.ALLELE_NUMBER_KEY) };
|
|
||||||
|
|
||||||
private Set<String> founderIds = new HashSet<String>();
|
private Set<String> founderIds = new HashSet<String>();
|
||||||
|
|
||||||
public Map<String, Object> annotate(final RefMetaDataTracker tracker,
|
public Map<String, Object> annotate(final RefMetaDataTracker tracker,
|
||||||
|
|
@ -78,8 +70,8 @@ public class ChromosomeCounts extends InfoFieldAnnotation implements StandardAnn
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<String> getKeyNames() {
|
public List<String> getKeyNames() {
|
||||||
return Arrays.asList(keyNames);
|
return Arrays.asList(ChromosomeCountConstants.keyNames);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<VCFInfoHeaderLine> getDescriptions() { return Arrays.asList(descriptions); }
|
public List<VCFInfoHeaderLine> getDescriptions() { return Arrays.asList(ChromosomeCountConstants.descriptions); }
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,44 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2010.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person
|
||||||
|
* obtaining a copy of this software and associated documentation
|
||||||
|
* files (the "Software"), to deal in the Software without
|
||||||
|
* restriction, including without limitation the rights to use,
|
||||||
|
* copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the
|
||||||
|
* Software is furnished to do so, subject to the following
|
||||||
|
* conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be
|
||||||
|
* included in all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||||
|
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||||
|
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||||
|
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
|
||||||
|
* THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.broadinstitute.sting.gatk.walkers.annotator;
|
||||||
|
|
||||||
|
import org.broadinstitute.variant.vcf.VCFConstants;
|
||||||
|
import org.broadinstitute.variant.vcf.VCFInfoHeaderLine;
|
||||||
|
import org.broadinstitute.variant.vcf.VCFStandardHeaderLines;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Keys and descriptions for the common chromosome count annotations
|
||||||
|
*/
|
||||||
|
public class ChromosomeCountConstants {
|
||||||
|
|
||||||
|
public static final String[] keyNames = { VCFConstants.ALLELE_NUMBER_KEY, VCFConstants.ALLELE_COUNT_KEY, VCFConstants.ALLELE_FREQUENCY_KEY };
|
||||||
|
|
||||||
|
public static final VCFInfoHeaderLine[] descriptions = {
|
||||||
|
VCFStandardHeaderLines.getInfoLine(VCFConstants.ALLELE_FREQUENCY_KEY),
|
||||||
|
VCFStandardHeaderLines.getInfoLine(VCFConstants.ALLELE_COUNT_KEY),
|
||||||
|
VCFStandardHeaderLines.getInfoLine(VCFConstants.ALLELE_NUMBER_KEY) };
|
||||||
|
}
|
||||||
|
|
@ -35,7 +35,7 @@ import org.broadinstitute.sting.gatk.walkers.Reference;
|
||||||
import org.broadinstitute.sting.gatk.walkers.RodWalker;
|
import org.broadinstitute.sting.gatk.walkers.RodWalker;
|
||||||
import org.broadinstitute.sting.gatk.walkers.TreeReducible;
|
import org.broadinstitute.sting.gatk.walkers.TreeReducible;
|
||||||
import org.broadinstitute.sting.gatk.walkers.Window;
|
import org.broadinstitute.sting.gatk.walkers.Window;
|
||||||
import org.broadinstitute.sting.gatk.walkers.annotator.ChromosomeCounts;
|
import org.broadinstitute.sting.gatk.walkers.annotator.ChromosomeCountConstants;
|
||||||
import org.broadinstitute.sting.utils.SampleUtils;
|
import org.broadinstitute.sting.utils.SampleUtils;
|
||||||
import org.broadinstitute.sting.utils.variant.GATKVCFUtils;
|
import org.broadinstitute.sting.utils.variant.GATKVCFUtils;
|
||||||
import org.broadinstitute.variant.vcf.*;
|
import org.broadinstitute.variant.vcf.*;
|
||||||
|
|
@ -217,7 +217,7 @@ public class CombineVariants extends RodWalker<Integer, Integer> implements Tree
|
||||||
if ( SET_KEY != null )
|
if ( SET_KEY != null )
|
||||||
headerLines.add(new VCFInfoHeaderLine(SET_KEY, 1, VCFHeaderLineType.String, "Source VCF for the merged record in CombineVariants"));
|
headerLines.add(new VCFInfoHeaderLine(SET_KEY, 1, VCFHeaderLineType.String, "Source VCF for the merged record in CombineVariants"));
|
||||||
if ( !ASSUME_IDENTICAL_SAMPLES )
|
if ( !ASSUME_IDENTICAL_SAMPLES )
|
||||||
headerLines.addAll(Arrays.asList(ChromosomeCounts.descriptions));
|
headerLines.addAll(Arrays.asList(ChromosomeCountConstants.descriptions));
|
||||||
VCFHeader vcfHeader = new VCFHeader(headerLines, samples);
|
VCFHeader vcfHeader = new VCFHeader(headerLines, samples);
|
||||||
vcfHeader.setWriteCommandLine(!SUPPRESS_COMMAND_LINE_HEADER);
|
vcfHeader.setWriteCommandLine(!SUPPRESS_COMMAND_LINE_HEADER);
|
||||||
vcfWriter.writeHeader(vcfHeader);
|
vcfWriter.writeHeader(vcfHeader);
|
||||||
Loading…
Reference in New Issue