You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for your development of this package! I'm running into an issue when using MotifScan with EnsDb.Mmusculus.v79 and mm10. I get the the error message below.
Error message
> [1] "Matching motifs..."
> [1] "Getting putative TF target genes..."
> Error in `$<-.data.frame`(`*tmp*`, "n_targets", value = c(Arnt = 5672L, :
> replacement has 828 rows, data has 879
Stepping through the source code line by line, I find that the error is
triggered in the last line in the block of code below.
colnames(tf_match) <- motif_df$motif_name ###
# only keep genes that are in the Seurat object and in the given EnsDb:
gene_list <- rownames(seurat_obj)
gene_list <- gene_list[gene_list %in% rownames(tf_match)]
tf_match <- tf_match[gene_list,]
# get list of target genes for each TF:
print('Getting putative TF target genes...')
tfs <- motif_df$motif_name ###
tf_targets <- list()
n_targets <- list()
for(cur_tf in tfs){ tf_targets[[cur_tf]] <- names(tf_match[,cur_tf][tf_match[,cur_tf]])
n_targets[[cur_tf]] <- length(tf_targets[[cur_tf]] )
}
n_targets <- unlist(n_targets)
# add number of target genes to motif_df
motif_df$n_targets <- n_targets
The error is occurring because there are some genes that have more than
one motif ID. In other words, there are duplicate column names. Changing
the hashtagged lines above to use motif_ID instead of motif_name
allows me to run the code without error.
However, since this is mouse, there is still a problem... gene_name and motif_name are mostly human genes. I'm working on the fix for that and will post a separate issue.
As some additional information, I ran WGCNA on the seurat object previously and generated the pfm in this way:
Thank you for your development of this package! I'm running into an issue when using MotifScan with
EnsDb.Mmusculus.v79
andmm10
. I get the the error message below.Error message
Stepping through the source code line by line, I find that the error is
triggered in the last line in the block of code below.
The error is occurring because there are some genes that have more than
one motif ID. In other words, there are duplicate column names. Changing
the hashtagged lines above to use
motif_ID
instead ofmotif_name
allows me to run the code without error.
However, since this is mouse, there is still a problem...
gene_name
andmotif_name
are mostly human genes. I'm working on the fix for that and will post a separate issue.As some additional information, I ran WGCNA on the seurat object previously and generated the pfm in this way:
R session info
Thanks!
Jen
The text was updated successfully, but these errors were encountered: