Package org.pharmgkb.parser.vcf
Class VcfUtils
java.lang.Object
org.pharmgkb.parser.vcf.VcfUtils
Contains static methods for handling properties in INFO and FORMAT fields.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> TconvertProperty(Class<?> clas, String value, boolean isList) static <T> TconvertProperty(FormatType type, String value) static <T> TconvertProperty(InfoType type, String value) static <T> TconvertProperty(ReservedProperty key, String value) Converts a String representation of a property into a more useful type.extractProperties(String... props) extractPropertiesFromLine(String value) static StringAdds double quotation marks around a string.splitProperty(String prop) Splits a property into a key-value pair.static StringRemoves double quotation marks around a string if they are present.
-
Field Details
-
ALT_BASE_PATTERN
-
REF_BASE_PATTERN
-
METADATA_PATTERN
-
FORMAT_PATTERN
-
RSID_PATTERN
-
NUMBER_PATTERN
-
FILE_FORMAT_PATTERN
-
UNQUOTED_EQUAL_SIGN_PATTERN
-
-
Constructor Details
-
VcfUtils
public VcfUtils()
-
-
Method Details
-
extractPropertiesFromLine
-
extractProperties
-
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
Adds double quotation marks around a string. -
unquote
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
-
convertProperty
-
convertProperty
-