Package org.pharmgkb.parser.vcf.model
Class VcfPosition
java.lang.Object
org.pharmgkb.parser.vcf.model.VcfPosition
This class contains the basic data (the first 9 columns) for a VCF position line.
0 - CHROM 1 - POS 2 - ID 3 - REF 4 - ALT 5 - QUAL 6 - FILTER 7 - INFO 8 - FORMAT
-
Constructor Summary
ConstructorsConstructorDescriptionVcfPosition(String chromosome, long position, String refBases, BigDecimal quality) VcfPosition(String chr, long pos, List<String> ids, String ref, List<String> altBases, BigDecimal qual, List<String> filter, com.google.common.collect.ListMultimap<String, String> info, List<String> format) -
Method Summary
Modifier and TypeMethodDescriptiongetAllele(int index) Gets the allele at the given index from a list of containing refBases + altBases.Gets the alternate base(s) for this position.Gets an identifier from the reference genome or an angle-bracketed ID String ("<ID>") pointing to a contig in the assembly file.Returns a list of filters this position failed, if any.getIds()Gets the list of unique identifiers for this position.getInfo()Gets all INFO fields for every key.Get INFO metadata with the specified ID.<T> TReturns the value for the reserved property as the type specified by bothReservedInfoProperty.getType()andReservedInfoProperty.isList().longgetRef()Gets the reference base(s) for this position.booleanChecks if there is INFO metadata with the specified ID.booleanChecks if there is INFO metadata with the specified ID.booleanvoidsetChromosome(String chromosome) voidsetPosition(long position) voidsetQuality(BigDecimal quality) void
-
Constructor Details
-
VcfPosition
-
VcfPosition
public VcfPosition(@Nonnull String chromosome, long position, @Nonnull String refBases, @Nonnull BigDecimal quality)
-
-
Method Details
-
getChromosome
Gets an identifier from the reference genome or an angle-bracketed ID String ("<ID>") pointing to a contig in the assembly file. -
setChromosome
-
setRef
-
getPosition
public long getPosition() -
setPosition
public void setPosition(long position) -
getIds
Gets the list of unique identifiers for this position. -
getRef
Gets the reference base(s) for this position. Each base must be an A, C, G, T, or N. -
getAltBases
Gets the alternate base(s) for this position. Each base must be an A, C, G, T, N or * unless it's an angle-bracketed ID string ("<ID>").ID strings should reference a specific ALT metadata (obtainable via
VcfMetadata.getAlt(java.lang.String)). -
getAllele
Gets the allele at the given index from a list of containing refBases + altBases.- Throws:
IndexOutOfBoundsException- if index is out of range
-
getQuality
-
setQuality
-
isPassingAllFilters
public boolean isPassingAllFilters() -
getFilters
Returns a list of filters this position failed, if any. -
getInfo
Gets all INFO fields for every key. -
getInfo
Get INFO metadata with the specified ID.- Returns:
- list of values or null if there is no INFO metadata for the specified id
-
getInfo
Returns the value for the reserved property as the type specified by bothReservedInfoProperty.getType()andReservedInfoProperty.isList().Note that this method does NOT always return a list.
For example:
BigDecimal bq = vcfPosition.getInfoConverted(ReservedInfoProperty.BaseQuality);- Type Parameters:
T- The type specified byReservedInfoProperty.getType()ifReservedInfoProperty.isList()is false; otherwiseList<V>where V is the type specified byReservedInfoProperty.getType().
-
hasInfo
Checks if there is INFO metadata with the specified ID. -
hasInfo
Checks if there is INFO metadata with the specified ID. -
getFormat
-
getInfoKeys
-