ldtagr: expand a list of variants by including those in a VCF with LD...

Description Usage Arguments Details Value Note Author(s) Examples

View source: R/ldtagr.R

Description

expand a list of variants by including those in a VCF with LD exceeding some threshold

Usage

1
ldtagr(snprng, tf, samples, genome = "hg19", lbmaf = 0.05, lbR2 = 0.8, radius = 1e+05)

Arguments

snprng

a named GRanges for a single SNP. The name must correspond to the name that will be assigned by genotypeToSnpMatrix to the corresponding column of a SnpMatrix.

tf

TabixFile instance pointing to a bgzipped tabix-indexed VCF file

samples

a vector of sample identifiers, if excluded, all samples used

genome

tag like 'hg19'

lbmaf

lower bound on variant MAF to allow consideration

lbR2

lower bound on R squared for regarding SNP to be incorporated

radius

radius of search in bp around the input range

Details

uses snpStats ld()

Value

a GRanges with names corresponding to 'new' variants and mcols fields 'paramRangeID' (base variant input) and 'R2'

Note

slow but safe approach. probably a matrix method could be substituted using the nice sparse approach already in snpStats

Author(s)

VJ Carey

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
require(GenomicRanges)
if (requireNamespace("gQTLstats")) {
   # install gQTLstats to test this function
 cand = GRanges("1", IRanges(113038694, width=1))
 names(cand) = "rs883593"
 require(VariantAnnotation)
 expath = dir(system.file("vcf", package="gwascat"), patt=".*exon.*gz$", full=TRUE)
 tf = TabixFile(expath)
 ldtagr( cand, tf, lbR2 = .8)
}
# should do with 1000 genomes in S3 bucket and gwascat

vjcitn/gwascat documentation built on May 5, 2019, 7:59 p.m.