Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cell-cell Interaction Fails if Any Sample Lacks Any Cell Type #12

Open
DarioS opened this issue Mar 15, 2024 · 0 comments
Open

Cell-cell Interaction Fails if Any Sample Lacks Any Cell Type #12

DarioS opened this issue Mar 15, 2024 · 0 comments

Comments

@DarioS
Copy link
Member

DarioS commented Mar 15, 2024

Some samples may only have a subset of cell types. For example, c.names has 5 levels but cluster has 4 distinct numeric values.

Browse[2]> celltype <- as.factor(alldata$celltype[alldata$sample == x]) # Code from helper_CCI in helper_CCI.R
Browse[2]> table(celltype)
celltype
 dCAF  iCAF  mCAF tpCAF  vCAF 
  202   492   242   737     0
Browse[2]> celltype_numeric <- as.numeric(celltype)  # Code from helper_CCI in helper_CCI.R
Browse[2]> table(celltype_numeric)
celltype_numeric
  1   2   3   4 
202 492 242 737 
Browse[2]> signal <- cell_signaling(data = data_dataframe,  genes = rownames(data_dataframe), cluster = celltype_numeric,
                                    c.names = levels(celltype), write = FALSE)  # Code from helper_CCI in helper_CCI.R
Error in SingleCellSignalR::cell_signaling(data = data_dataframe, genes = rownames(data_dataframe),  : 
  The length of c.names must be equal to the number of clusters and must contain no duplicates.

scFeatures should gracefully drop empty factor levels like aFactor <- droplevels(aFactor) before cell_signaling function call.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant