Closed alex-l-kong closed 3 years ago
Hi, Version 1.4.0 is older than 1.19.4 because 4 < 19 Here are my current versions, and I think they are the latest. Check https://bioconductor.org/packages/release/bioc/html/FlowSOM.html.
> packageVersion("FlowSOM")
[1] ‘1.22.0’
> BiocManager::version()
[1] ‘3.12’
MapDataToCodes() is currently exported and could be used in your code. Your strategy is correct. Best.
@SamGG thanks for the clarification on the version numbers.
When I try to call MapDataToCodes
, I still get the error 'MapDataFromCodes' is not found
with both versions 1.22.0 and 1.14.1. I'm calling it as such:
library(FlowSOM)
...
som_results <- SOM(data=as.matrix(pixelMatData_subset))
clusters <- MapDataToCodes(som_results$codes, pixelMatData)
Am I missing anything in the call to MapDataToCodes
?
I was wrong, the function is not exported. So the call must be prefixed to access the function, even if the library is already loaded.
clusters <- FlowSOM:::MapDataToCodes(som_results$codes, pixelMatData)
The results is a matrix with the first column being the nearest node id and the second column the distance to it. Be sure to set a name to each column of pixelMatData using colnames function. Best.
@SamGG thanks for your help!
Hi @alex-l-kong ,
Next to the solution provided by @SamGG, would the NewData() function (which is exported by FlowSOM, and the one which uses "MapDataToCodes" internally) be of interest for your question? If not, could you shortly explain if there would be a way we could extend this function to make it suit your needs?
All the best, Sofie
@SofieVG Sorry, I forgot this nice function. Thanks.
@SofieVG MapDataToCodes
worked quite nicely for us, but NewData
looks like it could provide even more information (and not just a new mapping). Thanks for the recommendation!
I'm trying to use FlowSOM to train on a subset of our data and apply the trained weights to cluster the entire dataset. The default settings of the FlowSOM algorithm, however, seem to only support training and clustering on the entire dataset with no intuitive way to allow for subsetting.
Looking at the source code and documentation, it looks like this can be done by passing the subsetted data into
SOM
, then passing the trained weights and the entire dataset intoMapDataToCodes
. However, it seems like we would need version 1.4.0 of the library to do so according to RDocumentation, and BiocManager only installs 1.19.4. I tried usingdevtools
(as outlined in the repo) to install the latest version from GitHub, but I run into this error:Is there an easy fix to this, and if not, how can I download version 1.4.0 as outlined in the RDocumentation page so I can access
MapDataToCodes
?