/** * Get the priority list (just the list of sources for these variant context) used to merge overlapping events into common reference view * @param vcs a list of variant contexts * @return the list of the sources of vcs in the same order */ protected List<String> makePriorityList(final List<VariantContext> vcs) { final List<String> priorityList = new LinkedList<>(); for ( final VariantContext vc : vcs ) priorityList.add(vc.getSource()); return priorityList; }
/** * Throws a meaningful error message when a field (INFO or FORMAT) is found when writing out a file * but there's no header line for it. * * @param vc * @param field * @param fieldType */ private void errorUnexpectedFieldToWrite(final VariantContext vc, final String field, final String fieldType) { throw new IllegalStateException("Found field " + field + " in the " + fieldType + " fields of VariantContext at " + vc.getContig() + ":" + vc.getStart() + " from " + vc.getSource() + " but this hasn't been defined in the VCFHeader"); }
private static void handleMissingData(final boolean allowMissingData, final String field, final List<List<String>> records, final VariantContext vc) { if (allowMissingData) { addFieldValue(MISSING_DATA, records); } else { throw new UserException(String.format("Missing field %s in vc %s at %s", field, vc.getSource(), vc)); } }
/** * Throws a meaningful error message when a field (INFO or FORMAT) is found when writing out a file * but there's no header line for it. * * @param vc * @param field * @param fieldType */ private void errorUnexpectedFieldToWrite(final VariantContext vc, final String field, final String fieldType) { throw new IllegalStateException("Found field " + field + " in the " + fieldType + " fields of VariantContext at " + vc.getChr() + ":" + vc.getStart() + " from " + vc.getSource() + " but this hasn't been defined in the VCFHeader"); }
/** * Throws a meaningful error message when a field (INFO or FORMAT) is found when writing out a file * but there's no header line for it. * * @param vc * @param field * @param fieldType */ private void errorUnexpectedFieldToWrite(final VariantContext vc, final String field, final String fieldType) { throw new IllegalStateException("Found field " + field + " in the " + fieldType + " fields of VariantContext at " + vc.getContig() + ":" + vc.getStart() + " from " + vc.getSource() + " but this hasn't been defined in the VCFHeader"); }
private static final List<String> vcs2priority(final Collection<VariantContext> vcs) { final List<String> priority = new ArrayList<>(); for ( final VariantContext vc : vcs ) { priority.add(vc.getSource()); } return priority; }
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())); }
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())); }
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", 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()); }
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()); }
@Override public Integer map(final RefMetaDataTracker tracker, final ReferenceContext ref, final AlignmentContext context) { if (tracker == null) return 0; final Collection<VariantContext> vcs = tracker.getValues(variantCollection.variants, context.getLocation()); for (VariantContext vc : vcs) { if (fullyDecode) vc = vc.fullyDecode(vcfRods.get(vc.getSource()), getToolkit().lenientVCFProcessing()); vcfWriter.add(vc); } return vcs.isEmpty() ? 0 : 1; }
/** * 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); }