asmagen / robustSingleCell

Robust single cell clustering and comparison of population compositions across tissues and experimental models via similarity analysis.
http://dx.doi.org/10.1016/j.celrep.2019.10.131
MIT License
13 stars 2 forks source link

read.preclustered.datasets: bug with the experiments variable #23

Closed asmagen closed 5 years ago

asmagen commented 5 years ago

read.preclustered.datasets has a bug with the experiments variable - see example below where only the Meninges cells have the replicate info coded in the experiments variable whereas Spleen cells have NA

> combined <- read.preclustered.datasets(combined)
Computing
Loading /data/magenay/ILC/Meninges_Exp.1/not.regressed 

combined$experiments
Loading /data/magenay/ILC/Meninges_Exp.2/not.regressed 

Loading /data/magenay/ILC/Spleen_Exp.1/not.regressed 

Loading /data/magenay/ILC/Spleen_Exp.2/not.regressed 

dim(merged.normalized)
[1] 31053 17214
merged.dataset.labels
NKp46+ Meninges cells (Replicate 1) NKp46+ Meninges cells (Replicate 2)   NKp46+ Spleen cells (Replicate 1)   NKp46+ Spleen cells (Replicate 2) 
                               2559                                4825                                4378                                5452 
merged.origins
NKp46+ Meninges cells   NKp46+ Spleen cells 
                 7384                  9830 
merged.experiments
Replicate 1 Replicate 2 
       2559        4825 
merged.clustering
   1    2    3    4    5    6    7    8    9   10   11   12   13   14   15   16   17   18   19   20   21 
 389  627  475  571  497 1408 1178  768  939  532  231 1167  878 1086 1016  455 1262 1008 1025  502 1200 
merged.dataset.ids
Meninges_Exp.1 Meninges_Exp.2   Spleen_Exp.1   Spleen_Exp.2 
          2559           4825           4378           5452
asmagen commented 5 years ago

Need to remove unique from

environment$datasets <- unique(environment$datasets)
environment$experiments <- unique(environment$experiments)