cole-trapnell-lab / monocle-release

279 stars 116 forks source link

Error in State %in% root_states: #181

Open weijy026a opened 6 years ago

weijy026a commented 6 years ago

When use the function plot_complex_cell_trajectory in win10 platform, it will report this error:

Error in State %in% root_states:  can not  find object'State'
Traceback:

1. plot_complex_cell_trajectory(valid_subset_GSE72857_cds2, color_by = "State", 
 .     show_branch_points = T, cell_size = 0.5, cell_link_size = 0.3, 
 .     root_states = c(10))
2. row.names(subset(pData(cds), State %in% root_states))
3. subset(pData(cds), State %in% root_states)
4. subset.data.frame(pData(cds), State %in% root_states)
5. eval(e, x, parent.frame())
6. eval(e, x, parent.frame())
7. State %in% root_states
Xiaojieqiu commented 6 years ago

Hi @weijy026a from the error message, it implies that your data doesn't include the State column in the pData attribute of the cell cds object valid_subset_GSE72857_cds2. This happens if you didn't run orderCells function and thus no State is assigned to each cell. Please run that first to fix the issue. Also, I am assuming you are using Monocle 2, but if you are using the recent released monocle 3 alpha, that could be slightly different. So let me know if you are not using monocle 2...

In addition the valid_subset_GSE72857_cds2 seems to be the same name we used from the notebook (https://github.com/cole-trapnell-lab/monocle2-rge-paper/blob/master/Olsson_dataset_analysis_final.ipynb). So I am not sure you are using that dataset or not (but I recommend you always use a different name for your own data). The notebook is definitively reproducible so please start from scratch to make sure you didn't forget anything...