VcfVariant
in package
POS is 1-based, VCF's own convention (unlike BED) ; 0 and length + 1 are valid too and mark a telomere (VCF 4.3, POS column), typically on a breakend record. getReference()/getAlternates() are kept as raw strings, deliberately not wrapped in a DnaSequence : VCF's ALT column can legitimately hold a symbolic allele ("<DEL>", "<INS>") or breakend notation ("]13:123456]T") for a structural variant, neither of which is a valid DNA alphabet string, so forcing that validation here would wrongly reject real VCF input. Each ALT allele is checked against those forms ; REF, on the other hand, only ever holds bases, and is checked as such.
Class VcfVariant
Tags
Table of Contents
Properties
- $alternates : array<string|int, string>
- $chrom : string
- $filter : string|null
- $id : string|null
- $info : array<string, string|bool>
- $position : int
- $quality : float|null
- $reference : string
Methods
- __construct() : mixed
- VcfVariant constructor.
- getAlternates() : array<string|int, string>
- getChrom() : string
- getFilter() : string|null
- getId() : string|null
- getInfo() : array<string, string|bool>
- getPosition() : int
- getQuality() : float|null
- getReference() : string
- isPass() : bool
- isValidAlternate() : bool
- Tells whether a string is an ALT allele as VCF 4.3 writes one (section 1.6.1, ALT) : bases (the IUPAC codes tolerated as for REF), "*" for an allele missing because of an overlapping deletion, a symbolic allele in angle brackets (<DEL>, <INS:ME:ALU>, <*>, <NON_REF>), a breakend joining this position to a mate (G]17:198982], ]13:123456]T, C[<ctg1>:7[, .[13:123457[ at a telomere) or a single breakend (.A, G.). An empty allele, which an empty ALT column used to give, is none.
Properties
$alternates
private
array<string|int, string>
$alternates
Empty when ALT is "." (no alternate allele)
$chrom
private
string
$chrom
$filter
private
string|null
$filter
= null
$id
private
string|null
$id
= null
$info
private
array<string, string|bool>
$info
A flag-only INFO key (no "=value") maps to true
$position
private
int
$position
1-based ; 0 or length + 1 for a telomere
$quality
private
float|null
$quality
= null
$reference
private
string
$reference
Methods
__construct()
VcfVariant constructor.
public
__construct(string $sChrom, int $iPosition, string|null $sId, string $sReference, array<string|int, string> $aAlternates, float|null $fQuality, string|null $sFilter[, array<string|int, mixed> $aInfo = [] ]) : mixed
Parameters
- $sChrom : string
- $iPosition : int
-
1-based, 0 for a telomere
- $sId : string|null
- $sReference : string
- $aAlternates : array<string|int, string>
- $fQuality : float|null
- $sFilter : string|null
- $aInfo : array<string|int, mixed> = []
Tags
getAlternates()
public
getAlternates() : array<string|int, string>
Return values
array<string|int, string>getChrom()
public
getChrom() : string
Return values
stringgetFilter()
public
getFilter() : string|null
Return values
string|nullgetId()
public
getId() : string|null
Return values
string|nullgetInfo()
public
getInfo() : array<string, string|bool>
Return values
array<string, string|bool>getPosition()
public
getPosition() : int
Return values
intgetQuality()
public
getQuality() : float|null
Return values
float|nullgetReference()
public
getReference() : string
Return values
stringisPass()
public
isPass() : bool
Return values
bool —True only when FILTER is exactly "PASS" ; null (missing) is not a pass
isValidAlternate()
Tells whether a string is an ALT allele as VCF 4.3 writes one (section 1.6.1, ALT) : bases (the IUPAC codes tolerated as for REF), "*" for an allele missing because of an overlapping deletion, a symbolic allele in angle brackets (<DEL>, <INS:ME:ALU>, <*>, <NON_REF>), a breakend joining this position to a mate (G]17:198982], ]13:123456]T, C[<ctg1>:7[, .[13:123457[ at a telomere) or a single breakend (.A, G.). An empty allele, which an empty ALT column used to give, is none.
private
static isValidAlternate(string $sAlternate) : bool
Parameters
- $sAlternate : string