smorabit / hdWGCNA

High dimensional weighted gene co-expression network analysis
https://smorabit.github.io/hdWGCNA/
Other
316 stars 31 forks source link

Load a previously generated TOM into a seurat object via the TOM.rda file? #189

Closed rdalbanus closed 5 months ago

rdalbanus commented 5 months ago

I've been very excited about using this package since Dr. Swarup mentioned your work-in-progress in a talk a while back. Thank you for putting it out!

The question title says everything - I had a session that crashed on me, and I'm wondering if there's a way to load an existing TOM file into a Seurat object (i.e., skip the ConstructNetwork step). If not, I'm curious about why the TOM is saved to disk besides saving memory.

I hope I didn't miss anything obvious in the documentation.

Cheers

smorabit commented 5 months ago

Hi,

If your session crashed before you could save it, I would suggest simply running it again.

I'm curious about why the TOM is saved to disk besides saving memory.

The reason is just to save memory. The TOM is loaded back into memory for certain functions when it is needed.

rdalbanus commented 5 months ago

Thanks for the quick reply and clarification! You might consider adding this functionality for situations where one calculates a TOM on a subset of the data (e.g. controls) and applies it to the rest (e.g. cases). I don't think there's a way to do this right now without manually populating the @misc slot with the data of interest.

smorabit commented 5 months ago

You might consider adding this functionality for situations where one calculates a TOM on a subset of the data (e.g. controls) and applies it to the rest (e.g. cases).

This is already possible with hdWGCNA if you tell SetDatExpr to only use the controls. In the future, please only discuss a single issue (or closely related topics) in a GitHub issue so the information is better organized for other users! Happy to elaborate if you want to open a new issue about it.