meichendong / SCDC

SCDC
42 stars 9 forks source link

getCPM0 creates issue with only one bulk sample #27

Closed PelzKo closed 2 years ago

PelzKo commented 2 years ago

When running SCDC (specifically the function SCDC_prop) with just one bulk sample, it fails at this line: https://github.com/meichendong/SCDC/blob/master/R/Deconvolution.R#L646 as yhat does not contain any columnnames. This is due to this line: https://github.com/meichendong/SCDC/blob/master/R/Deconvolution.R#L584 where, if just one bulk sample is supplies, it is treated as a vector and the column name is lost.

Is this intentional? Can SCDC just be used with more than one sample or could a simple ,drop=FALSE solve the problem?

meichendong commented 2 years ago

Hi @PelzKo , thanks for reporting the issue. This was not intentional. Your suggestion should work and I updated the function.