Class VcfPosition

java.lang.Object
org.pharmgkb.parser.vcf.model.VcfPosition

public class VcfPosition extends Object
This class contains the basic data (the first 9 columns) for a VCF position line.
 0 - CHROM
 1 - POS
 2 - ID
 3 - REF
 4 - ALT
 5 - QUAL
 6 - FILTER
 7 - INFO
 8 - FORMAT
 
  • Constructor Details

  • Method Details

    • getChromosome

      @Nonnull public String getChromosome()
      Gets an identifier from the reference genome or an angle-bracketed ID String ("<ID>") pointing to a contig in the assembly file.
    • setChromosome

      public void setChromosome(@Nonnull String chromosome)
    • setRef

      public void setRef(@Nonnull String ref)
    • getPosition

      public long getPosition()
    • setPosition

      public void setPosition(long position)
    • getIds

      @Nonnull public List<String> getIds()
      Gets the list of unique identifiers for this position.
    • getRef

      @Nonnull public String getRef()
      Gets the reference base(s) for this position. Each base must be an A, C, G, T, or N.
    • getAltBases

      @Nonnull public List<String> getAltBases()
      Gets the alternate base(s) for this position. Each base must be an A, C, G, T, N or * unless it's an angle-bracketed ID string ("<ID>").

      ID strings should reference a specific ALT metadata (obtainable via VcfMetadata.getAlt(java.lang.String)).

    • getAllele

      @Nonnull public String getAllele(int index)
      Gets the allele at the given index from a list of containing refBases + altBases.
      Throws:
      IndexOutOfBoundsException - if index is out of range
    • getQuality

      @Nullable public BigDecimal getQuality()
    • setQuality

      public void setQuality(@Nullable BigDecimal quality)
    • isPassingAllFilters

      public boolean isPassingAllFilters()
    • getFilters

      @Nonnull public List<String> getFilters()
      Returns a list of filters this position failed, if any.
    • getInfo

      @Nonnull public com.google.common.collect.ListMultimap<String,String> getInfo()
      Gets all INFO fields for every key.
    • getInfo

      @Nullable public List<String> getInfo(@Nonnull String id)
      Get INFO metadata with the specified ID.
      Returns:
      list of values or null if there is no INFO metadata for the specified id
    • getInfo

      @Nullable public <T> T getInfo(@Nonnull ReservedInfoProperty key)
      Returns the value for the reserved property as the type specified by both ReservedInfoProperty.getType() and ReservedInfoProperty.isList().

      Note that this method does NOT always return a list.

      For example:

      
         BigDecimal bq = vcfPosition.getInfoConverted(ReservedInfoProperty.BaseQuality);
       
       
      Type Parameters:
      T - The type specified by ReservedInfoProperty.getType() if ReservedInfoProperty.isList() is false; otherwise List<V> where V is the type specified by ReservedInfoProperty.getType().
    • hasInfo

      public boolean hasInfo(@Nonnull String id)
      Checks if there is INFO metadata with the specified ID.
    • hasInfo

      public boolean hasInfo(@Nonnull ReservedInfoProperty key)
      Checks if there is INFO metadata with the specified ID.
    • getFormat

      @Nonnull public List<String> getFormat()
    • getInfoKeys

      @Nonnull public Set<String> getInfoKeys()