Package htsjdk.variant.variantcontext
Class CommonInfo
- java.lang.Object
-
- htsjdk.variant.variantcontext.CommonInfo
-
- All Implemented Interfaces:
Serializable
public final class CommonInfo extends Object implements Serializable
Common utility routines for VariantContext and Genotype- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static double
NO_LOG10_PERROR
static long
serialVersionUID
-
Method Summary
-
-
-
Field Detail
-
serialVersionUID
public static final long serialVersionUID
- See Also:
- Constant Field Values
-
NO_LOG10_PERROR
public static final double NO_LOG10_PERROR
- See Also:
- Constant Field Values
-
-
Method Detail
-
getName
public String getName()
- Returns:
- the name
-
setName
public void setName(String name)
Sets the name- Parameters:
name
- the name associated with this information
-
filtersWereApplied
public boolean filtersWereApplied()
-
isFiltered
public boolean isFiltered()
-
isNotFiltered
public boolean isNotFiltered()
-
addFilter
public void addFilter(String filter)
-
addFilters
public void addFilters(Collection<String> filters)
-
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()
-
removeAttribute
public void removeAttribute(String key)
-
hasAttribute
public boolean hasAttribute(String key)
-
getNumAttributes
public int getNumAttributes()
-
getAttribute
public Object getAttribute(String key)
- Parameters:
key
- the attribute key- Returns:
- the attribute value for the given key (or null if not set)
-
getAttributeAsList
public List<Object> getAttributeAsList(String key)
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
public List<String> getAttributeAsStringList(String key, String defaultValue)
-
getAttributeAsDoubleList
public List<Double> getAttributeAsDoubleList(String key, Double defaultValue)
-
getAttributeAsInt
public int getAttributeAsInt(String key, int defaultValue)
-
getAttributeAsDouble
public double getAttributeAsDouble(String key, double defaultValue)
-
getAttributeAsBoolean
public boolean getAttributeAsBoolean(String key, boolean defaultValue)
-
-