read.vcf {gaston} | R Documentation |
Create a bed.matrix
from VCF files
Description
Create a bed.matrix
from a .vcf
file.
Usage
read.vcf(file, max.snps, get.info = FALSE, convert.chr = TRUE,
verbose = getOption("gaston.verbose",TRUE))
Arguments
file |
The name of the VCF file to read |
max.snps |
The maximal number of SNPs to read |
get.info |
If |
convert.chr |
If |
verbose |
If |
Details
The vcf format is described in https://github.com/samtools/hts-specs
In addition to the usual data in the slot @snps
, the bed.matrices produced by read.vcf
have
@snps$quality
and @snps$filter
columns corresponding to the QUAL and FILTER fields in the VCF
file. If get.info = TRUE
, an additionnal column @snps$info
is added, corresponding to the
INFO field.
The information about individuals in VCF files is incomplete: in the slot @ped
, the columns
@ped$famid
and @ped$id
will both contain the sample id; sex and phenotypes will be set
to unknown.
The function currently assumes that the GT
field is the first field in the genotypes format.
If it is not the case, the variants are discarded.
Value
Author(s)
Hervé Perdry and Claire Dandine-Roulland
See Also
Examples
## Read vcf file (from file name)
filepath <-system.file("extdata", "LCT.vcf.gz", package="gaston")
x1 <- read.vcf( filepath )
x1