ModDNAString {Modstrings} | R Documentation

## ModDNAString class

### Description

A `ModDNAString` object allows DNA sequences with modified nucleotides to be stored and manipulated.

### Usage

    ModDNAString(x = "", start = 1, nchar = NA)

### Arguments

`x` | the input as a `character`.
`start` | the postion in the character vector to use as start position in the `ModDNAString` object (default `start = 1`).
`nchar` | the width of the character vector to use in the `ModDNAString` object (default `nchar = NA`). The end position is calculated as `start + nchar - 1`.

### Details

The ModDNAString class contains the virtual `ModString` class, which is itself based on the `XString` class. Therefore, functions for working with `XString` classes are inherited.

The `alphabet` of the ModDNAString class consist of the non-extended IUPAC codes "A,G,C,T,N", the gap letter "-", the hard masking letter "+", the not available letter "." and letters for individual modifications: `alphabet(ModDNAString())`.

Since the special characters are encoded differently depending on the OS and encoding settings of the R session, it is not always possible to enter a DNA sequence containing modified nucleotides via the R console. The most convinient solution for this problem is to use the function `modifyNucleotides` and modify and existing DNAString or ModDNAString object.

A `ModDNAString` object can be converted into a `DNAString` object using the `DNAstring()` constructor. Modified nucleotides are automaitcally converted intro their base nucleotides.

If a modified DNA nucleotide you want to work with is not part of the alphabet, please let us know.

### Value

a `ModDNAString` object

### Examples

    # Constructing ModDNAString containing an m6A
    md1 <- ModDNAString("AGCT`")

    # the alphabet of the ModDNAString class
    alphabet(md1)
    # due to encoding issues the shortNames can also be used
    shortName(md1)
    # due to encoding issues the nomenclature can also be used
    nomenclature(md1)

    # convert to DNAString
    d1 <- DNAString(md1)

[Package Modstrings version 1.6.0 Index]