HectorRDB/condiments

Provide reordered counts matrix after "condiments::slingshot_conditions" for TradeSeq "fitGAM"

Closed this issue · 4 comments

Hi, first of all, I wanted to thank the authors of this package for implementing this utility.

I am running an analysis in which I want to examine two lineages in two separate conditions. I apply the condiments pipeline, and when performing the differential expression analysis I have to provide the "counts" matrix.

I have been providng the count matrix from the original experiment, but the order of the cells when the lineages are split by conditions is changed. Should I reorder the count matrix to match the order of the cells in the "sds" which is merged, or should I give the matrix without reordering.

I have observed that the results are dramatically different depending on the matrix you provide.

Thanks in advance

Hi,
The results should not be changing based on the order.
Just to make I understand, you have two lineages, each appearing on just one condition ? Or two lineages, each having a mixture of cells from either conditions.
Could you also share the code that leads to this error ?

Hi,
My situation is that I have two lineages computed with slingshot, with cells appearing on multiple conditions. I split them with condiments into four lineages, one for lineage and for condition. The lineages initiate from the same cluster so I'm guessing there could be shared cells in the starting times.

sds_conditions <- condiments::slingshot_conditions(sds=sds, conditions=sds$Condition, approx_points=FALSE, extend="n", reweight=FALSE, reassign = FALSE)

Where I think the actual problem comes is in the following step of merging the lists:

sds_conditions$condition_id <- names(sds_conditions)

sds_conditions$mapping <- matrix(rep(1:2, each = 2), nrow = 2, ncol = 2, byrow = TRUE)

sds_conditions_merge <- do.call(merge_sds, sds_conditions)

I have the seurat object from which the slingshot datasets are originated, and while the "not-split" slingshot meets: all(sds@NAMES == colnames(seurat_object)) as True, when I do all(cellnames(sds_conditions_merge) == colnames(seurat_object)) it is False.

Ok, I think I understand. A few points then:

  • First, we usually do not recommend splitting unless there is a clear difference (via the topologyTest).
  • Second, if you indeed fit one trajectory per condition, the cells will indeed be reordered, and you should change the count matrix accordingly.

Hello. I proceeded according to the differential tests (the results from topologyTest) and determined the necessity to split by conditions. I reordered the data and the analysis seems to make sense.

Thanks for your attention!