GreenleafLab / chromVARmotifs

R package with motifs for use with chromVAR
Other
24 stars 9 forks source link

pooling pwmatrices together #4

Open jonathanperrie opened 5 years ago

jonathanperrie commented 5 years ago

With the exception of added redundancies and computational time for motif_ix, is there anything wrong with doing this?

library(BSgenome.Hsapiens.UCSC.hg18)
library(chromVARmotifs)
library(TFBSTools)
data("homer_pwms")
data("encode_pwms")
data("human_pwms_v2")
motifs<-do.call(PWMatrixList,c(encode_pwms,homer_pwms,human_pwms_v1))
tomshani commented 4 years ago

I am also trying to also pool the PWMs.

I think the issue is that the PWMs are already PWMatrixLists separately. I tried just c(encode_pwms,homer_pwms,human_pwms_v1) which made a PWMatrixList the size of all the combined PWMatrixs. But the matchMotifs() gave me the error: invalid PFM 'x': not an integer matrix . which is weird because they run fine separately. Any Ideas?

jonathanperrie commented 4 years ago

I think it's best to just use one set as the motifs heavily overlap with each other. You could examine this by using one set (as you have done) and seeing how the deviations lead to a specific clustering. I found my old code, but matchMotifs was just the standard call, so I'm unsure why it doesn't want to work for you.

motif_ix <- matchMotifs(motifs, counts_filtered, genome = BSgenome.Hsapiens.UCSC.hg18)

I did have to do something extra with the cpp files to compute the variability, but yeah I dunno about matchMotifs.

jonathanperrie commented 4 years ago

Maybe something in here might be of use: https://github.com/GreenleafLab/motifmatchr/blob/d0dc70e5b25d4d80b5bd96de8820a82de174baa5/R/match_motifs.R