Class AltStructuralVariant

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

public class AltStructuralVariant extends Object
A strictly validated VCF metadata ALT code of the form: ##ALT=<ID=type,Description=description> Where ID is a colon-delimited list of identifiers. Some of these identifiers are reserved, as coded in the ReservedStructuralVariantCode class. The first identifier (at level 0) is required to be reserved. As explicitly stated in the spec, these codes are case-sensitive.

Example:


   AltStructuralVariant alt = new AltStructuralVariant("INS:ME:LINE");
   alt.getReservedComponent(0); // ReservedStructuralVariantCode.Insertion
   alt.getReservedComponent(1); // ReservedStructuralVariantCode.MobileElement
   alt.getReservedComponent(2); // null, because it's not a reserved code
   alt.getComponent(); // "LINE"
 
 
  • Constructor Details

    • AltStructuralVariant

      public AltStructuralVariant(@Nonnull String string)
      Parameters:
      string - The full code (e.g. INS:ME:LINE:type-a1)
  • Method Details

    • getComponents

      @Nonnull public List<String> getComponents()
      Returns:
      The list of codes in order from level 0 to level n; for example ("INS", "ME", "LINE")
    • getComponent

      @Nonnull public String getComponent(int level)
      Returns:
      The code at the specified level (e.g. CNV)
      Throws:
      ArrayIndexOutOfBoundsException
    • getReservedComponent

      @Nullable public ReservedStructuralVariantCode getReservedComponent(int level)
      Returns:
      The code at the specified level (e.g. CNV), or null if it is not a reserved code
      Throws:
      ArrayIndexOutOfBoundsException
    • toString

      @Nonnull public String toString()
      Overrides:
      toString in class Object
      Returns:
      The original string (e.g. INS:ME:LINE:type-a1)