/** * Get the VCF header lines to include when emitting reference confidence values via calculateRefConfidence * @return a non-null set of VCFHeaderLines */ public Set<VCFHeaderLine> getVCFHeaderLines() { final Set<VCFHeaderLine> headerLines = new LinkedHashSet<>(); headerLines.add(new VCFSimpleHeaderLine(GATKVCFConstants.SYMBOLIC_ALLELE_DEFINITION_HEADER_TAG, GATKVCFConstants.NON_REF_SYMBOLIC_ALLELE_NAME, "Represents any possible alternative allele at this location")); return headerLines; }
/** * IT IS CRITICAL THAT THIS BE OVERRIDDEN SO WE SORT THE CONTIGS IN THE CORRECT ORDER */ @Override public int compareTo(final Object other) { if ( other instanceof VCFContigHeaderLine ) return contigIndex.compareTo(((VCFContigHeaderLine) other).contigIndex); else { return super.compareTo(other); } } }
protected String toStringEncoding() { Map<String, Object> map = new LinkedHashMap<String, Object>(); map.put("ID", name); map.putAll(genericFields); return getKey() + "=" + VCFHeaderLine.toStringEncoding(map); }
public VCFSimpleHeaderLine(final String key, final Map<String, String> mapping) { super(key, ""); name = mapping.get("ID"); initialize(name, mapping); }
@Override public int hashCode() { int result = super.hashCode(); result = 31 * result + contigIndex.hashCode(); return result; }
@Override public boolean equals(final Object o) { if ( this == o ) { return true; } if ( o == null || getClass() != o.getClass() || ! super.equals(o) ) { return false; } final VCFContigHeaderLine that = (VCFContigHeaderLine) o; return contigIndex.equals(that.contigIndex); }
public VCFSimpleHeaderLine(final String key, final Map<String, String> mapping) { super(key, ""); name = mapping.get("ID"); initialize(name, mapping); }
@Override public int hashCode() { int result = super.hashCode(); result = 31 * result + contigIndex.hashCode(); return result; }
@Override public boolean equals(final Object o) { if ( this == o ) { return true; } if ( o == null || getClass() != o.getClass() || ! super.equals(o) ) { return false; } final VCFContigHeaderLine that = (VCFContigHeaderLine) o; return contigIndex.equals(that.contigIndex); }
private Set<VCFHeaderLine> getSampleHeaderLines(){ final Set<VCFHeaderLine> sampleLines = new HashSet<>(); if (printTCGAsampleHeader) { //NOTE: This will only list the first bam file for each tumor/normal sample if there is more than one final Map<String, String> normalSampleHeaderAttributes = new HashMap<>(); normalSampleHeaderAttributes.put("ID", "NORMAL"); normalSampleHeaderAttributes.put("SampleName", normalSampleName); if (normalSAMReaderIDs.iterator().hasNext() && !getToolkit().getArguments().disableCommandLineInVCF) normalSampleHeaderAttributes.put("File", normalSAMReaderIDs.iterator().next().getSamFilePath()); final VCFSimpleHeaderLine normalSampleHeader = new VCFSimpleHeaderLine("SAMPLE", normalSampleHeaderAttributes); final Map<String, String> tumorSampleHeaderAttributes = new HashMap<>(); tumorSampleHeaderAttributes.put("ID", "TUMOR"); tumorSampleHeaderAttributes.put("SampleName", tumorSampleName); if (tumorSAMReaderIDs.iterator().hasNext() && !getToolkit().getArguments().disableCommandLineInVCF) tumorSampleHeaderAttributes.put("File", tumorSAMReaderIDs.iterator().next().getSamFilePath()); final VCFSimpleHeaderLine tumorSampleHeader = new VCFSimpleHeaderLine("SAMPLE", tumorSampleHeaderAttributes); sampleLines.add(normalSampleHeader); sampleLines.add(tumorSampleHeader); } return sampleLines; }
public VCFSimpleHeaderLine(final String key, final Map<String, String> mapping) { super(key, ""); name = mapping.get("ID"); initialize(name, mapping); }
@Override protected String toStringEncoding() { Map<String, Object> map = new LinkedHashMap<String, Object>(); map.put("ID", name); map.putAll(genericFields); return getKey() + "=" + VCFHeaderLine.toStringEncoding(map); }
/** * IT IS CRITICAL THAT THIS BE OVERRIDDEN SO WE SORT THE CONTIGS IN THE CORRECT ORDER */ @Override public int compareTo(final Object other) { if ( other instanceof VCFContigHeaderLine ) return contigIndex.compareTo(((VCFContigHeaderLine) other).contigIndex); else { return super.compareTo(other); } } }
/** * Gets the appropriately formatted header for a VCF file describing this GATK run * * @param header the existing VCFHeader that we will be adding this command line argument header line to. Existing * command line argument header lines will be used to generate a unique header line key. * @param engine the GATK engine that holds the walker name, GATK version, and other information * @param argumentSources contains information on the argument values provided to the GATK for converting to a * command line string. Should be provided from the data in the parsing engine. Can be * empty in which case the command line will be the empty string. * @return VCF header line describing this run of the GATK. */ public static VCFHeaderLine getCommandLineArgumentHeaderLine(final VCFHeader header, final GenomeAnalysisEngine engine, final Collection<Object> argumentSources) { if ( engine == null ) throw new IllegalArgumentException("engine cannot be null"); if ( argumentSources == null ) throw new IllegalArgumentException("argumentSources cannot be null"); final Map<String, String> attributes = new LinkedHashMap<>(); attributes.put("ID", engine.getWalkerName()); attributes.put("Version", CommandLineGATK.getVersionNumber()); final Date date = new Date(); attributes.put("Date", date.toString()); attributes.put("Epoch", Long.toString(date.getTime())); attributes.put("CommandLineOptions", engine.createApproximateCommandLineArgumentString(argumentSources.toArray())); // in case the walker name contains space, remove any spaces String key = getCommandLineKey(header, engine.getWalkerName().replaceAll("\\s", "")); return new VCFSimpleHeaderLine(key, attributes); }
/** * create a VCF filter header line * * @param key the key for this header line * @param name the name for this header line * @param description description for this header line */ public VCFSimpleHeaderLine(String key, String name, String description) { super(key, ""); Map<String, String> map = new LinkedHashMap<String, String>(1); map.put("Description", description); initialize(name, map); }
@Override protected String toStringEncoding() { Map<String, Object> map = new LinkedHashMap<String, Object>(); map.put("ID", name); map.putAll(genericFields); return getKey() + "=" + VCFHeaderLine.toStringEncoding(map); }
/** * IT IS CRITICAL THAT THIS BE OVERRIDDEN SO WE SORT THE CONTIGS IN THE CORRECT ORDER */ @Override public int compareTo(final Object other) { if ( other instanceof VCFContigHeaderLine ) return contigIndex.compareTo(((VCFContigHeaderLine) other).contigIndex); else { return super.compareTo(other); } } }
metaData.add(contig); } else if ( str.startsWith(VCFConstants.ALT_HEADER_START) ) { final VCFSimpleHeaderLine alt = new VCFSimpleHeaderLine(str.substring(6), version, VCFConstants.ALT_HEADER_START.substring(2), Arrays.asList("ID", "Description"), Collections.emptyList()); metaData.add(alt); } else {
/** * create a VCF filter header line * * @param key the key for this header line * @param name the name for this header line * @param description description for this header line */ public VCFSimpleHeaderLine(String key, String name, String description) { super(key, ""); Map<String, String> map = new LinkedHashMap<String, String>(1); map.put("Description", description); initialize(name, map); }
metaData.add(contig); } else if ( str.startsWith(VCFConstants.ALT_HEADER_START) ) { final VCFSimpleHeaderLine alt = new VCFSimpleHeaderLine(str.substring(6), version, VCFConstants.ALT_HEADER_START.substring(2), Arrays.asList("ID", "Description")); metaData.add(alt); } else {