TF enrichment of linked peaks #1383
Replies: 3 comments 6 replies
-
@waltno - I'm not sure how what you are looking to accomplish is different from what is enabled by Perhaps you're requesting how to do peak enrichment when you dont have a |
Beta Was this translation helpful? Give feedback.
-
I think this is very similar to this discussion: #1331 |
Beta Was this translation helpful? Give feedback.
-
Okay I think I got it! Here's a giant chunk of code
I got this heatmap!!! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I followed the methods in
https://www.sciencedirect.com/science/article/pii/S0092867421009429?via%3Dihub
Which is a Greenleaf paper :) If I did something wrong feel free to correct me!
`
#get linked peaks
#I have three kmeans clusters
p <- plotPeak2GeneHeatmap(ArchRProj = m2, groupBy = "cell_line", k = 3, returnMatrices = T)
link_df<- data.frame(p@listData$Peak2GeneLinks)
names(p@listData$RNA@listData$kmeansId)<- rownames(p@listData[["RNA"]]@ListData[["matrix"]])
link_df$kmean <- p@listData$RNA@listData$kmeansId[match(names(p@listData$RNA@listData$kmeansId), rownames(link_df))]
link_df$peak <- gsub(":", "-", link_df$peak)
k1<- link_df[link_df$kmean == "1",]
k2<- link_df[link_df$kmean == "2",]
k3<- link_df[link_df$kmean == "3",]
peak<-getPeakSet(m2)
names(peak)<-NULL
list_peak<-GRangesList(StringToGRanges(k1$peak), StringToGRanges(k2$peak), StringToGRanges(k3$peak))
##I went here and manually downloaded a LOLA Core database http://big.databio.org/regiondb/
##not sure which one is the best core database, I picked the most recent one
library(LOLA)
regionDB = loadRegionDB("~/nm/t1/resources/regions/LOLACore/hg38")
locResults = runLOLA(userSets = list_peak, userUniverse = peak, regionDB, cores=1)
writeCombinedEnrichment(locResults, outFolder= "lolaResults", includeSplits=TRUE)
`
Beta Was this translation helpful? Give feedback.
All reactions