Learn R Programming

gQTLseq (version 0.0.10)

vcf2sm.gr1: create a SnpMatrix instance from a VCF file, for a single GRange

Description

create a SnpMatrix instance from a VCF file, for a single GRange

Usage

vcf2sm.gr1(fn, gr, idsToKeep = NULL, nmetacol = 9L, fixDot = TRUE)

Arguments

fn
path to VCF; all TabixFile handling done internally as it is a two-pass process
gr
GRanges of length 1
idsToKeep
optional vector of sample ids that should be present and to which extract will be limited
nmetacol
what columns of the VCF record stream are feature metadata as opposed to sample variant data
fixDot
logical: if TRUE, when the locus name is ".", a chr:position name will be created and used

Value

Details

some 'esv*' tokens are repeated as feature names. these and any other duplicated names will be modified using make.unique

Examples

Run this code
t17 = tiling("chr17", 10000)
GenomicRanges::seqlevels(t17) = "17"
v17 = system.file("vcf/lit17a.vcf.gz", package="chan1kg")
lapply(1:2, function(x) vcf2sm.gr1(v17, t17[x]))

Run the code above in your browser using DataLab