Description Usage Arguments Details Value Examples
Returns a string representation of the ranges in a GRange object if they are on only one chromosome of one strand. The two ends of each range are separated by a '-' by default but any string can be specified for this 'from' delimiter. Additionally, each range element is separated by a ',' by default, but any string can be specified for this 'between' delimiter. If there are no ranges in the GRange object, then an empty string is returned.
1 | grToElementString(gr, fromDelim = "-", betweenDelim = ",")
|
gr |
The GRange object to extract an element string from. |
fromDelim |
The string to print between the start and end position of a range. Defaults to '-' |
betweenDelim |
The string to print between the range elements. Defaults to ',' |
It is an error to try and generate an element string from a GRanges object representing ranges on more than one chromosome or on more than one strand.
This is the reciprocal of grFromElementString
.
A string equivalent of the ranges in the GRange object provided.
1 2 3 4 5 6 7 8 | gr <- grNew( start=c(1,200,400), end=c(100,300,500), chr='chr1', strand='-')
grToElementString(gr)
#=> [1] "1-100,200-300,400-500"
grToElementString(gr, fromDelim=' to ', betweenDelim='; ')
#=> [1] "1 to 100; 200 to 300; 400 to 500"
gr1 <- grFromElementString(grToElementString(gr), chr='ANY')
grToElementString(gr1) == grToElementString(gr)
#=> [1] TRUE
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.