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 double
static final long
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
addFilters
(Collection<String> filters) void
boolean
getAttribute
(String key) getAttribute
(String key, Object defaultValue) boolean
getAttributeAsBoolean
(String key, boolean defaultValue) double
getAttributeAsDouble
(String key, double defaultValue) getAttributeAsDoubleList
(String key, Double defaultValue) int
getAttributeAsInt
(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) double
getName()
int
double
Floating-point arithmetic allows signed zeros such as +0.0 and -0.0.boolean
hasAttribute
(String key) boolean
boolean
boolean
void
putAttribute
(String key, Object value) void
putAttribute
(String key, Object value, boolean allowOverwrites) void
putAttributes
(Map<String, ?> map) void
removeAttribute
(String key) void
setAttributes
(Map<String, ?> map) void
setLog10PError
(double log10PError) void
Sets 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 aList
or array.
-
getAttributeAsStringList
-
getAttributeAsIntList
-
getAttributeAsDoubleList
-
getAttributeAsString
-
getAttributeAsInt
-
getAttributeAsDouble
-
getAttributeAsBoolean
-