Skip to content

Commit 23f4e83

Browse files
Merge pull request #128 from ferenckata/export_tss
CAGEfightR enhancer calling extension
2 parents 8d315a8 + 1d11254 commit 23f4e83

File tree

4 files changed

+15
-11
lines changed

4 files changed

+15
-11
lines changed

R/CAGEfightR.R

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
#' of [`CAGEfightR::quantifyCTSSs()`], and then passed to the `quickEnhancers`
99
#' function.
1010
#'
11-
#' @note At the moment the conversion is expensive as it goes from `DataFrame`
12-
#' of `Rle` to `data.frame` to `matrix`.
13-
#'
1411
#' @param object A `CAGEexp` object
1512
#'
1613
#' @return A `RangedSummarizedExperiment` object. See the example below on
1714
#' how to attach it to the experiment list of a `CAGEexp` object.
1815
#'
16+
#' @author Charles Plessy
17+
#' @author Katalin Ferenc
18+
#'
1919
#' @family CAGEfightR
2020
#' @family CAGEr object modifiers
2121
#'
@@ -37,9 +37,12 @@ setGeneric("quickEnhancers", function(object)
3737
setMethod("quickEnhancers", signature(object = "CAGEexp"), function(object) {
3838
se <- CTSStagCountSE(object)
3939
colData(se) <- colData(object)
40-
rowRanges(se) <- as(rowRanges(se), "StitchedGPos")
4140
colData(se)$Name <- colData(se)$sampleLabels
42-
assays(se) <- List(counts=as(as.matrix(as.data.frame(assay(se))), "dgCMatrix"))
41+
assays(se) <- List(
42+
counts = as(as.matrix(as.data.frame(assays(se)$counts)), "dgCMatrix"),
43+
TPM = as(as.matrix(as.data.frame(assays(se)$normalizedTpmMatrix)), "dgCMatrix"))
44+
score(rowRanges(se)) <- Matrix::rowSums(assays(se)$TPM)
4345
enhancers <- quickEnhancers(se)
4446
c(enhancers = enhancers, object)
4547
})
48+

man/TSSlogo.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/annotateCTSS.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/quickEnhancers.Rd

Lines changed: 5 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)