From d9550c40e02b85ac9403f0010587001bd3bdc50c Mon Sep 17 00:00:00 2001 From: lingminhao Date: Fri, 8 May 2026 10:33:07 +0800 Subject: [PATCH 1/3] export generateUniqueCountsSEFromQuantData & getSampleData --- NAMESPACE | 3 +++ R/bambu-classes.R | 4 ++-- R/transcriptToGeneExpression.R | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/NAMESPACE b/NAMESPACE index df261f3a..df57c91d 100755 --- a/NAMESPACE +++ b/NAMESPACE @@ -6,6 +6,9 @@ export(plotBambu) export(prepareAnnotations) export(readFromGTF) export(transcriptToGeneExpression) +export(generateUniqueCountsSEFromQuantData) +export(getSampleData) +exportMethods(getSampleData) export(writeBambuOutput) export(writeToGTF) export(writeAnnotationsToGTF) diff --git a/R/bambu-classes.R b/R/bambu-classes.R index e9ccaf43..6c9c235c 100644 --- a/R/bambu-classes.R +++ b/R/bambu-classes.R @@ -55,7 +55,7 @@ constructQuantData <- function(sampleData, readClassDt, readToTranscriptMap = readToTranscriptMap) } -#' @noRd +#' @export setGeneric("getSampleData", function(x) standardGeneric("getSampleData")) #' @noRd setGeneric("getReadClassDt", function(x) standardGeneric("getReadClassDt")) @@ -66,7 +66,7 @@ setGeneric("getDistTable", function(x) standardGeneric("getDistTable") #' @noRd setGeneric("getReadToTranscriptMap", function(x) standardGeneric("getReadToTranscriptMap")) -#' @noRd +#' @exportMethod getSampleData setMethod("getSampleData", "quantData", function(x) x@sampleData) #' @noRd setMethod("getReadClassDt", "quantData", function(x) x@readClassDt) diff --git a/R/transcriptToGeneExpression.R b/R/transcriptToGeneExpression.R index a76aa7d0..e39b9c8a 100644 --- a/R/transcriptToGeneExpression.R +++ b/R/transcriptToGeneExpression.R @@ -62,7 +62,7 @@ transcriptToGeneExpression <- function(se) { #' @return A SummarizedExperiment object with \code{assays$uniqueCounts}, #' \code{metadata$incompatibleCounts}, and \code{metadata$nonuniqueCounts} #' @import data.table -#' @noRd +#' @export generateUniqueCountsSEFromQuantData <- function(quantData, annotations) { uniqueCountsList <- lapply(quantData, function(x) { readClassDt <- getReadClassDt(x) From 18673cfca96e104c550df59190dbcc0f060845f7 Mon Sep 17 00:00:00 2001 From: lingminhao Date: Fri, 8 May 2026 11:26:16 +0800 Subject: [PATCH 2/3] export generateUniqueCountsSEFromQuantData --- NAMESPACE | 2 -- R/bambu-classes.R | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/NAMESPACE b/NAMESPACE index df57c91d..e9c86d79 100755 --- a/NAMESPACE +++ b/NAMESPACE @@ -7,8 +7,6 @@ export(prepareAnnotations) export(readFromGTF) export(transcriptToGeneExpression) export(generateUniqueCountsSEFromQuantData) -export(getSampleData) -exportMethods(getSampleData) export(writeBambuOutput) export(writeToGTF) export(writeAnnotationsToGTF) diff --git a/R/bambu-classes.R b/R/bambu-classes.R index 6c9c235c..e9ccaf43 100644 --- a/R/bambu-classes.R +++ b/R/bambu-classes.R @@ -55,7 +55,7 @@ constructQuantData <- function(sampleData, readClassDt, readToTranscriptMap = readToTranscriptMap) } -#' @export +#' @noRd setGeneric("getSampleData", function(x) standardGeneric("getSampleData")) #' @noRd setGeneric("getReadClassDt", function(x) standardGeneric("getReadClassDt")) @@ -66,7 +66,7 @@ setGeneric("getDistTable", function(x) standardGeneric("getDistTable") #' @noRd setGeneric("getReadToTranscriptMap", function(x) standardGeneric("getReadToTranscriptMap")) -#' @exportMethod getSampleData +#' @noRd setMethod("getSampleData", "quantData", function(x) x@sampleData) #' @noRd setMethod("getReadClassDt", "quantData", function(x) x@readClassDt) From 69ed2887e3ee23f66aa3460a43a0876f57ade49a Mon Sep 17 00:00:00 2001 From: lingminhao Date: Fri, 8 May 2026 14:43:27 +0800 Subject: [PATCH 3/3] fix typo --- R/bambu-quantify.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/bambu-quantify.R b/R/bambu-quantify.R index 65998cad..99f9eaaa 100644 --- a/R/bambu-quantify.R +++ b/R/bambu-quantify.R @@ -10,7 +10,7 @@ bambu.quantify <- function(readClassDt, columnIdx, incompatibleCounts, txid.inde # Calculate nobs for sample(s) columnIdx # Use data.table syntax for in-place creation of nobs column for the scope of this function readClassDt[, nobs := { - ids <- columnIdx[[1]] + ids <- columnIds[[1]] if (is.null(ids) || length(ids) == 0 || is.na(ids[1])) { 0L } else if (length(columnIdx) == 1) {