cole-trapnell-lab / monocle-release

280 stars 116 forks source link

Differential expression in a cell type subset #112

Open WhitneyFA opened 6 years ago

WhitneyFA commented 6 years ago

Hello,

I am trying to run a specific differential expression analysis on a 10X data set that I can't seem to get working. I have 4 samples that I have been assigned to 2 genotypes "WT" and "KO". All samples are a combination of 2 main cell types which I have classified in a CellTypeHierarchy, "Cell Type 1" and "Cell Type 2". I want to know which genes are deferentially expressed between genotypes in the "Cell Type 1" population. Is it possible to do this?

Xiaojieqiu commented 6 years ago

you may subset Cell Type 1 in the cds based on the cluster id and then run DEG test using something like this differentialGeneTest(celltype_1_cds, fullModelFormulaStr = "~genotype")

WhitneyFA commented 6 years ago

Thank you so much for your response. I have tried to subset by cell type but I keep getting the following error after I have subset the data and try to assign the data a CellDataSet:

celltype_spermatogonia <- row.names(subset(pData(uchl1_m2), CellType = "Spermatogonia")) uchl1_spermatogonia <- uchl1_m2[celltype_spermatogonia,] Error in intI(i, n = x@Dim[1], dn[[1]], give.dn = FALSE : invalid character indexing I am using a 10X genomics data set so the row names are cell barcodes followed by a dash and then a number (example AAACCTGCAGAGTGTGTG-1), could this be the issue?

CurlsForScience commented 5 years ago

Has this issue been resolved?

I am trying to run differentialGeneTest as the following

clustering_DEG_genes <-differentialGeneTest( CDS[expressed_genes,], fullModelFormulaStr = '~Cluster', cores = 1)

Examining clustering_DEG_genes I find that about half of the rows are just NA. This does not appear to be due to a low number of cells expressed as other genes with lower numbers of cells expressed make it through.

I am fairly certain that some of the genes that become NA in the clustering_DEG_genes object should be called as differential. When trying to run differentialGeneTest on these genes only, I again get all NAs. How can I run the differentialGeneTest on these genes?

Here is a snipit of code.

diff_test_res <- differentialGeneTest(cds_subset, fullModelFormulaStr = "~Cluster") diff_test_res[,c("gene_short_name", "pval", "qval")]

I can add a link to cds_subset if needed.