java.lang.Object
java.util.AbstractMap<K,V>
java.util.TreeMap<Integer,htsjdk.variant.variantcontext.VariantContext>
org.broadinstitute.hellbender.utils.haplotype.EventMap
All Implemented Interfaces:
Serializable, Cloneable, Map<Integer,htsjdk.variant.variantcontext.VariantContext>, NavigableMap<Integer,htsjdk.variant.variantcontext.VariantContext>, SortedMap<Integer,htsjdk.variant.variantcontext.VariantContext>

public final class EventMap extends TreeMap<Integer,htsjdk.variant.variantcontext.VariantContext>
Extract simple VariantContext events from a single haplotype
See Also:
  • Field Details

    • MIN_NUMBER_OF_EVENTS_TO_COMBINE_INTO_BLOCK_SUBSTITUTION

      protected static final int MIN_NUMBER_OF_EVENTS_TO_COMBINE_INTO_BLOCK_SUBSTITUTION
      See Also:
    • SYMBOLIC_UNASSEMBLED_EVENT_ALLELE

      public static final htsjdk.variant.variantcontext.Allele SYMBOLIC_UNASSEMBLED_EVENT_ALLELE
  • Constructor Details

    • EventMap

      public EventMap(Haplotype haplotype, byte[] ref, htsjdk.samtools.util.Locatable refLoc, String sourceNameToAdd, int maxMnpDistance)
    • EventMap

      public EventMap(Collection<htsjdk.variant.variantcontext.VariantContext> stateForTesting)
      For testing. Let's you set up a explicit configuration without having to process a haplotype and reference
      Parameters:
      stateForTesting -
  • Method Details

    • processCigarForInitialEvents

      protected void processCigarForInitialEvents(int maxMnpDistance)
      Parameters:
      maxMnpDistance - Phased substitutions separated by this distance or less are merged into MNPs. More than two substitutions occurring in the same alignment block (ie the same M/X/EQ CIGAR element) are merged until a substitution is separated from the previous one by a greater distance. That is, if maxMnpDistance = 1, substitutions at 10,11,12,14,15,17 are partitioned into a MNP at 10-12, a MNP at 14-15, and a SNP at 17. May not be negative.
    • addVC

      public void addVC(htsjdk.variant.variantcontext.VariantContext vc)
      Add VariantContext vc to this map, merging events with the same start sites if necessary
      Parameters:
      vc - the variant context to add
    • addVC

      public void addVC(htsjdk.variant.variantcontext.VariantContext vc, boolean merge)
      Add VariantContext vc to this map
      Parameters:
      vc - the variant context to add
      merge - should we attempt to merge it with an already existing element, or should we throw an error in that case?
    • makeBlock

      protected htsjdk.variant.variantcontext.VariantContext makeBlock(htsjdk.variant.variantcontext.VariantContext vc1, htsjdk.variant.variantcontext.VariantContext vc2)
      Create a block substitution out of two variant contexts that start at the same position vc1 can be SNP, and vc2 can then be either a insertion or deletion. If vc1 is an indel, then vc2 must be the opposite type (vc1 deletion => vc2 must be an insertion)
      Parameters:
      vc1 - the first variant context we want to merge
      vc2 - the second
      Returns:
      a block substitution that represents the composite substitution implied by vc1 and vc2
    • getStartPositions

      public Set<Integer> getStartPositions()
      Get the starting positions of events in this event map
      Returns:
    • getVariantContexts

      public Collection<htsjdk.variant.variantcontext.VariantContext> getVariantContexts()
      Get the variant contexts in order of start position in this event map
      Returns:
    • getNumberOfEvents

      public int getNumberOfEvents()
      How many events do we have?
      Returns:
    • toString

      public String toString()
      Overrides:
      toString in class AbstractMap<Integer,htsjdk.variant.variantcontext.VariantContext>
    • buildEventMapsForHaplotypes

      public static TreeSet<Integer> buildEventMapsForHaplotypes(List<Haplotype> haplotypes, byte[] ref, htsjdk.samtools.util.Locatable refLoc, boolean debug, int maxMnpDistance)
      Build event maps for each haplotype, returning the sorted set of all of the starting positions of all events across all haplotypes
      Parameters:
      haplotypes - a list of haplotypes
      ref - the reference bases
      refLoc - the span of the reference bases
      debug - if true, we'll emit debugging information during this operation
      maxMnpDistance - Phased substitutions separated by this distance or less are merged into MNPs. More than two substitutions occuring in the same alignment block (ie the same M/X/EQ CIGAR element) are merged until a substitution is separated from the previous one by a greater distance. That is, if maxMnpDistance = 1, substitutions at 10,11,12,14,15,17 are partitioned into a MNP at 10-12, a MNP at 14-15, and a SNP at 17. May not be negative.
      Returns:
      a sorted set of start positions of all events among all haplotypes
    • getOverlappingEvents

      public List<htsjdk.variant.variantcontext.VariantContext> getOverlappingEvents(int loc)
      Returns any events in the map that overlap loc, including spanning deletions and events that start at loc.