statOmics / tradeSeq

TRAjectory-based Differential Expression analysis for SEQuencing data
Other
238 stars 27 forks source link

earlyDEtest interpretation #267

Open ishars00 opened 8 hours ago

ishars00 commented 8 hours ago

Hey tradeSeq developers and users,

I'm currently using the package to understand differential gene expression between nodes and I am having trouble understanding the output. I'm interested in the RASC knot and which genes are causing the cells to differentiate into the ABI2 and distal_secretory clusters. I'm including the results from the earlyDEtest for knots 3 and 4 as an example. Shouldn't there be no difference between lineage 1 and 2 since they both go to the distal secretory cluster? Shouldn't I see the same/similar results when comparing lineage 1 vs. 3 and 2 vs. 3? Any guidance/ advice would be very much appreciated! Also, please let me know if I need to correct something in my workflow.

Thank you!!

integrated_multiome[["main.cluster"]]<-Idents(integrated_multiome)
data<-integrated_multiome

dimred <- data@reductions$umap@cell.embeddings
clustering <- data$main.cluster
counts <- GetAssayData(data, assay = "RNA", layer = "counts")
counts <- as.matrix(counts)

set.seed(1)
lineages <- getLineages(data = dimred, clusterLabels = clustering)

lineages<-as.SlingshotDataSet(lineages)

pal <- c(RColorBrewer::brewer.pal(9, "Set1"), RColorBrewer::brewer.pal(8, "Set2"))
par(mfrow = c(1, 2))

plot(dimred[, 1:2], col = pal[clustering], cex = 0.5, pch = 16)
for (i in levels(clustering)) {
    text(mean(dimred[clustering == i, 1]), mean(dimred[clustering == i, 2]), labels = i, font = 2)
}
plot(dimred, col = pal[clustering], cex = 0.5, pch = 16)
lines(lineages, lwd = 3, col = "black")

curves <- getCurves(lineages, approx_points = 300, thresh = 0.01, stretch = 0.8, allow.breaks = FALSE, shrink = 0.99)
curves<-as.SlingshotDataSet(curves)

sce <- fitGAM(counts = as.matrix(counts), sds = curves)

RASC<-earlyDETest(sce, knots= c(3,4), pairwise= TRUE)

Rplot

Screenshot 2024-10-17 at 11 56 15 AM Screenshot 2024-10-17 at 11 57 42 AM
ishars00 commented 5 hours ago

I'm also including the curves, which are slightly different from the lineages in terms of the location of the knots. Is this why I have different values between lineages 1 and 2 for knots 3 and 4?

Rplot01