kharchenkolab / scITD

Single-Cell Analysis of Inter-Individual Variability by Interpretable Tensor Decomposition
54 stars 2 forks source link

Error on running form_tensor: "incorrect number of dimensions" #23

Open SamuelCWJ opened 1 year ago

SamuelCWJ commented 1 year ago

Hi!

Apologies in advance if this turns out to be a silly error... But I can't seem to solve it. Really appreciate some help if possible!

I'm new to this package, and I'm trying to run form_tensor on my seurat object.

I first created a project container as described in the walkthrough. pbmc_container <- make_new_container(seurat_obj = Seurat_Obj, params=param_list, label_donor_sex = TRUE)

Then I tried form_tensor without changing any of the parameters pbmc_container <- form_tensor(pbmc_container, donor_min_cells=5, norm_method='trim', scale_factor=10000, vargenes_method='norm_var_pvals', vargenes_thresh=.1, scale_var = TRUE, var_scale_power = 2)

And I keep getting this error at the cleaning data step: parsing data matrix by cell/tissue type... cleaning data... Error in count_data[, which(metadata$donors %in% donors_use)] : incorrect number of dimensions

I have about 140 samples which I labelled as donors, and about 170 cell types. Some donors have less than 5 cells in a cell type, but all of them have more than 5 cells in total. I've tried changing the dataframe from factor to character, but it doesn't work. Any tips would be much appreciated!

Thank you!

Samuel

PS: I am able to run the code fine using your example data, so I'm not sure what the issue is with my own