hms-dbmi / scde

R package for analyzing single-cell RNA-seq data
http://pklab.med.harvard.edu/scde
Other
170 stars 64 forks source link

Problem with applying scde to data with more than 2 groups #28

Closed ulah closed 8 years ago

ulah commented 8 years ago

Sry, wasn't an issue, I just misunderstood the vignette ;) Can be deleted...

JEFworks commented 8 years ago

It looks like for your grouping vector, you are setting some cells to NA then converting that vector into a factor so ‘NA’ is being treated as a factor grouping. You will need to convert to a factor first, then set cells to NA such that levels(grouping_factor) only has 2 levels.

ex.

> groups <- factor(gsub("(MEF|ESC).*", "\\1", rownames(o.ifm)), levels  =  c("ESC", "MEF"))
> names(groups) <- row.names(o.ifm)
> 
> groups
ESC_10 ESC_11 ESC_12 ESC_13 ESC_14 ESC_15 ESC_16 ESC_17 ESC_18 ESC_19  ESC_1 ESC_20 
   ESC    ESC    ESC    ESC    ESC    ESC    ESC    ESC    ESC    ESC    ESC    ESC 
ESC_21 ESC_22 ESC_23 ESC_24 ESC_25 ESC_26 ESC_27 ESC_28 MEF_49 MEF_50 MEF_51 MEF_52 
   ESC    ESC    ESC    ESC    ESC    ESC    ESC    ESC    MEF    MEF    MEF    MEF 
MEF_53 MEF_54 MEF_55 MEF_56 MEF_57 MEF_58 MEF_59 MEF_60 MEF_61 MEF_62 MEF_63 MEF_64 
   MEF    MEF    MEF    MEF    MEF    MEF    MEF    MEF    MEF    MEF    MEF    MEF 
MEF_65 MEF_66 MEF_67 MEF_68 
   MEF    MEF    MEF    MEF 
Levels: ESC MEF
> groups[1] <- NA
> groups
ESC_10 ESC_11 ESC_12 ESC_13 ESC_14 ESC_15 ESC_16 ESC_17 ESC_18 ESC_19  ESC_1 ESC_20 
  <NA>    ESC    ESC    ESC    ESC    ESC    ESC    ESC    ESC    ESC    ESC    ESC 
ESC_21 ESC_22 ESC_23 ESC_24 ESC_25 ESC_26 ESC_27 ESC_28 MEF_49 MEF_50 MEF_51 MEF_52 
   ESC    ESC    ESC    ESC    ESC    ESC    ESC    ESC    MEF    MEF    MEF    MEF 
MEF_53 MEF_54 MEF_55 MEF_56 MEF_57 MEF_58 MEF_59 MEF_60 MEF_61 MEF_62 MEF_63 MEF_64 
   MEF    MEF    MEF    MEF    MEF    MEF    MEF    MEF    MEF    MEF    MEF    MEF 
MEF_65 MEF_66 MEF_67 MEF_68 
   MEF    MEF    MEF    MEF 
Levels: ESC MEF
ulah commented 8 years ago

yes, that was the problem, thanks!