Description Usage Arguments Details Value Examples
Returns a string representation of a GRange object if it contains only ranges on just one chromosome and on just one strand. The string returned is specified using the format characters {{c}} for the chromosme, {{S}} for the strand and {{e}} for the element string (formatted as with grToElementString()). The default format returned is "{{c}}:{{e}}:{{s}}"
1 | grToLocationString(gr, format = "{{c}}:{{e}}:{{s}}", ...)
|
gr |
The GRange object to extract a location string from. |
format |
The string to print, translating {{e}} to an element location string, {{c}} as the chromosme, {{s}} as the strand. Defaults to "{{c}}:{{e}}:{{s}}", |
... |
Allows passing parameters to the |
It is an error to try and generate a location string from a GRanges object representing ranges on more than one chromosome or on more than one strand.
This is the reciprocal of /code/linkgrFromLocationString.
A string equivalent to the GRange object provided, formatted as specified.
1 2 3 4 5 6 7 8 9 10 | gr <- grNew( start=c(1,200,400), end=c(100,300,500), chr='chr1', strand='-')
grToLocationString(gr)
#=> [1] "chr1:1-100,200-300,400-500:-"
grToLocationString(gr, format="{{c}}({{s}}){{e}}")
#=> [1] "chr1(-)1-100,200-300,400-500"
grToLocationString(gr, format="On {{c}}: {{e}}.", fromDelim=' to ', betweenDelim=', ')
#=> [1] "On chr1: 1 to 100, 200 to 300, 400 to 500."
gr1 <- grFromLocationString(grToLocationString(gr))
grToLocationString(gr1) == grToLocationString(gr)
#=> [1] TRUE
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.