Skip to content

Commit fda300b

Browse files
committed
change sampleData to sampleMetadata in assignReadClasstoTranscripts for variable clarity
1 parent 9c2d8ba commit fda300b

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

R/bambu-assignDist.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#' @import data.table
44
#' @noRd
55
assignReadClasstoTranscripts <- function(readClassList, annotations, isoreParameters,
6-
verbose, sampleData, demultiplexed,
6+
verbose, sampleMetadata, demultiplexed,
77
returnDistTable = FALSE, trackReads = TRUE) {
88
if (is.character(readClassList)) readClassList <- readRDS(file = readClassList)
99
metadata(readClassList)$readClassDist <- calculateDistTable(readClassList, annotations, isoreParameters, verbose, returnDistTable)
@@ -17,7 +17,7 @@ assignReadClasstoTranscripts <- function(readClassList, annotations, isoreParame
1717
mutate(aval = 1) %>%
1818
data.table()
1919
#return non-em counts
20-
ColData <- generateColData(readClassList, sampleData, demultiplexed)
20+
ColData <- generateColData(readClassList, sampleMetadata, demultiplexed)
2121
quantData <- SummarizedExperiment(assays = SimpleList(
2222
counts = generateUniqueCounts(readClassDt, metadata(readClassList)$countMatrix, annotations)),
2323
rowRanges = annotations,

R/bambu.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ bambu <- function(reads, annotations = NULL, genome = NULL, NDR = NULL,
246246
isoreParameters = isoreParameters,
247247
verbose = verbose,
248248
# for bulk data, there is one sampleData (keep sampleData[1]), for single-cell, there is one per sample
249-
sampleData = if(length(sampleData) == 1) sampleData[1] else sampleData[i],
249+
sampleMetadata = if(length(sampleData) == 1) sampleData[1] else sampleData[i],
250250
demultiplexed = demultiplexed,
251251
returnDistTable = returnDistTable,
252252
trackReads = trackReads

R/bambu_utilityFunctions.R

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -292,18 +292,18 @@ combineCountSes <- function(countsSe, colDataList, annotations){
292292
return(combinedCountsSe)
293293
}
294294

295-
#' Generate the colData using the external sampleData.csv provided by the user in the sampleData argument
295+
#' Generate the colData using the external sampleMetadata.csv provided by the user in the sampleMetadata argument
296296
#' @param readClassList A list object containingmetadata about read classes.
297-
#' @param sampleData A path to a CSV file or NULL/NA if there is no metadata for the sample.
297+
#' @param sampleMetadata A path to a CSV file or NULL/NA if there is no metadata for the sample.
298298
#' @param demultiplexed Logical; indicates if data is demultiplexed.
299299
#'
300300
#' @return A DataFrame containing colData for the sample.
301301
#' @export
302-
generateColData <- function(readClassList, sampleData, demultiplexed) {
303-
sampleDataDf <- if (is.null(sampleData) || is.na(sampleData)) {
302+
generateColData <- function(readClassList, sampleMetadata, demultiplexed) {
303+
sampleMetadataDf <- if (is.null(sampleMetadata) || is.na(sampleMetadata)) {
304304
if (demultiplexed) tibble(barcode = character()) else tibble(sampleName = character())
305305
} else {
306-
read.csv(sampleData)
306+
read.csv(sampleMetadata)
307307
}
308308
samples <- metadata(readClassList)$samples
309309
joinKey <- if (demultiplexed) "barcode" else "sampleName"
@@ -317,7 +317,7 @@ generateColData <- function(readClassList, sampleData, demultiplexed) {
317317
}
318318

319319
colData <- colData %>%
320-
left_join(sampleDataDf, by = joinKey) %>%
320+
left_join(sampleMetadataDf, by = joinKey) %>%
321321
as.data.frame()
322322

323323
rownames(colData) <- colData$id

0 commit comments

Comments
 (0)