welch-lab / liger

R package for integrating and analyzing multiple single-cell datasets
GNU General Public License v3.0
389 stars 78 forks source link

Fix subsetLiger() cell.data copying when subsetting before clustering. #186

Closed derpylz closed 3 years ago

derpylz commented 4 years ago

The current implementation of subsetLiger() deletes everything in the cell.data slot when subsetting a liger object that has no data in the clusters slot.

This is because of the following line: https://github.com/MacoskoLab/liger/blob/2532a37e0af6b5a13f821c7e8d2cdc9945fcdf9e/R/liger.R#L4894 It also causes the show method to report "0 total cells" for the subset.

This can be fixed by getting the cell names for the subsetting of the cell data e.g. from the raw.data slot .