read.vcf | R Documentation |
bed.matrix
from VCF files Create a bed.matrix
from a .vcf
file.
read.vcf(file, max.snps, get.info = FALSE, convert.chr = TRUE,
verbose = getOption("gaston.verbose",TRUE))
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 |
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.
A bed.matrix
Hervé Perdry and Claire Dandine-Roulland
read.bed.matrix
## Read vcf file (from file name)
filepath <-system.file("extdata", "LCT.vcf.gz", package="gaston")
x1 <- read.vcf( filepath )
x1
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.