package api
- Alphabetic
- Public
- All
Type Members
-
sealed
trait
Allele extends AnyRef
Represents an allele in a VCF or Variant.
-
case class
AlleleSet(ref: SimpleAllele, alts: IndexedSeq[Allele]) extends Iterable[Allele] with Product with Serializable
Simple class to encapsulate a set of alleles where one allele represents the allele that is present in the reference genome, and the remainder represent alternative alleles.
Simple class to encapsulate a set of alleles where one allele represents the allele that is present in the reference genome, and the remainder represent alternative alleles.
- ref
the reference allele
- alts
the ordered list of alternate alleles
-
class
ArrayAttr[A] extends IndexedSeq[A]
Class that is used to store multi-valued attributes from a VCF (e.g.
Class that is used to store multi-valued attributes from a VCF (e.g.
AD=10,20
) and correctly handle missing values.It is possible for one or all values in the collection to be missing. If accessed directly, e.g. by index or by iteration, missing values will return one of the following based on the type of the attribute:
- Variant.Missing for Strings
- Variant.MissingInt for Ints
- Variant.MissingFloat for Floating point numbers
If you need to deal with the possibility of missing values it is strongly recommended that you use the isMissing() and/or isDefined() methods or use the get() which returns an option type.
- A
the type of values stored in the collection
-
final
case class
Genotype(alleles: AlleleSet, sample: String, calls: IndexedSeq[Allele], phased: Boolean = false, attrs: Map[String, Any] = Variant.EmptyGtAttrs) extends Product with Serializable
A genotype for a variant.
A genotype for a variant.
- alleles
the set of alleles for the variant
- sample
the name of the sample for which this is a genotype
- calls
the called alleles for the sample
- phased
whether or not the calls are phased
-
final
case class
Variant(chrom: String, pos: Int, id: Option[String] = None, alleles: AlleleSet, qual: Option[Double] = None, filters: Set[String] = Variant.EmptyFilters, attrs: ListMap[String, Any] = Variant.EmptyInfo, genotypes: Map[String, Genotype] = Variant.EmptyGenotypes) extends Product with Serializable
Represents a variant from a VCF or similar source.
Represents a variant from a VCF or similar source.
Attributes from the INFO field are available via the apply(), get(), and getOrElse() methods. Attribute that are defined but missing in the VCF (e.g. DP=.) are not stored. All multi-valued attributes are stored as instances of ArrayAttr which is a custom subclass of IndexedSeq which provides methods to help in dealing with missing values in cases where a subset of values are missing (e.g. AD=10,.,20).
- chrom
the chromosome on which a variant resides.
- pos
the start position of the variant
- id
the optional ID (e.g. rs number) of the variant
- alleles
the set of alleles recorded for the variant
- qual
the optional phred-scaled quality score of the variant
- filters
the set of filters applied to the variant. An empty set indicates the variant has not had filtration applied. A single value of "PASS" is applied if the variant passes filters, and one or more non-PASS strings if the variant fails filters.
- attrs
a map of attributes that come from the INFO field of a VCF
- genotypes
a map of sample name -> genotype for the variant
-
case class
VcfContigHeader(index: Int, name: String, length: Option[Int] = None, assembly: Option[String] = None) extends VcfHeaderEntry with Product with Serializable
A contig line/entry in the VCF header.
A contig line/entry in the VCF header.
- index
the index of the contig in the list of contigs
- name
the name of the contig
- length
the length of the contig in bases, optional
- assembly
the optional name of the assembly from which the contig is drawn
-
sealed
trait
VcfCount extends AnyRef
Trait used to represent how many instances of an attribute are to be expected in a VCFs INFO or genotype fields.
-
sealed
trait
VcfFieldType extends EnumEntry
Trait for the set of acceptable atomic types that can appear in VCF's INFO and genotype fields.
-
case class
VcfFilterHeader(id: String, description: String) extends VcfHeaderEntry with Product with Serializable
An entry describing a filter used in either the FILTER field or samples' FT field.
An entry describing a filter used in either the FILTER field or samples' FT field.
- id
the name of the filter as it will appear in the FILTER or FT fields
- description
a human readable description of the filter
-
case class
VcfFormatHeader(id: String, count: VcfCount, kind: VcfFieldType, description: String) extends VcfHeaderEntry with Product with Serializable
An entry in the VCF header describing a FORMAT field whose values appear in each genotype.
An entry in the VCF header describing a FORMAT field whose values appear in each genotype.
- id
the ID of the fields (i.e. the string that appears in the FORMAT field)
- count
the expected count of values per sample
- kind
the atomic type of each value
- description
a human readable description of the field
-
case class
VcfGeneralHeader(headerType: String, id: String, data: Map[String, String] = Map.empty) extends VcfHeaderEntry with Product with Serializable
Catch all for header line types we don't care enough to have specific implementations of.
-
case class
VcfHeader(contigs: IndexedSeq[VcfContigHeader], infos: Seq[VcfInfoHeader], formats: Seq[VcfFormatHeader], filters: Seq[VcfFilterHeader], others: Seq[VcfGeneralHeader], samples: IndexedSeq[String]) extends Product with Serializable
The header of a VCF file.
The header of a VCF file.
- contigs
the ordered list of contig entries in the VCF header (may be empty)
- infos
the list of INFO entries in the header
- formats
the list of FORMAT entries in the header
- filters
the list of FILTER entries in the header
- others
the list of all other header entries
- samples
the ordered list of samples that appear in the VCF
-
sealed
trait
VcfHeaderEntry extends AnyRef
Trait representing an entry/line in a VCF header.
-
case class
VcfInfoHeader(id: String, count: VcfCount, kind: VcfFieldType, description: String, source: Option[String] = None, version: Option[String] = None) extends VcfHeaderEntry with Product with Serializable
An entry in the VCF header describing an INFO field.
An entry in the VCF header describing an INFO field.
- id
the ID of the INFO field, i.e. the value that precedes the
=
in the INFO field- count
the expected count of values for the field
- kind
the atomic type of values for the field
- description
a description of the field, intended for people not for parsing
- source
an optional source describing where the field came from
- version
an optional version for the INFO field
-
class
VcfSource extends FgBioDef.View[Variant] with Closeable
Provides a reader over a source of VCF-like data that could be a VCF file or a BCF file.
Provides a reader over a source of VCF-like data that could be a VCF file or a BCF file. Has facilities for iterating over the entire stream of variants as well as querying by genomic location if an index is present.
-
class
VcfWriter extends commons.io.Writer[Variant]
Writes Variants to a file or other storage mechanism.
Value Members
- object Allele
- object AlleleSet extends Serializable
- object ArrayAttr
- object Variant extends Serializable
- object VcfCount
- object VcfFieldType extends FgBioEnum[VcfFieldType]
- object VcfSource
- object VcfWriter