You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: R/delineate_with_similarity.R
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@
27
27
#' 2. It uses base R functions to reduce the dependencies
28
28
#'
29
29
#'
30
-
#' @seealso For similarity metrics: [`coop::cosine`](https://rdrr.io/cran/coop/man/cosine.html), [stats::cor], [`Hmisc::rcorr`](https://rdrr.io/cran/Hmisc/man/rcorr.html). For using taxonomic identifications for clusters : [delineate_with_identification]. For further analyses: [set_reference_spectra].
30
+
#' @seealso For similarity metrics: [`coop::tcosine`](https://rdrr.io/cran/coop/man/cosine.html), [stats::cor], [`Hmisc::rcorr`](https://rdrr.io/cran/Hmisc/man/rcorr.html). For using taxonomic identifications for clusters : [delineate_with_identification]. For further analyses: [set_reference_spectra].
31
31
#' @export
32
32
#' @examples
33
33
#' # Toy similarity matrix between the six example spectra of
Copy file name to clipboardExpand all lines: dev/dereplicate-spectra.Rmd
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -362,7 +362,7 @@ Once all the batches of spectra have been processed together, we can use a dista
362
362
363
363
While we do not provide specific functions to generate the similarity matrix, we illustrate below how it can be easily computed.
364
364
Note that the feature matrix from [`merge_processed_spectra()`](https://clavellab.github.io/maldipickr/reference/merge_processed_spectra.html) has spectra as rows and peaks values as columns.
365
-
So to get a similarity matrix between spectra, the feature matrix must be transposed before cosine computation.
365
+
So to get a similarity matrix between spectra, either the feature matrix must be transposed or a dedicated function must be used.
366
366
367
367
```{r similarity, eval=FALSE}
368
368
# A. Compute the similarity matrix on the transposed feature matrix
# B.2 Compute the similarity matrix on the transposed feature matrix
376
-
sim_matrix <- coop::cosine(t(fm))
375
+
# B.2 Compute the similarity matrix on the rows of the feature matrix
376
+
sim_matrix <- coop::tcosine(fm)
377
377
```
378
378
379
379
# Delineate clusters of spectra
@@ -418,7 +418,7 @@ This representation allows to infer the clusters easily. A table summarizes for
418
418
#' 2. It uses base R functions to reduce the dependencies
419
419
#'
420
420
#'
421
-
#' @seealso For similarity metrics: [`coop::cosine`](https://rdrr.io/cran/coop/man/cosine.html), [stats::cor], [`Hmisc::rcorr`](https://rdrr.io/cran/Hmisc/man/rcorr.html). For using taxonomic identifications for clusters : [delineate_with_identification]. For further analyses: [set_reference_spectra].
421
+
#' @seealso For similarity metrics: [`coop::tcosine`](https://rdrr.io/cran/coop/man/cosine.html), [stats::cor], [`Hmisc::rcorr`](https://rdrr.io/cran/Hmisc/man/rcorr.html). For using taxonomic identifications for clusters : [delineate_with_identification]. For further analyses: [set_reference_spectra].
Copy file name to clipboardExpand all lines: vignettes/dereplicate-bruker-maldi-biotyper-spectra.Rmd
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -120,7 +120,7 @@ Once all the batches of spectra have been processed together, we can use a dista
120
120
121
121
While we do not provide specific functions to generate the similarity matrix, we illustrate below how it can be easily computed.
122
122
Note that the feature matrix from [`merge_processed_spectra()`](https://clavellab.github.io/maldipickr/reference/merge_processed_spectra.html) has spectra as rows and peaks values as columns.
123
-
So to get a similarity matrix between spectra, the feature matrix must be transposed before cosine computation.
123
+
So to get a similarity matrix between spectra, either the feature matrix must be transposed or a dedicated function must be used.
0 commit comments