VCFHeader-class | R Documentation |
The VCFHeader
class holds Variant Call Format (VCF) file
header information and is produced from a call to scanVcfHeader
.
The VCFHeader
class holds header information from a
VCF file.
Slots :
reference
character() vector
sample
character() vector
header
DataFrameList-class
VCFHeader(reference = character(), samples = character(),
header = DataFrameList(), ...)
In the following code snippets x
is a VCFHeader object.
samples(x)
:
Returns a character() vector of names of samples.
header(x)
:
Returns all information in the header slot which includes
meta
, info
and geno
if present.
meta(x)
, meta(x)<- value
: The getter returns a
DataFrameList
. Each DataFrame
represents a unique
"key" name in the header file. Multiple header lines
with the same "key" are parsed into the same DataFrame
with the "ID" field as the row names. Simple header lines
have no "ID" field in which case the "key" is used as the
row name.
NOTE: In VariantAnnotation <= 1.27.5, the meta()
extractor
returned a DataFrame
called "META" which held all simple
key-value header lines. The VCF 4.3 specs allowed headers lines
with key name "META" which caused a name clash with the pre-existing
"META" DataFrame
.
In VariantAnnotation
>=1.27.6 the "META" DataFrame
was
split and each row became its own separate DataFrame
. Calling
meta()
on a VCFHeader
object now returns a list of
DataFrames
, one for each unique key name in the header.
fixed(x), fixed(x)<- value
:
Returns a DataFrameList
of information pertaining to any of
‘REF’, ‘ALT’, ‘FILTER’ and ‘QUAL’.
Replacement value must be a DataFrameList
with one or more of
the following names, ‘QUAL’, ‘FILTER’, ‘REF’
and ‘ALT’.
info(x)
, info(x)<- value
:
Gets or sets a DataFrame
of ‘INFO’ information.
Replacement value must be a DataFrame
with 3 columns
named ‘Number’, ‘Type’ and ‘Description’.
geno(x)
, geno(x)<- value
:
Returns a DataFrame
of ‘FORMAT’ information.
Replacement value must be a DataFrame
with 3 columns
named ‘Number’, ‘Type’ and ‘Description’.
reference(x)
:
Returns a character() vector with names of reference sequences.
Not relevant for scanVcfHeader
.
vcfFields(x)
:
Returns a CharacterList
of all available VCF
fields, with names of fixed
, info
, geno
and
samples
indicating the four categories. Each element is a
character() vector of available VCF field names within each category.
A character() vector of sequences.
A character() vector of sample names.
A DataFrameList
of parsed header lines
(preceeded by “##”) present in the VCF file.
Additional arguments passed to methods.
Valerie Obenchain
scanVcfHeader
,
DataFrameList
fl <- system.file("extdata", "structural.vcf", package="VariantAnnotation")
hdr <- scanVcfHeader(fl)
fixed(hdr)
info(hdr)
geno(hdr)
vcfFields(hdr)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.