readQueryFile {branchpointer} | R Documentation

## Read a query file

### 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

    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

    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)

[Package branchpointer version 1.14.0 Index]