smorabit / hdWGCNA

High dimensional weighted gene co-expression network analysis
https://smorabit.github.io/hdWGCNA/
Other
315 stars 31 forks source link

Error in "MotifOverlapBarPlot" and "MotifTargetScore" #254

Open zhezhu123 opened 1 month ago

zhezhu123 commented 1 month ago

First of all thank you very much for creating this package that has been very useful to me. An error occurred when I used the "MotifOverlapBarPlot" and "MotifTargetScore" functions to process my Seurat v4 data:

MotifOverlapBarPlot(

CSC_hdWGCNA_object <- MotifTargetScore(

Here are the steps I took:

single-cell analysis package

library(Seurat)

plotting and data science packages

library(tidyverse) library(cowplot) library(patchwork)

co-expression network analysis packages:

library(WGCNA) library(hdWGCNA)

network analysis & visualization package:

library(igraph)

packages for TF motif analysis

library(JASPAR2020) library(motifmatchr) library(TFBSTools) library(EnsDb.Hsapiens.v86) library(GenomicRanges) library(BSgenome.Hsapiens.UCSC.hg38) library(GeneOverlap) library(ggseqlogo) library(rtracklayer)

using the cowplot theme for ggplot

theme_set(theme_cowplot())

set random seed for reproducibility

set.seed(12345)

get the pfm from JASPAR2020 using TFBSTools

pfm_core <- TFBSTools::getMatrixSet( x = JASPAR2020, opts = list(collection = "CORE", tax_group = 'vertebrates', all_versions = FALSE) )

run the motif scan with these settings for the mouse dataset

CSC_hdWGCNA_object <- MotifScan( CSC_hdWGCNA_object, species_genome = 'hg38', pfm = pfm_core, EnsDb = EnsDb.Hsapiens.v86 ) dim(GetMotifMatrix(CSC_hdWGCNA_object))

TF target genes

CSC_hdWGCNA_object <- GetMotifTargets(CSC_hdWGCNA_object)

check target genes for one TF:

head(CSC_hdWGCNA_object$NFKB2)

overlap between modules & TF target genes:

CSC_hdWGCNA_object <- OverlapModulesMotifs(CSC_hdWGCNA_object)

look at the overlap data

head(GetMotifOverlap(CSC_hdWGCNA_object))

plot the top TFs overlapping with

MotifOverlapBarPlot( CSC_hdWGCNA_object,

motif_font = 'xkcd_regular',

outdir = 'motifs', plot_size=c(5,6) )

library(UCell)

CSC_hdWGCNA_object <- MotifTargetScore( CSC_hdWGCNA_object, method='UCell' )

Can you tell me where the problem is and how to solve it? Thank you very much.