Skip to content

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

@DarioS

Description

@DarioS

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions