Skip to contents

Get SNPs upstream of gene regions. Input SNPs read in with read_vcf and an appropriate TxDb object.

Usage

get_upstream_snps(snps, txdb, level = "genes", ...)

Arguments

snps

SNPs read in with read_vcf.

txdb

A GenomicFeatures::TxDb object with transcript annotations for the organism of interest. Must match the organism specified in the bsgenome argument of read_vcf.

level

Currently only "genes" and "transcripts" are supported, which run GenomicFeatures::genes and GenomicFeatures::transcripts, respectively.

...

Additional arguments passed to get_upstream (e.g., width=).

Value

A GRanges object containing SNPs in regions upstream of intervals in the specified TxDb. See get_upstream.

Examples

if (FALSE) {
library(BSgenome.Ggallus.UCSC.galGal6)
library(TxDb.Ggallus.UCSC.galGal6.refGene)
bs <- BSgenome.Ggallus.UCSC.galGal6
tx <- TxDb.Ggallus.UCSC.galGal6.refGene
vcf_file <- system.file("extdata", "galGal6-chr33.vcf.gz", package="tfboot", mustWork = TRUE)
snps <- read_vcf(vcf_file, BSgenome.Ggallus.UCSC.galGal6)
upstreamsnps <- get_upstream_snps(snps=snps, txdb=tx, level="genes")
upstreamsnps
}