ncats/cellranger-snakemake

Add FindAllMarkers and create various heatmaps

Closed this issue · 1 comments

FindAllMarkers has been added, and code is in place that should create the heatmap for Seurat objects containing merged 'groups':

if ( str_detect( newname, 'group_') )  {
  
    message( 'Running FindAllMarkers')
    DE_markers <- FindAllMarkers(x)
  
    clusters_up   <- setorder( setDT( DE_markers ), -avg_logFC )[ , head( .SD, 100 ), keyby='cluster' ]
    clusters_down <- setorder( setDT( DE_markers ),  avg_logFC )[ , head( .SD, 100 ), keyby='cluster' ]
  
    pdffile = str_replace( seurat_filepath, "seurat\\.Rdata", "heatmap.pdf" )
    pdfs[[pdffile]] <- DoHeatmap( x, features = c( clusters_up$V1, clusters_down$V1 ), raster=F ) +
      scale_fill_gradientn( colors = rev( RColorBrewer::brewer.pal( n = 10, name = "RdBu" )) ) +
      guides( color = FALSE)

  }

... but it is unclear whether this is working or not, as the .pdf files are not being generated.

NOTE: This issue may be a non-issue if the .pdf file-making issues are resolved and they appear to be ok.

Doh, it was the $V1 labels ... should be $gene here.