Open ivichadriana opened 2 months ago
I think the function works under the assumption of multiple samples being used. Can SECRET be used without multiple samples as reference?
Hi Adriana,
The problem is not due to a mismatch in the column name by grep
because grep
is performing a substring match in the last step. It occurs because you only have one sample, so the grep
step is able to find only one column for each cell type. As a result, when you use apply()
, your input (y
) becomes a numeric vector, which causes the error.
To handle this case with only one sample, you can modify the code by skipping the last step. The final step is intended to calculate the average counts across all samples. However, since you only have one sample, averaging isn't necessary. Therefore, you can simply use scref
as your final reference data.
Hope this helps.
Hi! I am trying to use SECRET, but there is an error in the function scRefer to make the cell reference.
The issue seems to be that there is a mismatch between the ct_id values and how the column names are structured in meanCount. Specifically, ct_id contains just the cell type names, while colnames(meanCount) combines the sample ID and cell type names (e.g., "Sample1_mesothelial.cell"). Since grep cannot find an exact match for just the cell type name, it returns no results, making the matrix y empty and causing the error:
Error in apply(y, 1, mean, na.rm = TRUE) : dim(X) must have a positive length
Steps to reproduce:
Please let me know if I am misunderstanding the methodology. Thank you!