hdWGCNA
hdWGCNA copied to clipboard
Error in "MotifOverlapBarPlot" and "MotifTargetScore"
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,
- #motif_font = 'xkcd_regular',
- outdir = 'motifs',
- plot_size=c(5,6)
- ) [1] "CSC-M1" Error in as.vector(data) : no method for coercing this S4 class to a vector
CSC_hdWGCNA_object <- MotifTargetScore(
- CSC_hdWGCNA_object,
- method='UCell'
- ) Error in calculate_Uscore(Seurat::GetAssayData(obj, slot, assay = assay), : One or more signatures contain more genes than maxRank parameter. Increase maxRank parameter or make shorter signatures
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.