grFromLocationString: Convert a genomic location string into a GRange object.

Description Usage Arguments Details Value

View source: R/grUtils.R

Description

Given a genomic location string, converts it to a GRanges object. The location string is parsed based on a regular expression with up to three capture groups, capturing the chromosome, the strand, and the element location sub-strings. The element string is then parsed into a sequence of start and stop ranges, and the this data is used to create and return a GRange object. The regexp used to match with must contain at least three named capture groups: (?<chr>..), (?<elements>...), and (?<strand>..). Matching is done using perl=TRUE).

Usage

1
2
3
grFromLocationString(locationString,
  captureRE = "(?<chr>.*?)\\s*:\\s*(?<elements>.*?)\\s*:\\s*(?<strand>[-+*]?)",
  ...)

Arguments

locationString

The string to parse into a GRange object

captureRE

The regular expression used to extract the substrings for the chromosome (chr), the element list (elements), and strand (strand).

...

Allows passing alternate fromDelim and betweenDelim regular expressions through to grFromElementString, which parses the element part of the locationstring

Details

The default location string parsed is assumed to look something like:

1
    "chr1:1-100,200-300,400-500:-"

White-space is ignored around the delimiters ':', ',', and '-'.

Value

A GRange object corresponding to the location string.


jefferys/FusionExpressionPlot documentation built on May 19, 2019, 3:59 a.m.