1 | RLE_NUSE_oligo(Pset, kind, parameters, lab, conditions = NULL, colors = NULL)
|
Pset |
|
kind |
|
parameters |
|
lab |
|
conditions |
|
colors |
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 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (Pset, kind, parameters, lab, conditions = NULL, colors = NULL)
{
if (kind == "NUSE") {
if (is.null(conditions)) {
oligo::NUSE(Pset, main = paste(kind, "plot"), xaxt = "n")
axis(1, at = 1:length(lab), labels = lab, cex.axis = parameters$ce,
las = 2)
}
else if (is.null(colors)) {
CondNames <- mixedsort(lab)
CondTable <- data.frame(CondNames, conditions)
conditions.o <- CondTable[match(lab, CondTable$CondNames),
"conditions"]
list1 <- unique(as.character(sort(conditions.o)))
ColVect <- c(brewer.pal(8, "Dark2"), brewer.pal(12,
"Paired"))
list2 <- ColVect[1:length(unique(conditions))]
map = setNames(list2, list1)
colors <- map[conditions.o]
oligo::NUSE(Pset, main = paste(kind, "plot"), xaxt = "n",
col = colors)
axis(1, at = 1:length(lab), labels = lab, cex.axis = parameters$ce,
las = 2)
legend("topright", legend = list1, cex = parameters$ce +
0.2, fill = list2)
}
else {
CondNames <- mixedsort(lab)
CondTable <- data.frame(CondNames, conditions)
conditions.o <- CondTable[match(lab, CondTable$CondNames),
"conditions"]
list1 <- unique(as.character(sort(conditions.o)))
list2 <- colors
map = setNames(list2, list1)
colors <- map[conditions.o]
oligo::NUSE(Pset, main = paste(kind, "plot"), xaxt = "n",
col = colors)
axis(1, at = 1:length(lab), labels = lab, cex.axis = parameters$ce,
las = 2)
legend("topright", legend = list1, cex = parameters$ce +
0.2, fill = list2)
}
}
else if (kind == "RLE") {
if (is.null(conditions)) {
oligo::RLE(Pset, main = paste(kind, "plot"), xaxt = "n")
axis(1, at = 1:length(lab), labels = lab, cex.axis = parameters$ce,
las = 2)
}
else if (is.null(colors)) {
CondNames <- mixedsort(lab)
CondTable <- data.frame(CondNames, conditions)
conditions.o <- CondTable[match(lab, CondTable$CondNames),
"conditions"]
list1 <- unique(as.character(sort(conditions.o)))
ColVect <- c(brewer.pal(8, "Dark2"), brewer.pal(12,
"Paired"))
list2 <- ColVect[1:length(unique(conditions))]
map = setNames(list2, list1)
colors <- map[conditions.o]
oligo::RLE(Pset, main = paste(kind, "plot"), xaxt = "n",
col = colors)
axis(1, at = 1:length(lab), labels = lab, cex.axis = parameters$ce,
las = 2)
legend("topright", legend = list1, cex = parameters$ce +
0.2, fill = list2)
}
else {
CondNames <- mixedsort(lab)
CondTable <- data.frame(CondNames, conditions)
conditions.o <- CondTable[match(lab, CondTable$CondNames),
"conditions"]
list1 <- unique(as.character(sort(conditions.o)))
list2 <- colors
map = setNames(list2, list1)
colors <- map[conditions.o]
oligo::RLE(Pset, main = paste(kind, "plot"), xaxt = "n",
col = colors)
axis(1, at = 1:length(lab), labels = lab, cex.axis = parameters$ce,
las = 2)
legend("topright", legend = list1, cex = parameters$ce +
0.2, fill = list2)
}
}
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.