Description Usage Arguments Details Value Methods (by class) Author(s) See Also Examples
Create a motif from a set of sequences, a matrix, or generate a random motif. See the "Motif import, export and manipulation" vignette for details.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | create_motif(input, alphabet, type = "PPM", name = "motif",
pseudocount = 0, bkg, nsites, altname, family, organism, bkgsites, strand,
pval, qval, eval, extrainfo, add.multifreq)
## S4 method for signature 'missing'
create_motif(input, alphabet, type = "PPM",
name = "motif", pseudocount = 0, bkg, nsites, altname, family, organism,
bkgsites, strand, pval, qval, eval, extrainfo, add.multifreq)
## S4 method for signature 'numeric'
create_motif(input, alphabet, type = "PPM",
name = "motif", pseudocount = 0, bkg, nsites, altname, family, organism,
bkgsites, strand, pval, qval, eval, extrainfo, add.multifreq)
## S4 method for signature 'character'
create_motif(input, alphabet, type = "PPM",
name = "motif", pseudocount = 0, bkg, nsites, altname, family, organism,
bkgsites, strand, pval, qval, eval, extrainfo, add.multifreq)
## S4 method for signature 'matrix'
create_motif(input, alphabet, type = "PPM",
name = "motif", pseudocount = 0, bkg, nsites, altname, family, organism,
bkgsites, strand, pval, qval, eval, extrainfo, add.multifreq)
## S4 method for signature 'DNAStringSet'
create_motif(input, alphabet, type = "PPM",
name = "motif", pseudocount = 0, bkg, nsites, altname, family, organism,
bkgsites, strand, pval, qval, eval, extrainfo, add.multifreq)
## S4 method for signature 'RNAStringSet'
create_motif(input, alphabet, type = "PPM",
name = "motif", pseudocount = 0, bkg, nsites, altname, family, organism,
bkgsites, strand, pval, qval, eval, extrainfo, add.multifreq)
## S4 method for signature 'AAStringSet'
create_motif(input, alphabet, type = "PPM",
name = "motif", pseudocount = 0, bkg, nsites, altname, family, organism,
bkgsites, strand, pval, qval, eval, extrainfo, add.multifreq)
## S4 method for signature 'BStringSet'
create_motif(input, alphabet, type = "PPM",
name = "motif", pseudocount = 0, bkg, nsites, altname, family, organism,
bkgsites, strand, pval, qval, eval, extrainfo, add.multifreq)
|
input |
|
alphabet |
|
type |
|
name |
|
pseudocount |
|
bkg |
|
nsites |
|
altname |
|
family |
|
organism |
|
bkgsites |
|
strand |
|
pval |
|
qval |
|
eval |
|
extrainfo |
|
add.multifreq |
|
The aim of this function is provide an easy interface to creating
universalmotif motifs, as an alternative to the
default class constructor (i.e. new('universalmotif', name=...)
).
See examples for potential use cases.
Note: when generating random motifs, the nsites
slot is also given a
random value.
See the examples
section for more info on motif creation.
universalmotif object.
missing
: Create a random motif of length 10.
numeric
: Create a random motif with a specified length.
character
: Create motif from a consensus string.
matrix
: Create motif from a matrix.
DNAStringSet
: Create motif from a DNAStringSet
.
RNAStringSet
: Create motif from a RNAStringSet
.
AAStringSet
: Create motif from a AAStringSet
.
BStringSet
: Create motif from a BStringSet
.
Benjamin Jean-Marie Tremblay, b2tremblay@uwaterloo.ca
convert_type()
, add_multifreq()
, create_sequences()
,
shuffle_motifs()
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 | ##### create motifs from a single string
# Motif is by default generated as a PPM: change final type as desired
DNA.motif <- create_motif("TATAWAW")
DNA.motif <- create_motif("TATAWAW", type = "PCM")
# Nsites will be set to the number of input sequences unless specified or
# a single string is used as input
DNA.motif <- create_motif("TTTTTTT", nsites = 10)
# Ambiguity letters can be used:
DNA.motif <- create_motif("TATAWAW")
DNA.motif <- create_motif("NNVVWWAAWWDDN")
# Be careful about setting nsites when using ambiguity letters!
DNA.motif <- create_motif("NNVVWWAAWWDDN", nsites = 1)
RNA.motif <- create_motif("UUUCCG")
# 'create_motif' will try to detect the alphabet type; this can be
# unreliable for AA and custom alphabets as DNA and RNA alphabets are
# detected first
AA.motif <- create_motif("AVLK", alphabet = "AA")
custom.motif <- create_motif("QWER", alphabet = "QWER")
# Specify custom alphabet
custom.motif <- create_motif("QWER", alphabet = "QWERASDF")
###### Create motifs from multiple strings of equal length
DNA.motif <- create_motif(c("TTTT", "AAAA", "AACC", "TTGG"), type = "PPM")
DNA.motif <- create_motif(c("TTTT", "AAAA", "AACC", "TTGG"), nsites = 20)
RNA.motif <- create_motif(c("UUUU", "AAAA", "AACC", "UUGG"), type = "PWM")
AA.motif <- create_motif(c("ARNDCQ", "EGHILK", "ARNDCQ"), alphabet = "AA")
custom.motif <- create_motif(c("POIU", "LKJH", "POIU", "CVBN"),
alphabet = "POIULKJHCVBN")
# Ambiguity letters are only allowed for single consensus strings: the
# following fails
## Not run:
create_motif(c("WWTT", "CCGG"))
create_motif(c("XXXX", "XXXX"), alphabet = "AA")
## End(Not run)
##### Create motifs from XStringSet objects
library(Biostrings)
DNA.set <- DNAStringSet(c("TTTT", "AAAA", "AACC", "TTGG"))
DNA.motif <- create_motif(DNA.set)
RNA.set <- RNAStringSet(c("UUUU", "AACC", "UUCC"))
RNA.motif <- create_motif(RNA.set)
AA.set <- AAStringSet(c("VVVLLL", "AAAIII"))
AA.motif <- create_motif(AA.set)
# Custom motifs can be created from BStringSet objects
B.set <- BStringSet(c("QWER", "ASDF", "ZXCV", "TYUI"))
custom.motif <- create_motif(B.set)
##### Create motifs with filled 'multifreq' slot
DNA.motif.k2 <- create_motif(DNA.set, add.multifreq = 2)
##### Create motifs from matrices
mat <- matrix(c(1, 1, 1, 1,
2, 0, 2, 0,
0, 2, 0, 2,
0, 0, 0, 0),
nrow = 4, byrow = TRUE)
DNA.motif <- create_motif(mat, alphabet = "DNA")
RNA.motif <- create_motif(mat, alphabet = "RNA", nsites = 20)
custom.motif <- create_motif(mat, alphabet = "QWER")
# Specify custom alphabet
custom.motif <- create_motif(mat, alphabet = "QWER")
# Alphabet can be detected from rownames
rownames(mat) <- DNA_BASES
DNA.motif <- create_motif(mat)
rownames(mat) <- c("Q", "W", "E", "R")
custom.motif <- create_motif(mat)
# Matrices can also be used as input
mat.ppm <- matrix(c(0.1, 0.1, 0.1, 0.1,
0.5, 0.5, 0.5, 0.5,
0.1, 0.1, 0.1, 0.1,
0.3, 0.3, 0.3, 0.3),
nrow = 4, byrow = TRUE)
DNA.motif <- create_motif(mat.ppm, alphabet = "DNA", type = "PPM")
##### Create random motifs
# These are generated as PPMs with 10 positions
DNA.motif <- create_motif()
RNA.motif <- create_motif(alphabet = "RNA")
AA.motif <- create_motif(alphabet = "AA")
custom.motif <- create_motif(alphabet = "QWER")
# The number of positions can be specified
DNA.motif <- create_motif(5)
# If the background frequencies are not provided, they are generated
# using `rpois`; positions are created using `rdirichlet(1, bkg)`.
# (calling `create_motif()` creates motifs with an average
# positional IC of 1)
DNA.motif <- create_motif(bkg = c(0.3, 0.2, 0.2, 0.3))
DNA.motif <- create_motif(10, bkg = c(0.1, 0.4, 0.4, 0.1))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.