... | ... |
@@ -1,11 +1,11 @@ |
1 | 1 |
Package: vsclust |
2 | 2 |
Type: Package |
3 | 3 |
Title: Feature-based variance-sensitive quantitative clustering |
4 |
-Version: 0.99.20 |
|
4 |
+Version: 0.99.21 |
|
5 | 5 |
Date: 2022-03-23 |
6 | 6 |
Authors@R: |
7 | 7 |
person( |
8 |
- "Veit", "Schwämmle", |
|
8 |
+ "Veit", "Schwaemmle", |
|
9 | 9 |
email = "[email protected]", |
10 | 10 |
role = c("aut", "cre") |
11 | 11 |
) |
... | ... |
@@ -26,7 +26,8 @@ Suggests: |
26 | 26 |
yaml, |
27 | 27 |
testthat (>= 3.0.0), |
28 | 28 |
rmarkdown, |
29 |
- BiocStyle |
|
29 |
+ BiocStyle, |
|
30 |
+ clusterProfiler |
|
30 | 31 |
LinkingTo: Rcpp |
31 | 32 |
biocViews: |
32 | 33 |
Clustering, |
... | ... |
@@ -18,12 +18,15 @@ export(pcaWithVar) |
18 | 18 |
export(runClustWrapper) |
19 | 19 |
export(runVSClustApp) |
20 | 20 |
export(vsclust_algorithm) |
21 |
-import(MultiAssayExperiment) |
|
22 | 21 |
import(grDevices) |
23 | 22 |
import(graphics) |
24 | 23 |
import(limma) |
25 | 24 |
import(parallel) |
26 | 25 |
import(stats) |
26 |
+importFrom(MultiAssayExperiment,assay) |
|
27 |
+importFrom(MultiAssayExperiment,assays) |
|
28 |
+importFrom(MultiAssayExperiment,colData) |
|
29 |
+importFrom(MultiAssayExperiment,sampleMap) |
|
27 | 30 |
importFrom(grDevices,rainbow) |
28 | 31 |
importFrom(grDevices,recordPlot) |
29 | 32 |
importFrom(matrixStats,rowMaxs) |
... | ... |
@@ -31,7 +31,7 @@ cvalidate.xiebeni <- |
31 | 31 |
ncenters <- |
32 | 32 |
dim(clres$centers)[1] |
33 | 33 |
for (i in seq_len(ncenters - 1)) { |
34 |
- for (j in (i + 1):ncenters) { |
|
34 |
+ for (j in seq(i + 1,ncenters, 1)) { |
|
35 | 35 |
diff <- clres$ce[i,] - clres$ce[j,] |
36 | 36 |
diffdist <- |
37 | 37 |
t(diff) %*% t(t(diff)) |
... | ... |
@@ -61,9 +61,9 @@ cvalidate.xiebeni <- |
61 | 61 |
#' @param mfrow vector of two numbers for the number of rows and colums, figure |
62 | 62 |
#' panels are distributed in the plot |
63 | 63 |
#' @param colo color map to be used (can be missing) |
64 |
-#' @param min.mem filter for showing only features with a higher membership |
|
64 |
+#' @param minMem filter for showing only features with a higher membership |
|
65 | 65 |
#' values than this value |
66 |
-#' @param time.labels alternative labels for different conditions |
|
66 |
+#' @param timeLabels alternative labels for different conditions |
|
67 | 67 |
#' @param filename for writing into pdf. Will write on screen when using NA |
68 | 68 |
#' @param xlab Label of x-axis |
69 | 69 |
#' @param ylab Label of y-axis |
... | ... |
@@ -72,9 +72,9 @@ cvalidate.xiebeni <- |
72 | 72 |
#' data <- matrix(rnorm(seq_len(5000)), nrow=500) |
73 | 73 |
#' # Run clustering |
74 | 74 |
#' clres <- vsclust_algorithm(data, centers=2, m=1.5) |
75 |
-#' mfuzz.plot(data, clres, mfrow=c(2,3), min.mem=0.0) |
|
75 |
+#' mfuzz.plot(data, clres, mfrow=c(2,3), minMem=0.0) |
|
76 | 76 |
#' @return Multiple panels showing expression profiles of clustered features |
77 |
-#' passing the min.mem threshold |
|
77 |
+#' passing the minMem threshold |
|
78 | 78 |
#' @export |
79 | 79 |
#' @references |
80 | 80 |
#' Schwaemmle V, Jensen ON. VSClust: feature-based variance-sensitive clustering |
... | ... |
@@ -95,15 +95,15 @@ mfuzz.plot <- |
95 | 95 |
cl, |
96 | 96 |
mfrow = c(1, 1), |
97 | 97 |
colo, |
98 |
- min.mem = 0, |
|
99 |
- time.labels, |
|
98 |
+ minMem = 0, |
|
99 |
+ timeLabels, |
|
100 | 100 |
filename = NA, |
101 | 101 |
xlab = "Time", |
102 | 102 |
ylab = "Expression changes") |
103 | 103 |
{ |
104 | 104 |
clusterindex <- cl[[3]] |
105 | 105 |
memship <- cl[[4]] |
106 |
- memship[memship < min.mem] <- -1 |
|
106 |
+ memship[memship < minMem] <- -1 |
|
107 | 107 |
colorindex <- integer(dim(dat)[[1]]) |
108 | 108 |
if (missing(colo)) { |
109 | 109 |
colo <- c( |
... | ... |
@@ -168,15 +168,15 @@ mfuzz.plot <- |
168 | 168 |
) |
169 | 169 |
} else { |
170 | 170 |
if (colo == "fancy") { |
171 |
- fancy.blue <- c(c(255:0), rep(0, length(c(255:0))), |
|
171 |
+ fancyBlue <- c(c(255:0), rep(0, length(c(255:0))), |
|
172 | 172 |
rep(0, length(c(255:150)))) |
173 |
- fancy.green <- |
|
173 |
+ fanceGreen <- |
|
174 | 174 |
c(c(0:255), c(255:0), rep(0, length(c(255:150)))) |
175 |
- fancy.red <- c(c(0:255), rep(255, length(c(255:0))), |
|
175 |
+ fancyRed <- c(c(0:255), rep(255, length(c(255:0))), |
|
176 | 176 |
c(255:150)) |
177 |
- colo <- rgb(blue = fancy.blue / 255, |
|
178 |
- green = fancy.green / 255, |
|
179 |
- red = fancy.red / 255) |
|
177 |
+ colo <- rgb(blue = fancyBlue / 255, |
|
178 |
+ green = fanceGreen / 255, |
|
179 |
+ red = fancyRed / 255) |
|
180 | 180 |
} |
181 | 181 |
} |
182 | 182 |
colorseq <- seq(0, 1, length = length(colo)) |
... | ... |
@@ -208,12 +208,12 @@ mfuzz.plot <- |
208 | 208 |
main = paste("Cluster", j), |
209 | 209 |
axes = FALSE |
210 | 210 |
) |
211 |
- if (missing(time.labels)) { |
|
211 |
+ if (missing(timeLabels)) { |
|
212 | 212 |
axis(1, seq_len(dim(dat)[[2]]), c(seq_len(dim(dat)[[2]]))) |
213 | 213 |
axis(2) |
214 | 214 |
} |
215 | 215 |
else { |
216 |
- axis(1, seq_len(dim(dat)[[2]]), time.labels) |
|
216 |
+ axis(1, seq_len(dim(dat)[[2]]), timeLabels) |
|
217 | 217 |
axis(2) |
218 | 218 |
} |
219 | 219 |
} |
... | ... |
@@ -235,12 +235,12 @@ mfuzz.plot <- |
235 | 235 |
main = paste("Cluster", j), |
236 | 236 |
axes = FALSE |
237 | 237 |
) |
238 |
- if (missing(time.labels)) { |
|
238 |
+ if (missing(timeLabels)) { |
|
239 | 239 |
axis(1, seq_len(dim(dat)[[2]]), seq_len(dim(dat)[[2]])) |
240 | 240 |
axis(2) |
241 | 241 |
} |
242 | 242 |
else { |
243 |
- axis(1, seq_len(dim(dat)[[2]]), time.labels) |
|
243 |
+ axis(1, seq_len(dim(dat)[[2]]), timeLabels) |
|
244 | 244 |
axis(2) |
245 | 245 |
} |
246 | 246 |
} |
... | ... |
@@ -271,7 +271,7 @@ mfuzz.plot <- |
271 | 271 |
#' |
272 | 272 |
#' @param ClustInd Matrix with values from validity indices |
273 | 273 |
#' @return Multiple panels showing expression profiles of clustered features |
274 |
-#' passing the min.mem threshold |
|
274 |
+#' passing the minMem threshold |
|
275 | 275 |
#' @examples |
276 | 276 |
#' data("artificial_clusters") |
277 | 277 |
#' dat <- averageCond(artificial_clusters, 5, 10) |
... | ... |
@@ -297,7 +297,7 @@ estimClust.plot <- function(ClustInd) { |
297 | 297 |
par(mfrow = c(1, 3)) |
298 | 298 |
maxClust <- nrow(ClustInd) + 2 |
299 | 299 |
plot( |
300 |
- 3:maxClust, |
|
300 |
+ seq(3,maxClust,1), |
|
301 | 301 |
ClustInd[seq_len(nrow(ClustInd)), "MinCentroidDist_VSClust"], |
302 | 302 |
col = 2 , |
303 | 303 |
type = "b", |
... | ... |
@@ -309,7 +309,7 @@ estimClust.plot <- function(ClustInd) { |
309 | 309 |
max(ClustInd[, grep("MinCentroidDist", |
310 | 310 |
colnames(ClustInd))], na.rm = TRUE)) |
311 | 311 |
) |
312 |
- lines(3:maxClust, ClustInd[seq_len(nrow(ClustInd)), "MinCentroidDist_FCM"], |
|
312 |
+ lines(seq(3,maxClust,1), ClustInd[seq_len(nrow(ClustInd)), "MinCentroidDist_FCM"], |
|
313 | 313 |
col = 3, type = "b") |
314 | 314 |
dmindist <- optimalClustNum(ClustInd) |
315 | 315 |
points(dmindist, |
... | ... |
@@ -325,7 +325,7 @@ estimClust.plot <- function(ClustInd) { |
325 | 325 |
) |
326 | 326 |
grid(NULL, NA, lwd = 1, col = 1) |
327 | 327 |
plot( |
328 |
- 3:maxClust, |
|
328 |
+ seq(3,maxClust,1), |
|
329 | 329 |
ClustInd[seq_len(nrow(ClustInd)), "XieBeni_VSClust"], |
330 | 330 |
col = 2, |
331 | 331 |
type = "b", |
... | ... |
@@ -337,7 +337,7 @@ estimClust.plot <- function(ClustInd) { |
337 | 337 |
max(ClustInd[, grep("XieBeni", colnames(ClustInd))], na.rm = |
338 | 338 |
TRUE)) |
339 | 339 |
) |
340 |
- lines(3:maxClust, ClustInd[seq_len(nrow(ClustInd)), "XieBeni_FCM"], type = |
|
340 |
+ lines(seq(3,maxClust,1), ClustInd[seq_len(nrow(ClustInd)), "XieBeni_FCM"], type = |
|
341 | 341 |
"b", col = 3) |
342 | 342 |
dxiebeni <- optimalClustNum(ClustInd, index = "XieBeni") |
343 | 343 |
points(dxiebeni, |
... | ... |
@@ -43,7 +43,7 @@ determine_fuzz <- function(dims, NClust, Sds = 1) { |
43 | 43 |
### d_i and d_t |
44 | 44 |
difunc <- |
45 | 45 |
function(c, D) { |
46 |
- x <- 0:c |
|
46 |
+ x <- seq(0,c,1) |
|
47 | 47 |
sum(choose(c, x) / (x * D + 1) * (-1) ^ x) |
48 | 48 |
} |
49 | 49 |
|
... | ... |
@@ -73,13 +73,13 @@ determine_fuzz <- function(dims, NClust, Sds = 1) { |
73 | 73 |
#' @param x a numeric data matrix |
74 | 74 |
#' @param centers Either numeric for number of clusters or numeric matrix with |
75 | 75 |
#' center coordinates |
76 |
-#' @param iter.max Numeric for maximum number of iterations |
|
76 |
+#' @param iterMax Numeric for maximum number of iterations |
|
77 | 77 |
#' @param verbose Verbose information |
78 | 78 |
#' @param dist Distance to use for the calculation. We prefer "euclidean" |
79 | 79 |
#' (default) |
80 | 80 |
#' @param m Fuzzifier value: numeric or vector of length equal to number of rows |
81 | 81 |
#' of x |
82 |
-#' @param rate.par (experimental) numeric value for punishing missing values |
|
82 |
+#' @param ratePar (experimental) numeric value for punishing missing values |
|
83 | 83 |
#' @param weights numeric or vector of length equal to number of rows of x |
84 | 84 |
#' @param control list with arguments to vsclust algorithms (now only cutoff for |
85 | 85 |
#' relative tolerance: reltol) |
... | ... |
@@ -112,11 +112,11 @@ determine_fuzz <- function(dims, NClust, Sds = 1) { |
112 | 112 |
vsclust_algorithm <- |
113 | 113 |
function(x, |
114 | 114 |
centers, |
115 |
- iter.max = 100, |
|
115 |
+ iterMax = 100, |
|
116 | 116 |
verbose = FALSE, |
117 | 117 |
dist = "euclidean", |
118 | 118 |
m = 2, |
119 |
- rate.par = NULL, |
|
119 |
+ ratePar = NULL, |
|
120 | 120 |
weights = 1, |
121 | 121 |
control = list()) |
122 | 122 |
{ |
... | ... |
@@ -157,11 +157,11 @@ vsclust_algorithm <- |
157 | 157 |
if (xcols != ncol(centers)) |
158 | 158 |
stop("Must have same number of columns in 'x' and 'centers'.") |
159 | 159 |
|
160 |
- if (iter.max < 1) |
|
161 |
- stop("Argument 'iter.max' must be positive.") |
|
160 |
+ if (iterMax < 1) |
|
161 |
+ stop("Argument 'iterMax' must be positive.") |
|
162 | 162 |
|
163 |
- if (missing(rate.par)) { |
|
164 |
- rate.par <- 0 |
|
163 |
+ if (missing(ratePar)) { |
|
164 |
+ ratePar <- 0 |
|
165 | 165 |
} |
166 | 166 |
|
167 | 167 |
reltol <- control$reltol |
... | ... |
@@ -194,14 +194,14 @@ vsclust_algorithm <- |
194 | 194 |
weights, |
195 | 195 |
m, |
196 | 196 |
dist - 1, |
197 |
- iter.max, |
|
197 |
+ iterMax, |
|
198 | 198 |
reltol, |
199 | 199 |
verbose, |
200 | 200 |
u , |
201 | 201 |
1, |
202 | 202 |
iter, |
203 | 203 |
NA, |
204 |
- rate.par) |
|
204 |
+ ratePar) |
|
205 | 205 |
# put modified values in retval |
206 | 206 |
retval <- |
207 | 207 |
list( |
... | ... |
@@ -212,10 +212,10 @@ vsclust_algorithm <- |
212 | 212 |
ncenters = ncenters, |
213 | 213 |
m = m, |
214 | 214 |
dist = dist - 1, |
215 |
- iter.max = iter.max, |
|
215 |
+ iterMax = iterMax, |
|
216 | 216 |
reltol = reltol, |
217 | 217 |
verbose = verbose, |
218 |
- rate.par = rate.par, |
|
218 |
+ ratePar = ratePar, |
|
219 | 219 |
u = u, |
220 | 220 |
ermin = val, |
221 | 221 |
iter = iter |
... | ... |
@@ -316,11 +316,11 @@ ClustComp <- |
316 | 316 |
NClust, |
317 | 317 |
m = m, |
318 | 318 |
verbose = FALSE, |
319 |
- iter.max = |
|
319 |
+ iterMax = |
|
320 | 320 |
1000 |
321 | 321 |
)) |
322 | 322 |
# cls <- lapply(seq_len(NSs), function(x) vsclust_algorithm(tData,NClust, |
323 |
- # m=m, verbose=FALSE,iter.max=1000)) #print(cls[[1]]) |
|
323 |
+ # m=m, verbose=FALSE,iterMax=1000)) #print(cls[[1]]) |
|
324 | 324 |
Bestcl <- cls[[which.min(lapply(cls, function(x) |
325 | 325 |
x$withinerror))]] |
326 | 326 |
cls <- |
... | ... |
@@ -330,7 +330,7 @@ ClustComp <- |
330 | 330 |
NClust, |
331 | 331 |
m = mm, |
332 | 332 |
verbose = FALSE, |
333 |
- iter.max = |
|
333 |
+ iterMax = |
|
334 | 334 |
1000 |
335 | 335 |
)) |
336 | 336 |
Bestcl2 <- cls[[which.min(lapply(cls, function(x) |
... | ... |
@@ -39,7 +39,6 @@ print.fclust <- |
39 | 39 |
#' @param NClust Number of clusters |
40 | 40 |
#' @importFrom matrixStats rowMaxs |
41 | 41 |
#' @return fclust object with reorder clusters |
42 |
-#' @example |
|
43 | 42 |
#' @examples |
44 | 43 |
#' # Generate some random data |
45 | 44 |
#' data <- matrix(rnorm(seq_len(1000)), nrow=100) |
... | ... |
@@ -83,9 +82,8 @@ SwitchOrder <- function(Bestcl, NClust) { |
83 | 82 |
#' @return Biological Homogeneity Index |
84 | 83 |
#' @examples |
85 | 84 |
#' # Run enrichment analysis |
86 |
-#' library(clusterProfiler) |
|
87 |
-#' data(gcSample) |
|
88 |
-#' xx <- compareCluster(gcSample, fun="enrichKEGG", |
|
85 |
+#' data(gcSample, package="clusterProfiler") |
|
86 |
+#' xx <- clusterProfiler::compareCluster(gcSample, fun="enrichKEGG", |
|
89 | 87 |
#' organism="hsa", pvalueCutoff=0.05) |
90 | 88 |
#' # Generate random list from gcSample |
91 | 89 |
#' rand_ids <- lapply(gcSample, function(x) sample(unlist(gcSample), 200)) |
... | ... |
@@ -133,7 +131,7 @@ calcBHI <- function(Accs, gos) { |
133 | 131 |
ltgenes <- length(tgenes) |
134 | 132 |
if (ltgenes > 1) { |
135 | 133 |
for (i1 in tgenes[seq_len(ltgenes - 1)]) { |
136 |
- ttgene <- tgenes[(which(i1 == tgenes) + 1):ltgenes] |
|
134 |
+ ttgene <- tgenes[seq(which(i1 == tgenes) + 1,ltgenes,1)] |
|
137 | 135 |
ispair[i1, ttgene] <- ispair[ttgene, i1] <- TRUE |
138 | 136 |
} |
139 | 137 |
|
... | ... |
@@ -165,7 +163,7 @@ averageCond <- function(data, NumReps, NumCond) { |
165 | 163 |
# Calculates means over replicates |
166 | 164 |
tdat <- |
167 | 165 |
rowMeans(data[, seq(1, NumReps * NumCond, NumCond)], na.rm = TRUE) |
168 |
- for (i in 2:NumCond) { |
|
166 |
+ for (i in seq(2,NumCond,1)) { |
|
169 | 167 |
tdat <- |
170 | 168 |
cbind(tdat, rowMeans(data[, seq(i, NumReps * NumCond, NumCond)], na.rm = |
171 | 169 |
TRUE)) |
... | ... |
@@ -14,7 +14,7 @@ NULL |
14 | 14 |
#' scaling and filtering of missing values |
15 | 15 |
#' @param dat matrix or data frame of numerical data. Columns are samples. |
16 | 16 |
#' Replicates are grouped (i.e. A1, B1, C1, A2, B2, C2) when letters denote |
17 |
-#' conditions and numbers the replicates. In case of `isStat=F`, you need a |
|
17 |
+#' conditions and numbers the replicates. In case of `isStat=FALSE`, you need a |
|
18 | 18 |
#' last column for the standard deviations |
19 | 19 |
#' @param NumReps Number replicates in the data |
20 | 20 |
#' @param NumCond Number of different experimental conditions. The total number |
... | ... |
@@ -123,7 +123,7 @@ PrepareForVSClust <- |
123 | 123 |
#' stats <- PrepareSEForVSClust(miniACC, coldatname="COC", isStat=TRUE) |
124 | 124 |
#' |
125 | 125 |
#' @import stats |
126 |
-#' @import MultiAssayExperiment |
|
126 |
+#' @importFrom MultiAssayExperiment assay assays sampleMap colData |
|
127 | 127 |
#' @importFrom matrixStats rowSds |
128 | 128 |
#' @importFrom shiny validate |
129 | 129 |
#' @export |
... | ... |
@@ -287,7 +287,7 @@ estimClustNum <- function(dat, |
287 | 287 |
sds <- sds / (rowSds(as.matrix(tData), na.rm = TRUE)) |
288 | 288 |
tData <- t(scale(t(tData))) |
289 | 289 |
|
290 |
- multiOut <- lapply(3:maxClust, function(x) { |
|
290 |
+ multiOut <- lapply(seq(3,maxClust,1), function(x) { |
|
291 | 291 |
if (!is.null(getDefaultReactiveDomain())) { |
292 | 292 |
incProgress(1, detail = paste("Running cluster number", x)) |
293 | 293 |
} else { |
... | ... |
@@ -306,9 +306,9 @@ estimClustNum <- function(dat, |
306 | 306 |
|
307 | 307 |
stopCluster(cl) |
308 | 308 |
|
309 |
- for (NClust in 3:maxClust) |
|
309 |
+ for (NClust in seq(3,maxClust,1)) |
|
310 | 310 |
ClustInd[NClust - 2,] <- multiOut[[NClust - 2]] |
311 |
- rownames(ClustInd) <- paste0("num_clust_", 3:maxClust) |
|
311 |
+ rownames(ClustInd) <- paste0("num_clust_", seq(3,maxClust,1)) |
|
312 | 312 |
colnames(ClustInd) <- |
313 | 313 |
c( |
314 | 314 |
"MinCentroidDist_VSClust", |
... | ... |
@@ -412,7 +412,7 @@ runClustWrapper <- |
412 | 412 |
tData, |
413 | 413 |
cl = Bestcl, |
414 | 414 |
mfrow = c(round(sqrt(NClust)), ceiling(sqrt(NClust))), |
415 |
- min.mem = 0.5, |
|
415 |
+ minMem = 0.5, |
|
416 | 416 |
colo = "fancy" |
417 | 417 |
) |
418 | 418 |
p <- recordPlot() |
... | ... |
@@ -9,7 +9,7 @@ PrepareForVSClust(dat, NumReps, NumCond, isPaired = FALSE, isStat) |
9 | 9 |
\arguments{ |
10 | 10 |
\item{dat}{matrix or data frame of numerical data. Columns are samples. |
11 | 11 |
Replicates are grouped (i.e. A1, B1, C1, A2, B2, C2) when letters denote |
12 |
-conditions and numbers the replicates. In case of `isStat=F`, you need a |
|
12 |
+conditions and numbers the replicates. In case of `isStat=FALSE`, you need a |
|
13 | 13 |
last column for the standard deviations} |
14 | 14 |
|
15 | 15 |
\item{NumReps}{Number replicates in the data} |
... | ... |
@@ -24,9 +24,8 @@ functional classes. BMC bioinformatics 7, 397 (2006). |
24 | 24 |
} |
25 | 25 |
\examples{ |
26 | 26 |
# Run enrichment analysis |
27 |
-library(clusterProfiler) |
|
28 |
-data(gcSample) |
|
29 |
-xx <- compareCluster(gcSample, fun="enrichKEGG", |
|
27 |
+data(gcSample, package="clusterProfiler") |
|
28 |
+xx <- clusterProfiler::compareCluster(gcSample, fun="enrichKEGG", |
|
30 | 29 |
organism="hsa", pvalueCutoff=0.05) |
31 | 30 |
# Generate random list from gcSample |
32 | 31 |
rand_ids <- lapply(gcSample, function(x) sample(unlist(gcSample), 200)) |
... | ... |
@@ -11,7 +11,7 @@ estimClust.plot(ClustInd) |
11 | 11 |
} |
12 | 12 |
\value{ |
13 | 13 |
Multiple panels showing expression profiles of clustered features |
14 |
-passing the min.mem threshold |
|
14 |
+passing the minMem threshold |
|
15 | 15 |
} |
16 | 16 |
\description{ |
17 | 17 |
This function visualizes the output from estimClustNumber, and there |
... | ... |
@@ -9,8 +9,8 @@ mfuzz.plot( |
9 | 9 |
cl, |
10 | 10 |
mfrow = c(1, 1), |
11 | 11 |
colo, |
12 |
- min.mem = 0, |
|
13 |
- time.labels, |
|
12 |
+ minMem = 0, |
|
13 |
+ timeLabels, |
|
14 | 14 |
filename = NA, |
15 | 15 |
xlab = "Time", |
16 | 16 |
ylab = "Expression changes" |
... | ... |
@@ -27,10 +27,10 @@ panels are distributed in the plot} |
27 | 27 |
|
28 | 28 |
\item{colo}{color map to be used (can be missing)} |
29 | 29 |
|
30 |
-\item{min.mem}{filter for showing only features with a higher membership |
|
30 |
+\item{minMem}{filter for showing only features with a higher membership |
|
31 | 31 |
values than this value} |
32 | 32 |
|
33 |
-\item{time.labels}{alternative labels for different conditions} |
|
33 |
+\item{timeLabels}{alternative labels for different conditions} |
|
34 | 34 |
|
35 | 35 |
\item{filename}{for writing into pdf. Will write on screen when using NA} |
36 | 36 |
|
... | ... |
@@ -40,7 +40,7 @@ values than this value} |
40 | 40 |
} |
41 | 41 |
\value{ |
42 | 42 |
Multiple panels showing expression profiles of clustered features |
43 |
-passing the min.mem threshold |
|
43 |
+passing the minMem threshold |
|
44 | 44 |
} |
45 | 45 |
\description{ |
46 | 46 |
This function visualizes the clustered quantitative profiles in multiple |
... | ... |
@@ -52,7 +52,7 @@ labels and color maps. The code is adopted from the MFuzz package. |
52 | 52 |
data <- matrix(rnorm(seq_len(5000)), nrow=500) |
53 | 53 |
# Run clustering |
54 | 54 |
clres <- vsclust_algorithm(data, centers=2, m=1.5) |
55 |
-mfuzz.plot(data, clres, mfrow=c(2,3), min.mem=0.0) |
|
55 |
+mfuzz.plot(data, clres, mfrow=c(2,3), minMem=0.0) |
|
56 | 56 |
} |
57 | 57 |
\references{ |
58 | 58 |
Schwaemmle V, Jensen ON. VSClust: feature-based variance-sensitive clustering |
... | ... |
@@ -7,11 +7,11 @@ |
7 | 7 |
vsclust_algorithm( |
8 | 8 |
x, |
9 | 9 |
centers, |
10 |
- iter.max = 100, |
|
10 |
+ iterMax = 100, |
|
11 | 11 |
verbose = FALSE, |
12 | 12 |
dist = "euclidean", |
13 | 13 |
m = 2, |
14 |
- rate.par = NULL, |
|
14 |
+ ratePar = NULL, |
|
15 | 15 |
weights = 1, |
16 | 16 |
control = list() |
17 | 17 |
) |
... | ... |
@@ -22,7 +22,7 @@ vsclust_algorithm( |
22 | 22 |
\item{centers}{Either numeric for number of clusters or numeric matrix with |
23 | 23 |
center coordinates} |
24 | 24 |
|
25 |
-\item{iter.max}{Numeric for maximum number of iterations} |
|
25 |
+\item{iterMax}{Numeric for maximum number of iterations} |
|
26 | 26 |
|
27 | 27 |
\item{verbose}{Verbose information} |
28 | 28 |
|
... | ... |
@@ -32,7 +32,7 @@ center coordinates} |
32 | 32 |
\item{m}{Fuzzifier value: numeric or vector of length equal to number of rows |
33 | 33 |
of x} |
34 | 34 |
|
35 |
-\item{rate.par}{(experimental) numeric value for punishing missing values} |
|
35 |
+\item{ratePar}{(experimental) numeric value for punishing missing values} |
|
36 | 36 |
|
37 | 37 |
\item{weights}{numeric or vector of length equal to number of rows of x} |
38 | 38 |
|
... | ... |
@@ -326,7 +326,10 @@ double c_plusplus_means(const NumericMatrix & feature_mat, NumericMatrix & cente |
326 | 326 |
NumericVector & weight, NumericVector & fuzz, int dist_metric, int iter_max, double rel_tol, |
327 | 327 |
int verbose, NumericMatrix & membership_mat, double ermin, IntegerVector & iter, double missing_value = NA_REAL, |
328 | 328 |
double weight_missing = 0) { |
329 |
- |
|
329 |
+ |
|
330 |
+ // check for user interrupts |
|
331 |
+ Rcpp::checkUserInterrupt(); |
|
332 |
+ |
|
330 | 333 |
int nr_objects = feature_mat.nrow(); |
331 | 334 |
int nr_centers = centers.nrow(); |
332 | 335 |
// for symmetric matrix |
... | ... |
@@ -383,4 +386,4 @@ double c_plusplus_means(const NumericMatrix & feature_mat, NumericMatrix & cente |
383 | 386 |
|
384 | 387 |
ermin = new_fitness; |
385 | 388 |
return ermin; |
386 |
-} |
|
387 | 389 |
\ No newline at end of file |
390 |
+} |