SofieVG / FlowSOM

Using self-organizing maps for visualization and interpretation of cytometry data
61 stars 26 forks source link

Calling FlowSOM:::MapDataToCodes produces a segmentation fault #45

Closed alex-l-kong closed 3 years ago

alex-l-kong commented 3 years ago

I'm attempting to use a weights matrix to assign cluster labels to a new dataset, but when I do so, I get this error:

 *** caught segfault ***
address 0x7fd2240f5ea8, cause 'memory not mapped'

Traceback:
 1: FlowSOM:::MapDataToCodes(somWeights, fovPixelData[, markers])

somWeights contains a 10x10 matrix computed by SOM. fovPixelData also contains a numeric matrix of about 1M rows.

Some more information:

SofieVG commented 3 years ago

Hi,

I haven't encountered this issue myself, and I think it might be related to the special file formats you are using. Did you try to use a dummy matrix for first somWeights and then fovPixelData to try to determine which one is causing the issue? Memory faults could be related to issues with hdf5 as well, even though this was generated by SOM originally. If you do not manage to find a solution, would you be able to provide a reproducible example?

All the best, Sofie

On Thu, 11 Feb 2021 at 01:35, alex-l-kong notifications@github.com wrote:

I'm attempting to use a weights matrix to assign cluster labels to a new dataset, but when I do so, I get this error:

caught segfault address 0x7fd2240f5ea8, cause 'memory not mapped'

Traceback: 1: FlowSOM:::MapDataToCodes(somWeights, fovPixelData[, markers])

somWeights contains a 10x10 matrix computed by SOM. fovPixelData also contains a numeric matrix of about 1M rows.

Some more information:

  • fovPixelData is initially read in as a tibble from a .feather file using arrow::read_feather. It needs to be stored this way for Python data frame interoperability. The same segfaults come up whether or not I coerce fovPixelData to a matrix or not
  • somWeights is read in from an intermediate HDF5 file using h5read from rhdf5.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/SofieVG/FlowSOM/issues/45, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOS724JSE5SQPCXXUQ36OTS6MQ6VANCNFSM4XN55SHA .

SamGG commented 3 years ago

Hi, somWeights should be a numerical matrix, with named columns. The names must be found in fovPixelData[, markers]. Check this with head(), is.numeric() and class() on both arrays. My two cents.

alex-l-kong commented 3 years ago

@SofieVG @SamGG thanks for the response, it turns out that occasionally, somWeights got set to NULL in our pipeline. It's been patched and it's working perfectly now!