Package htsjdk.variant.variantcontext
Class CommonInfo
java.lang.Object
htsjdk.variant.variantcontext.CommonInfo
- All Implemented Interfaces:
Serializable
Common utility routines for VariantContext and Genotype
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final doublestatic final long -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidaddFilters(Collection<String> filters) voidbooleangetAttribute(String key) getAttribute(String key, Object defaultValue) booleangetAttributeAsBoolean(String key, boolean defaultValue) doublegetAttributeAsDouble(String key, double defaultValue) getAttributeAsDoubleList(String key, Double defaultValue) intgetAttributeAsInt(String key, int defaultValue) getAttributeAsIntList(String key, Integer defaultValue) getAttributeAsList(String key) Gets the attributes from a key as a list.getAttributeAsString(String key, String defaultValue) getAttributeAsStringList(String key, String defaultValue) doublegetName()intdoubleFloating-point arithmetic allows signed zeros such as +0.0 and -0.0.booleanhasAttribute(String key) booleanbooleanbooleanvoidputAttribute(String key, Object value) voidputAttribute(String key, Object value, boolean allowOverwrites) voidputAttributes(Map<String, ?> map) voidremoveAttribute(String key) voidsetAttributes(Map<String, ?> map) voidsetLog10PError(double log10PError) voidSets the name
-
Field Details
-
serialVersionUID
public static final long serialVersionUID- See Also:
-
NO_LOG10_PERROR
public static final double NO_LOG10_PERROR- See Also:
-
-
Constructor Details
-
CommonInfo
-
-
Method Details
-
getName
- Returns:
- the name
-
setName
Sets the name- Parameters:
name- the name associated with this information
-
getFiltersMaybeNull
-
getFilters
-
filtersWereApplied
public boolean filtersWereApplied() -
isFiltered
public boolean isFiltered() -
isNotFiltered
public boolean isNotFiltered() -
addFilter
-
addFilters
-
hasLog10PError
public boolean hasLog10PError() -
getLog10PError
public double getLog10PError()- Returns:
- the -1 * log10-based error estimate
-
getPhredScaledQual
public double getPhredScaledQual()Floating-point arithmetic allows signed zeros such as +0.0 and -0.0. Adding the constant 0.0 to the result ensures that the returned value is never -0.0 since (-0.0) + 0.0 = 0.0. When this is set to '0.0', the resulting VCF would be 0 instead of -0.- Returns:
- double - Phred scaled quality score
-
setLog10PError
public void setLog10PError(double log10PError) -
clearAttributes
public void clearAttributes() -
getAttributes
- Returns:
- the attribute map
-
setAttributes
-
putAttribute
-
putAttribute
-
removeAttribute
-
putAttributes
-
hasAttribute
-
getNumAttributes
public int getNumAttributes() -
getAttribute
- Parameters:
key- the attribute key- Returns:
- the attribute value for the given key (or null if not set)
-
getAttribute
-
getAttributeAsList
Gets the attributes from a key as a list. Note: int[] and double[] arrays are boxed.- Returns:
- empty list if the key was not found;
Collections.singletonList(Object)if there is only one value; a list containing the values if the value is aListor array.
-
getAttributeAsStringList
-
getAttributeAsIntList
-
getAttributeAsDoubleList
-
getAttributeAsString
-
getAttributeAsInt
-
getAttributeAsDouble
-
getAttributeAsBoolean
-