welch-lab / liger

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

minor bug in scaleNotCenter #236

Closed emmanuelaaaaa closed 3 years ago

emmanuelaaaaa commented 3 years ago

Hello,

I think there is a minor bug in the way that scaleNotCenter is reporting the removed cells (rliger_1.0.0):

liger_integrated <- scaleNotCenter(liger_integrated) 
Removing 11 genes not expressing in RNA.
GGACATTTCAGTGCAT-1-gPlexJ3GTAACTGTCTGTCTCG-1-gPlexB3CGTGAGCTCCCATTTA-1-gPlexB7CCTTCCCAGTATTGGA-1-gPlexB3ACTGAGTGTAGATTAG-1-gPlexE4GATCTAGCAAGGCTCC-1-gPlexA2CTAAGACCACGTTGGC-1-gPlexH5CACTCCAGTTGATTGC-1-gPlexF5GTTTCTAGTCCCGACA-1-gPlexF6TCATTACTCACCTCGT-1-gPlexF6AGCGTATCAGTGAGTG-1-gPlexC1

The output says that 11 genes are removed, when clearly it's removing cells, not genes. Could you please also clarify why this step is done at this stage by default and not when the liger object is created? I use seuratToLiger to import, it removes certain genes that are not expressing in RNA, but it doesn't seem to filter the cells at that stage. Many thanks for putting this great tool out there and for your time in answering this!

Best, Emma

cgao90 commented 3 years ago

Hi Emma,

Thanks for trying out LIGER and sorry about the confusion. It indeed removes the cells, but it outputs the misleading message. We will fix that shortly. When creating the liger object, the cells not expressing any genes and the genes not expressed in any cells actually get filtered out by default. As a result, this step (remove missing observation) in scaleNotCenter usually have no impact on the data. However, if the object is imported from Seurat, which does not such cells, will cause problem in steps such as optimizeALS, then it becomes essential to remove them at the end of scaleNotCenter.

Best, Chao

emmanuelaaaaa commented 3 years ago

Hi Chao,

Great, thanks for the clarification!

Best, Emma