View source: R/Modstrings-ModString.R
ModDNAString | R Documentation |
A ModDNAString
object allows DNA sequences with modified nucleotides
to be stored and manipulated.
ModDNAString(x = "", start = 1, nchar = NA)
x |
the input as a |
start |
the postion in the character vector to use as start position in
the |
nchar |
the width of the character vector to use in the
|
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.
a ModDNAString
object
# Constructing ModDNAString containing an m6A
md1 <- ModDNAString("AGCT`")
md1
# 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)
d1
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.