Class VcfUtils

java.lang.Object
org.pharmgkb.parser.vcf.VcfUtils

public class VcfUtils extends Object
Contains static methods for handling properties in INFO and FORMAT fields.
  • Field Details

    • ALT_BASE_PATTERN

      public static final Pattern ALT_BASE_PATTERN
    • REF_BASE_PATTERN

      public static final Pattern REF_BASE_PATTERN
    • METADATA_PATTERN

      public static final Pattern METADATA_PATTERN
    • FORMAT_PATTERN

      public static final Pattern FORMAT_PATTERN
    • RSID_PATTERN

      public static final Pattern RSID_PATTERN
    • NUMBER_PATTERN

      public static final Pattern NUMBER_PATTERN
    • FILE_FORMAT_PATTERN

      public static final Pattern FILE_FORMAT_PATTERN
    • UNQUOTED_EQUAL_SIGN_PATTERN

      public static final Pattern UNQUOTED_EQUAL_SIGN_PATTERN
  • Constructor Details

    • VcfUtils

      public VcfUtils()
  • Method Details

    • extractPropertiesFromLine

      @Nonnull public static Map<String,String> extractPropertiesFromLine(@Nonnull String value)
    • extractProperties

      @Nonnull public static Map<String,String> extractProperties(@Nonnull String... props)
    • splitProperty

      @Nonnull public static org.apache.commons.lang3.tuple.Pair<String,String> splitProperty(@Nonnull String prop)
      Splits a property into a key-value pair.
      Parameters:
      prop - In the form "key=value"
    • quote

      @Nonnull public static String quote(@Nonnull String string)
      Adds double quotation marks around a string.
    • unquote

      @Nonnull public static String unquote(@Nonnull String string)
      Removes double quotation marks around a string if they are present.
    • convertProperty

      @Nullable public static <T> T convertProperty(@Nonnull ReservedProperty key, @Nullable String value)
      Converts a String representation of a property into a more useful type. Specifically, can return:
      • String
      • Long
      • BigDecimal
      • The Boolean true (for flags)
      • A List of any of the above types
    • convertProperty

      @Nullable public static <T> T convertProperty(@Nonnull Class<?> clas, @Nullable String value, boolean isList)
      See Also:
    • convertProperty

      @Nullable public static <T> T convertProperty(@Nonnull FormatType type, @Nullable String value)
    • convertProperty

      @Nullable public static <T> T convertProperty(@Nonnull InfoType type, @Nullable String value)