separate {Modstrings} | R Documentation

## Separating and combining a ModString object into/from a XString and a GRanges object

### Description

With `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.

### Usage

    separate(x, nc.type = "short")

    combineIntoModstrings(x, gr, with.qualities = FALSE,
      quality.type = "Phred", verbose = FALSE, ...)

    ## 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 'XString,GRanges'
    combineIntoModstrings(x, gr,
      with.qualities = FALSE, quality.type = "Phred", verbose = FALSE,
      ...)

    ## S4 method for signature 'XStringSet,GRangesList'
    combineIntoModstrings(x, gr,
      with.qualities = FALSE, quality.type = "Phred", verbose = FALSE,
      ...)

    ## S4 method for signature 'XStringSet,GRanges'
    combineIntoModstrings(x, gr,
      with.qualities = FALSE, quality.type = "Phred", verbose = FALSE,
      ...)

### Arguments

`x` | For `separate`: a `ModString` or `ModStringSet` object For `combineIntoModstrings`: a `XStringSet` and a `GRanges` object.
`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". ( `default = "short"`)
`gr` | a GRanges object
`with.qualities` | `TRUE` or `FALSE` (default): Should the values from a `score` column of the `GRanges` object stored? If set `with.qualities = TRUE`, `combineIntoModstrings` will try to construct a `QualityScaledModStringSet` object.
`quality.type` | the type of `QualityXStringSet` used, if `with.qualities = TRUE`. Must be on of the following values: `"Phred","Solexa","Illumina"`.
`verbose` | For `combineIntoModstrings`: `TRUE` or `FALSE` (default): Should verbose information reported on the positions filled with modifications? This settings is passed onto `modifyNucleotides`.
`...` | `default.quality`: For `combineIntoModstrings`: the `default.quality` default value for non-modified positions. (default: `default.quality = 0L`)

### Value

for `separate` a `GRanges` object and for `combineIntoModstrings` a `ModString*` object or a `QualityScaledModStringSet`, if `with.qualities = TRUE`.

### Examples

    seq <- ModDNAString(paste(alphabet(ModDNAString()), collapse = ""))
    gr <- separate(seq)
    seq <- combineIntoModstrings(as(seq,"DNAString"),gr)

[Package Modstrings version 1.2.1 Index]