markziemann / mitch

An R package for multi-dimensional pathway enrichment analysis
https://bioconductor.org/packages/mitch
Other
16 stars 4 forks source link

mitch_import error when using Seurat v4 #25

Closed tjbencomo closed 2 years ago

tjbencomo commented 3 years ago

Hi,

I recently tried running mitch using differential expression results from Seurat's FindMarkers function.

de_list <- list()
for (i in 1:length(levels(cells))) {
  name <- levels(cells)[i]
  print(paste("Computing markers for", name))
  x <- 
    de_list[[name]] <- FindMarkers(cells, ident.1 = name, min.pct = 0.25, logfc.threshold = .75)
}
z <- mitch_import(de_list, DEtype="Seurat")

When I try to import the results into mitch, I'm met with:

Error in FUN(X[[i]], ...) : 
  Error, there is no column named 'avg_logFC' in the input

I believe this is because as of Seurat v4, they have changed the fold change column name from avg_logFC to avg_log2FC.

Renaming the column seems to fix the issue

de_list[[name]] <- FindMarkers(cells, ident.1 = name, min.pct = 0.25, logfc.threshold = .75) %>%
      rename(avg_logFC = "avg_log2FC")
markziemann commented 3 years ago

Thanks for raising this issue. I will see if I can come up with a solution that works for old and new column names.