immunogenomics / symphony

Efficient and precise single-cell reference atlas mapping with Symphony
GNU General Public License v3.0
100 stars 22 forks source link

Error in t.default(obj@reductions$harmony@misc$R) : argument is not a matrix #10

Closed dcruz5h closed 3 years ago

dcruz5h commented 3 years ago

Thank you, I recently installed symphony and I'm trying it with a reference Seurat object composed of four integrated samples with harmony. After running buildReferenceFromSeurat, it gives an error: Error in t.default(obj@reductions$harmony@misc$R) : argument is not a matrix

What suppose to be stored in misc slot of my harmony metadata ? what is R in this case ? Thank you !

joycekang commented 3 years ago

Hi @dcruz5h,

R represents the assignment of cells to soft clusters in the Harmony model, which is used to perform the integration of the reference. The obj@reductions$harmony@misc$R should hold a matrix of dimensions n x k where n is the number of cells and k is the number of Harmony soft cluster centroids (default is 100). You should not need to calculate or set R yourself - it should have been calculated during the Harmony integration step and saved already in to the @misc$R slot.

It's hard to debug what might be going on in your case - are you able to run the Seurat.ipynb notebook from beginning to end? Do you have the most recent version of Harmony? Is your obj@reductions$harmony@misc$R slot empty or does it contain something that is not a matrix?

dcruz5h commented 3 years ago

I do have the most recent version of harmony, and when I run runHarmony ( a harmony function) I get a beautiful integrated object but the obj@reductions$harmony@misc$R slot is empty. If I run RunHarmony.Seurat ( from utils_seurat.R), I get a obj@reductions$harmony@misc$R with a matrix. Strange, I wouldn't know why, nonetheless I managed to run symphony on my samples. :)

NK-HD commented 2 years ago

Hey @joycekang ! I have a similar issue, but I would like to avoid having to (re)run the RunHarmony.Seurat function, since I already did alot of downstream analysis on this object and would like to keep the identical clusters.

Is there a way to get/calculate this data of of an existing object processed with the default RunHarmony function?