get top motifs for DARs

PHOTO EMBED

Sat Apr 02 2022 07:05:37 GMT+0000 (UTC)

Saved by @anjalichawla92 #r

library(motifmatchr)
anno <- getPeakAnnotation(ArchRProj = proj, name = "Motif")
motif_ix <- matchMotifs(anno$motifs, GR, genome = "hg38",out = "score")
score <- assays(motif_ix)$motifScores
apply(score,1,function(x) which(x==max(x)))
colnames(score)[tail(sort(as.matrix(score)), 10)]
content_copyCOPY

https://stackoverflow.com/questions/17735859/for-each-row-return-the-column-name-of-the-largest-value