Package org.pharmgkb.parser.vcf.model
Class VcfMetadata
java.lang.Object
org.pharmgkb.parser.vcf.model.VcfMetadata
This class captures all the VCF metadata from a VCF file.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAlt(IdDescriptionMetadata value) Addsvalueto the map of ALT metadata, using itsIDas the key.voidaddAssembly(String value) Addsvalueto the list of assembly metadata.voidaddContig(ContigMetadata value) Addsvalueto the map of CONTIG metadata, using itsIDas the key.voidaddFilter(IdDescriptionMetadata value) Addsvalueto the map of FILTER metadata, using itsIDas the key.voidaddFormat(FormatMetadata value) Addsvalueto the map of FORMAT metadata, using itsIDas the key.voidaddInfo(InfoMetadata value) Addsvalueto the map of INFO metadata, using itsIDas the key.voidaddPedigreeDatabase(String value) Addsvalueto the list of pedigreeDB.Gets the ALT metadata for the given ID.getAlts()intgetColumnIndex(String column) getInfo()intGets the number of columns in the VCF file.intGets the number of samples in the VCF file.Returns a map from every property key to each of its values.Returns a list of the properties defined.getRawValuesOfProperty(String propertyKey) Returns the value of a property, or null if the property is not set or has no value.intgetSampleIndex(String sampleId) Sample numbering starts at 0.getSampleName(int idx) Gets the sample name (column name).voidremoveAlt(IdDescriptionMetadata value) voidremoveAssembly(String value) voidremoveContig(ContigMetadata value) voidvoidremoveFormat(FormatMetadata value) voidremoveInfo(InfoMetadata value) voidremovePedigreeDb(String value) Addsvalueto the list of pedigreeDB.voidsetFileFormat(String fileFormat)
-
Method Details
-
getFileFormat
-
setFileFormat
-
getAlts
-
getAlt
Gets the ALT metadata for the given ID.- Parameters:
id- the ID to lookup, will unwrap ID's enclosed in angle brackets (e.g. <CN1> will get converted to CN1)
-
getInfo
-
getFilters
-
getFormats
-
getContigs
-
getPedigrees
-
getSamples
-
getAssemblies
- Returns:
- The URLs from the field(s) in the assembly metadata line(s)
-
getPedigreeDatabases
- Returns:
- The URLs from the field(s) in the pedigreeDB metadata line(s), including angle brackets if any
-
addAlt
Addsvalueto the map of ALT metadata, using itsIDas the key. -
addInfo
Addsvalueto the map of INFO metadata, using itsIDas the key. -
addFormat
Addsvalueto the map of FORMAT metadata, using itsIDas the key. -
addContig
Addsvalueto the map of CONTIG metadata, using itsIDas the key. -
addFilter
Addsvalueto the map of FILTER metadata, using itsIDas the key. -
addAssembly
Addsvalueto the list of assembly metadata.- Parameters:
value- Should not be wrapped in angle brackets
-
addPedigreeDatabase
Addsvalueto the list of pedigreeDB.- Parameters:
value- Must be wrapped in angle brackets- Throws:
VcfFormatException- Ifvalueis not wrapped in angle brackets
-
removeAlt
-
removeInfo
-
removeFormat
-
removeContig
-
removeFilter
-
removeAssembly
-
removePedigreeDb
Addsvalueto the list of pedigreeDB.- Parameters:
value- Must be wrapped in angle brackets- Throws:
VcfFormatException- Ifvalueis not wrapped in angle brackets
-
getRawProperties
Returns a map from every property key to each of its values. CallListMultimap.asMap()to get a Map<String, Collection<String>>.- Returns:
- Contains every property except those contained in:
However, contains any in
getAssemblies()andgetPedigreeDatabases().
-
getRawValuesOfProperty
Returns the value of a property, or null if the property is not set or has no value. This method will return null for a reserved property of the form XX=<ID=value,ID=value,...>;assemblyandpedigreeDBare still included. -
getRawPropertyKeys
Returns a list of the properties defined. Reserved properties of the form XX=<ID=value,ID=value,...> are excluded, thoughassemblyandpedigreeDBare still included.- Returns:
- Contains every property except those contained in:
However, contains any in
getAssemblies()andgetPedigreeDatabases().
-
getColumnIndex
-
getSampleIndex
Sample numbering starts at 0. -
getNumSamples
public int getNumSamples()Gets the number of samples in the VCF file. -
getNumColumns
public int getNumColumns()Gets the number of columns in the VCF file. -
getSampleName
Gets the sample name (column name).- Parameters:
idx- sample index, first sample is at index 0- Throws:
ArrayIndexOutOfBoundsException- If the sample doesn't exist
-