GreenleafLab / ArchR

ArchR : Analysis of Regulatory Chromatin in R (www.ArchRProject.com)
MIT License
384 stars 137 forks source link

Add Jeff Vierstra's Non-redundant TF motifs? #214

Closed hypercompetent closed 3 years ago

hypercompetent commented 4 years ago

Describe the problem that your feature request would address. Jeff Vierstra has generated a nice resource for clustered motif models and motif "Archetypes" here: https://www.vierstra.org/resources/motif_clustering

It would be great to be able to use these motif archetypes for motif enrichment analyses to avoid getting many hits for nearly-identical motifs in motif databases.

Describe the solution you'd like I would like to be able to use these (or similar) clustered motif archetypes as an option for motifSet in addMotifAnnotations.

Describe alternatives you've considered I could split up the BED files provided at the URL, above, per motif archtype, and compute enrichment using addPeakAnnotations and peakAnnoEnrichment as you describe here: https://www.archrproject.com/bookdown/custom-enrichment.html

However, this would be a different approach to enrichment from what's available for the JASPAR and chromVar databases using motifmatchr.

Alternately, allowing a user-supplied set of PWMs for addMotifAnnotations (addCustomMotifAnnotations?) that passes motifs into the motifmatchr step may be workable without building too much more into the package.

Additional context If what's needed for this to work is packaging of these motif archetypes into a TFBSTools-compatible PWM package, I may be able to do that legwork. Before I do so, it would be great to get some feedback as to the best approach for use in ArchR.

Thanks again for this package! I've been building trajectories over the last couple of days, and it's been going great.

Cheers, -Lucas

rcorces commented 4 years ago

I agree that this would be useful. Lets see what @jgranja24 says.

jgranja24 commented 4 years ago

I can add an option for custom pwms as input.

Best

jeff

jgranja24 commented 4 years ago

Sorry for the late update on this --- you can add these motifs with the following code

devtools::install_github("GreenleafLab/ArchR", ref="release_1.0.0", repos = BiocManager::repositories())
system("wget https://jeffgranja.s3.amazonaws.com/ArchR/Annotations/Vierstra-Human-Motifs.rds")
motifPWMs <- readRDS("Vierstra-Human-Motifs.rds")
proj <- addMotifAnnotations(proj, motifPWMs = motifPWMs, name = "Vierstra")
proj <- addDeviationsMatrix(proj, peakAnnotation = "Vierstra", force = TRUE)
yxiao832 commented 4 years ago

I got an error message when I try to run the code (i just installed the updated ArchR):

Warning message in gzfile(file, "rb"): “cannot open compressed file 'Vierstra-Human-Motifs.rds', probable reason 'No such file or directory'” Error in gzfile(file, "rb"): cannot open the connection Traceback:

  1. readRDS("Vierstra-Human-Motifs.rds")
  2. gzfile(file, "rb")
jgranja24 commented 4 years ago

did you download the motifs?

yxiao832 commented 4 years ago

the error appears after I run motifPWMs <- readRDS("Vierstra-Human-Motifs.rds")

jgranja24 commented 4 years ago

You need the motif file - wget https://jeffgranja.s3.amazonaws.com/ArchR/Annotations/Vierstra-Human-Motifs.rds

You can check this file.exists("Vierstra-Human-Motifs.rds")

jgranja24 commented 4 years ago

Turns out it wasnt a public downloadable link please try again!


devtools::install_github("GreenleafLab/ArchR", ref="release_1.0.0", repos = BiocManager::repositories())
system("wget https://jeffgranja.s3.amazonaws.com/ArchR/Annotations/Vierstra-Human-Motifs.rds")
motifPWMs <- readRDS("Vierstra-Human-Motifs.rds")
proj <- addMotifAnnotations(proj, motifPWMs = motifPWMs, name = "Vierstra")
proj <- addDeviationsMatrix(proj, peakAnnotation = "Vierstra", force = TRUE)
yxiao832 commented 4 years ago

it worked now! Thanks!

willey2020 commented 3 years ago

@jgranja24 Hello Jeff, I saw that there is V-human-motifs, Could I ask if there is potentially mouse motif version? I saw there is mouse version in Vierstra website. Thank you!

jgranja24 commented 3 years ago

Hi @willey2020, Im pretty sure that the one i made is both. Sorry for the confusion!

willey2020 commented 3 years ago

@jgranja24 Ah Thank you so much Jeff!! That is great news!!