hansenlab / tricycle

23 stars 8 forks source link

Fix "NA" level in .CCStage function #1

Closed lianos closed 3 years ago

lianos commented 3 years ago

Adding an "NA" level to the outgoing cc.v factor vector at the end of the .CCstate() function here doesn't have the outcome that I think is intended.

You are adding a new "character NA" level that is different than the NA_character_ values that the output cc.v vector is initialized with and always has 0 cells assigned to it.

For instance, tabulating the cell cycle stage prediction in the neurosphere_example object gives:

R> table(neurosphere_example$CCStage, useNA = "always")

G1.S    S   G2 G2.M M.G1   NA <NA> 
  66   25   20   29   61    0  199 

Either (1) don't add the "NA" level on the way out of the function, or use (2) "NA" as the value for cells that aren't assigned a stage.

Also, what should we infer the cell cycle for the cells assigned NA to be, are these just hanging out in G0? ... but ... I guess if that were the case, the NA values would have been labelled "G0" :-)

Thanks!

sjczheng commented 3 years ago

Hi Steve, Thanks for this. I forgot to remove fix that when I changed the assignment type back and forth. It is now fixed.

Per your question about cells with NA assignments, the answer is no. We are not sure which stage the cell should be assigned to. G0 is not the default stage. So we cannot just assign the uncertain cells to G1/G0. Also, note that we didn't develop this stage assignment. It is a faster and less stringent re-implementation compared to the original function. The NA issue is the biggest issue of this stage assignment method.

Best, Charles