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
As far as I can see, the enhancer calling does not provide sample-specific enhancers, so I used a function from CAGEfightR to extract sample-specific enhancer bed files. See below. Let me know if there is a shorter way, or one that provides also the tpms per enhancer per sample.
brcage <- CAGEr::quickEnhancers(brcage)
supported_enhancers <- CAGEfightR::subsetBySupport(
brcage[["enhancers"]],
inputAssay="counts",
unexpressed=0,
minSamples=1)
sample_per_enhancer <- supported_enhancers@assays@data$counts
for (sample_name in colnames(sample_per_enhancer)){
sample_bed <- lapply(
names(
sample_per_enhancer[
# filter for enhancers with non-zero tags per sample
sample_per_enhancer[,sample_name]>0,][,sample_name]
),
# extract chr and coordinates into separate entities
function(x){
unlist(strsplit(x, ":|-"))
}
)
# save list of coordinates to bedfile
sink(file.path(
cagerFolder,
"enhancers",
paste0(sample_name, "_enhancers.bed")))
for (line in sample_bed){
cat(paste0(line[1], "\t", line[2], "\t", line[3], "\n"))
}
sink()
}
The text was updated successfully, but these errors were encountered:
Hei,
As far as I can see, the enhancer calling does not provide sample-specific enhancers, so I used a function from CAGEfightR to extract sample-specific enhancer bed files. See below. Let me know if there is a shorter way, or one that provides also the tpms per enhancer per sample.
The text was updated successfully, but these errors were encountered: