separate | R Documentation |
XString
and a GRanges
objectWith combineIntoModstrings
and separate
the construction and
deconstruction of ModString Objects from an interacive session avoiding
problematic encoding issues. In addition, modification information can be
transfered from/to tabular data with these functions.
combineIntoModstrings
expects seqnames(gr)
or names(gr)
to match the available names(x)
. Only information with strand
information *
and +
are used.
separate
when used with a GRanges
/GRangesList
object
will return an object of the same type, but with modifications seperated. For
example an element with mod = "m1Am"
will be returned as two elements
with mod = c("Am","m1A")
. The reverse operation is available via
combineModifications()
.
removeIncompatibleModifications
filters incompatible modification from
a GRanges
or GRangesList
. incompatibleModifications()
returns the logical vector used for this operation.
separate(x, nc.type = "short")
combineIntoModstrings(
x,
gr,
with.qualities = FALSE,
quality.type = "Phred",
stop.on.error = TRUE,
verbose = FALSE,
...
)
combineModifications(gr, ...)
incompatibleModifications(gr, x, ...)
removeIncompatibleModifications(gr, x, ...)
## S4 method for signature 'ModString'
separate(x, nc.type = c("short", "nc"))
## S4 method for signature 'ModStringSet'
separate(x, nc.type = c("short", "nc"))
## S4 method for signature 'GRanges'
separate(x)
## S4 method for signature 'GRangesList'
separate(x)
## S4 method for signature 'XString,GRanges'
combineIntoModstrings(
x,
gr,
with.qualities = FALSE,
quality.type = "Phred",
stop.on.error = TRUE,
verbose = FALSE,
...
)
## S4 method for signature 'XStringSet,GRangesList'
combineIntoModstrings(
x,
gr,
with.qualities = FALSE,
quality.type = "Phred",
stop.on.error = TRUE,
verbose = FALSE,
...
)
## S4 method for signature 'XStringSet,GRanges'
combineIntoModstrings(
x,
gr,
with.qualities = FALSE,
quality.type = "Phred",
stop.on.error = TRUE,
verbose = FALSE,
...
)
## S4 method for signature 'GRanges'
combineModifications(gr)
## S4 method for signature 'GRangesList'
combineModifications(gr)
## S4 method for signature 'GRanges,XString'
incompatibleModifications(gr, x)
## S4 method for signature 'GRanges,XStringSet'
incompatibleModifications(gr, x)
## S4 method for signature 'GRangesList,XStringSet'
incompatibleModifications(gr, x)
## S4 method for signature 'GRanges,XString'
removeIncompatibleModifications(gr, x)
## S4 method for signature 'GRanges,XStringSet'
removeIncompatibleModifications(gr, x)
## S4 method for signature 'GRangesList,XStringSet'
removeIncompatibleModifications(gr, x)
x |
For For |
nc.type |
the type of nomenclature to be used. Either "short" or "nc".
"Short" for m3C would be "m3C", "nc" for m3C would be "3C". (
|
gr |
a GRanges object |
with.qualities |
|
quality.type |
the type of |
stop.on.error |
For |
verbose |
For |
... |
|
for separate
a GRanges
object and for
combineIntoModstrings
a ModString*
object or a
QualityScaledModStringSet
, if with.qualities = TRUE
.
library(GenomicRanges)
# ModDNAString
seq <- ModDNAString(paste(alphabet(ModDNAString()), collapse = ""))
seq
gr <- separate(seq)
gr
seq2 <- combineIntoModstrings(as(seq,"DNAString"),gr)
seq2
seq == seq2
# ModRNAString
seq <- ModRNAString(paste(alphabet(ModRNAString()), collapse = ""))
seq
gr <- separate(seq)
gr
# Separating RNA modifications
gr <- gr[1]
separate(gr)
# ... and combine them again (both operations work only on a subset of
# modifications)
combineModifications(separate(gr))
# handling incompatible modifications
seq <- RNAString("AGCU")
gr <- GRanges(c("chr1:1:+","chr1:2:+"),mod="m1A")
incompatibleModifications(gr,seq)
#
removeIncompatibleModifications(gr,seq)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.