readQueryFile: Read a query file

Description Usage Arguments Value Author(s) Examples

View source: R/readQueryFile.R

Description

Reads and formats a manually generated query file, and finds realtive locations of the closest annotated exons Converts unstranded SNPs to two entries for each strand. Checks for duplicate names and replaces if found.

Usage

1
readQueryFile(queryFile, queryType, exons, maxDist = 50, filter = TRUE)

Arguments

queryFile

tab delimited file containing query information. For intronic regions should be in the format: region id, chromosome name, region start, region end, strand. For SNP variants should be in the format: SNP id, chromosome name, SNP position, strand, reference allele (A/T/C/G), alternative allele (A/T/C/G)

queryType

type of query file ("SNP" or "region")

exons

GRanges containing exon co-ordinates. Should be produced by gtfToExons()

maxDist

maximum distance a SNP can be from an annotated 3' exon.

filter

remove SNP queries prior to finding finding nearest exons.

Value

Formatted query GRanges

Author(s)

Beth Signal

Examples

1
2
3
4
5
6
7
8
smallExons <- system.file("extdata","gencode.v26.annotation.small.gtf", package = "branchpointer")
exons <- gtfToExons(smallExons)

querySNPFile <- system.file("extdata","SNP_example.txt", package = "branchpointer")
querySNP <- readQueryFile(querySNPFile, queryType = "SNP", exons)

queryIntronFile <- system.file("extdata","intron_example.txt", package = "branchpointer")
queryIntron <- readQueryFile(queryIntronFile,queryType = "region", exons)

betsig/branchpointer documentation built on Sept. 27, 2021, 10:31 p.m.