/** * Update the attributes of the attributes map in the VariantContextBuilder to reflect the proper * chromosome-based VCF tags based on the current VC produced by builder.make() * * @param builder the VariantContextBuilder we are updating * @param removeStaleValues should we remove stale values from the mapping? */ public static void calculateChromosomeCounts(VariantContextBuilder builder, boolean removeStaleValues) { VariantContext vc = builder.make(); builder.attributes(calculateChromosomeCounts(vc, new HashMap<String, Object>(vc.getAttributes()), removeStaleValues, new HashSet<String>(0))); }
/** * Update the attributes of the attributes map in the VariantContextBuilder to reflect the proper * chromosome-based VCF tags based on the current VC produced by builder.make() * * @param builder the VariantContextBuilder we are updating * @param removeStaleValues should we remove stale values from the mapping? */ public static void calculateChromosomeCounts(VariantContextBuilder builder, boolean removeStaleValues) { VariantContext vc = builder.make(); builder.attributes(calculateChromosomeCounts(vc, new HashMap<>(vc.getAttributes()), removeStaleValues, new HashSet<>(0))); }
/** * Update the attributes of the attributes map in the VariantContextBuilder to reflect the proper * chromosome-based VCF tags based on the current VC produced by builder.make() * * @param builder the VariantContextBuilder we are updating * @param removeStaleValues should we remove stale values from the mapping? */ public static void calculateChromosomeCounts(VariantContextBuilder builder, boolean removeStaleValues) { VariantContext vc = builder.make(); builder.attributes(calculateChromosomeCounts(vc, new HashMap<>(vc.getAttributes()), removeStaleValues, new HashSet<>(0))); }
/** * Update the attributes of the attributes map in the VariantContextBuilder to reflect the proper * chromosome-based VCF tags based on the current VC produced by builder.make() * * @param builder the VariantContextBuilder we are updating * @param founderIds - Set of founders to take into account. AF and FC will be calculated over the founders only. * If empty or null, counts are generated for all samples as unrelated individuals * @param removeStaleValues should we remove stale values from the mapping? */ public static void calculateChromosomeCounts(VariantContextBuilder builder, boolean removeStaleValues, final Set<String> founderIds) { VariantContext vc = builder.make(); builder.attributes(calculateChromosomeCounts(vc, new HashMap<String, Object>(vc.getAttributes()), removeStaleValues, founderIds)); }
/** * Update the attributes of the attributes map in the VariantContextBuilder to reflect the proper * chromosome-based VCF tags based on the current VC produced by builder.make() * * @param builder the VariantContextBuilder we are updating * @param founderIds - Set of founders to take into account. AF and FC will be calculated over the founders only. * If empty or null, counts are generated for all samples as unrelated individuals * @param removeStaleValues should we remove stale values from the mapping? */ public static void calculateChromosomeCounts(VariantContextBuilder builder, boolean removeStaleValues, final Set<String> founderIds) { VariantContext vc = builder.make(); builder.attributes(calculateChromosomeCounts(vc, new HashMap<>(vc.getAttributes()), removeStaleValues, founderIds)); }
private void buildInfo( VariantContext vc ) throws IOException { for ( Map.Entry<String, Object> infoFieldEntry : vc.getAttributes().entrySet() ) { final String field = infoFieldEntry.getKey(); final BCF2FieldWriter.SiteWriter writer = fieldManager.getSiteFieldWriter(field); if ( writer == null ) errorUnexpectedFieldToWrite(vc, field, "INFO"); writer.start(encoder, vc); writer.site(encoder, vc); writer.done(encoder, vc); } }
private void buildInfo( VariantContext vc ) throws IOException { for ( Map.Entry<String, Object> infoFieldEntry : vc.getAttributes().entrySet() ) { final String field = infoFieldEntry.getKey(); final BCF2FieldWriter.SiteWriter writer = fieldManager.getSiteFieldWriter(field); if ( writer == null ) errorUnexpectedFieldToWrite(vc, field, "INFO"); writer.start(encoder, vc); writer.site(encoder, vc); writer.done(encoder, vc); } }
private void buildInfo( VariantContext vc ) throws IOException { for ( Map.Entry<String, Object> infoFieldEntry : vc.getAttributes().entrySet() ) { final String field = infoFieldEntry.getKey(); final BCF2FieldWriter.SiteWriter writer = fieldManager.getSiteFieldWriter(field); if ( writer == null ) errorUnexpectedFieldToWrite(vc, field, "INFO"); writer.start(encoder, vc); writer.site(encoder, vc); writer.done(encoder, vc); } }
public String toStringWithoutGenotypes() { return String.format("[VC %s @ %s Q%s of type=%s alleles=%s attr=%s filters=%s", getSource(), contig + ":" + (start - stop == 0 ? start : start + "-" + stop), hasLog10PError() ? String.format("%.2f", getPhredScaledQual()) : ".", this.getType(), ParsingUtils.sortList(this.getAlleles()), ParsingUtils.sortedString(this.getAttributes()), String.join(",", commonInfo.getFilters())); }
public String toStringWithoutGenotypes() { return String.format("[VC %s @ %s Q%s of type=%s alleles=%s attr=%s filters=%s", getSource(), contig + ":" + (start - stop == 0 ? start : start + "-" + stop), hasLog10PError() ? String.format("%.2f", getPhredScaledQual()) : ".", this.getType(), ParsingUtils.sortList(this.getAlleles()), ParsingUtils.sortedString(this.getAttributes()), String.join(",", commonInfo.getFilters())); }
public String toStringWithoutGenotypes() { return String.format("[VC %s @ %s Q%s of type=%s alleles=%s attr=%s", getSource(), contig + ":" + (start - stop == 0 ? start : start + "-" + stop), hasLog10PError() ? String.format("%.2f", getPhredScaledQual()) : ".", this.getType(), ParsingUtils.sortList(this.getAlleles()), ParsingUtils.sortedString(this.getAttributes())); }
public String toStringDecodeGenotypes() { return String.format("[VC %s @ %s Q%s of type=%s alleles=%s attr=%s GT=%s filters=%s", getSource(), contig + ":" + (start - stop == 0 ? start : start + "-" + stop), hasLog10PError() ? String.format("%.2f", getPhredScaledQual()) : ".", this.getType(), ParsingUtils.sortList(this.getAlleles()), ParsingUtils.sortedString(this.getAttributes()), this.getGenotypes(), String.join(",", commonInfo.getFilters())); }
private String toStringUnparsedGenotypes() { return String.format("[VC %s @ %s Q%s of type=%s alleles=%s attr=%s GT=%s filters=%s", getSource(), contig + ":" + (start - stop == 0 ? start : start + "-" + stop), hasLog10PError() ? String.format("%.2f", getPhredScaledQual()) : ".", this.getType(), ParsingUtils.sortList(this.getAlleles()), ParsingUtils.sortedString(this.getAttributes()), ((LazyGenotypesContext)this.genotypes).getUnparsedGenotypeData(), String.join(",", commonInfo.getFilters())); }
public String toStringDecodeGenotypes() { return String.format("[VC %s @ %s Q%s of type=%s alleles=%s attr=%s GT=%s filters=%s", getSource(), contig + ":" + (start - stop == 0 ? start : start + "-" + stop), hasLog10PError() ? String.format("%.2f", getPhredScaledQual()) : ".", this.getType(), ParsingUtils.sortList(this.getAlleles()), ParsingUtils.sortedString(this.getAttributes()), this.getGenotypes(), String.join(",", commonInfo.getFilters())); }
private String toStringUnparsedGenotypes() { return String.format("[VC %s @ %s Q%s of type=%s alleles=%s attr=%s GT=%s filters=%s", getSource(), contig + ":" + (start - stop == 0 ? start : start + "-" + stop), hasLog10PError() ? String.format("%.2f", getPhredScaledQual()) : ".", this.getType(), ParsingUtils.sortList(this.getAlleles()), ParsingUtils.sortedString(this.getAttributes()), ((LazyGenotypesContext)this.genotypes).getUnparsedGenotypeData(), String.join(",", commonInfo.getFilters())); }
private String toStringUnparsedGenotypes() { return String.format("[VC %s @ %s Q%s of type=%s alleles=%s attr=%s GT=%s", getSource(), contig + ":" + (start - stop == 0 ? start : start + "-" + stop), hasLog10PError() ? String.format("%.2f", getPhredScaledQual()) : ".", this.getType(), ParsingUtils.sortList(this.getAlleles()), ParsingUtils.sortedString(this.getAttributes()), ((LazyGenotypesContext)this.genotypes).getUnparsedGenotypeData()); }
public String toStringDecodeGenotypes() { return String.format("[VC %s @ %s Q%s of type=%s alleles=%s attr=%s GT=%s", getSource(), contig + ":" + (start - stop == 0 ? start : start + "-" + stop), hasLog10PError() ? String.format("%.2f", getPhredScaledQual()) : ".", this.getType(), ParsingUtils.sortList(this.getAlleles()), ParsingUtils.sortedString(this.getAttributes()), this.getGenotypes()); }
/** * Copy constructor * * @param other the VariantContext to copy */ protected VariantContext(VariantContext other) { this(other.getSource(), other.getID(), other.getContig(), other.getStart(), other.getEnd(), other.getAlleles(), other.getGenotypes(), other.getLog10PError(), other.getFiltersMaybeNull(), other.getAttributes(), other.fullyDecoded, NO_VALIDATION); }
/** * Copy constructor * * @param other the VariantContext to copy */ protected VariantContext(VariantContext other) { this(other.getSource(), other.getID(), other.getContig(), other.getStart(), other.getEnd(), other.getAlleles(), other.getGenotypes(), other.getLog10PError(), other.getFiltersMaybeNull(), other.getAttributes(), other.fullyDecoded, NO_VALIDATION); }
/** * Copy constructor * * @param other the VariantContext to copy */ protected VariantContext(VariantContext other) { this(other.getSource(), other.getID(), other.getChr(), other.getStart(), other.getEnd(), other.getAlleles(), other.getGenotypes(), other.getLog10PError(), other.getFiltersMaybeNull(), other.getAttributes(), other.fullyDecoded, NO_VALIDATION); }