Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solved warnings and notes from BiocCheck #726

Merged
merged 1 commit into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions R/celda_decontX.R
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ runDecontX <- function(inSCE,
}



message(paste0(date(), " ... Running 'DecontX'"))
p <- paste0(date(), " ... Running 'DecontX'")
message(p)

## keep a copy of original decontX result, if there's any
oldColData <- NULL
Expand Down
8 changes: 8 additions & 0 deletions R/data.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#' @source DOI: 10.1126/science.aaa1934
#' @keywords datasets
#' @usage data("mouseBrainSubsetSCE")
#' @return A subset of 30 cells from a single cell RNA-Seq experiment
#' @examples
#' data("mouseBrainSubsetSCE")
"mouseBrainSubsetSCE"
Expand All @@ -33,6 +34,8 @@
#' @format A \link[SingleCellExperiment]{SingleCellExperiment} object.
#' @keywords datasets
#' @usage data("scExample")
#' @return Example Single Cell RNA-Seq data in SingleCellExperiment Object,
#' subset of 10x public dataset
#' @examples
#' data("scExample")
"sce"
Expand All @@ -47,6 +50,8 @@
#' `'beta'`, that could be found in both original studies with relatively
#' large population were kept for cleaner demonstration.
#' @usage data('sceBatches')
#' @return Example Single Cell RNA-Seq data in SingleCellExperiment object, with
#' different batches annotated
"sceBatches"

#' Stably Expressed Gene (SEG) list obect, with SEG sets for human and mouse.
Expand All @@ -59,6 +64,7 @@
#' @source \code{data('segList', package='scMerge')}
#' @keywords datasets
#' @usage data('SEG')
#' @return Stably Expressed Gene (SEG) list obect, with SEG sets for human and mouse.
#' @examples
#' data('SEG')
#' humanSEG <- SEG$human
Expand All @@ -77,6 +83,7 @@
#' @format A data.frame.
#' @keywords datasets
#' @usage data("msigdb_table")
#' @return A table of gene set categories
#' @examples
#' data("msigdb_table")
"msigdb_table"
Expand All @@ -93,6 +100,7 @@
#' @format A list
#' @keywords datasets
#' @usage data("MitoGenes")
#' @return List of mitochondrial genes of multiple reference
#' @examples
#' data("MitoGenes")
"MitoGenes"
3 changes: 2 additions & 1 deletion R/dropletUtils_barcodeRank.R
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ runBarcodeRankDrops <- function(inSCE,
df = 20
) {

message(paste0(date(), " ... Running 'barcodeRanks'"))
p <- paste0(date(), " ... Running 'barcodeRanks'")
message(p)

## Getting current arguments values
argsList <- mget(names(formals()),sys.frame(sys.nframe()))
Expand Down
3 changes: 2 additions & 1 deletion R/exportSCEtoAnndata.R
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ exportSCEtoAnnData <- function(sce,
fileName <- paste0(prefix,".h5ad")
filePath <- file.path(outputDir,fileName)
if (file.exists(filePath) && !isTRUE(overwrite)) {
stop(paste0(path, " already exists. Change 'outputDir' or set 'overwrite' to TRUE."))
p <- paste0(path, " already exists. Change 'outputDir' or set 'overwrite' to TRUE.")
stop(p)
}
if (isFALSE(forceDense)) {
forceDense <- NULL
Expand Down
6 changes: 4 additions & 2 deletions R/exportSCEtoTXT.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ exportSCEtoFlatFile <- function(sce,

.checkOverwrite <- function(path, overwrite) {
if (file.exists(path) && !isTRUE(overwrite)) {
stop(paste0(path, " already exists. Change 'outputDir' or set 'overwrite' to TRUE."))
p <- paste0(path, " already exists. Change 'outputDir' or set 'overwrite' to TRUE.")
stop(p)
}
}

Expand Down Expand Up @@ -86,7 +87,8 @@ exportSCEtoFlatFile <- function(sce,

if(isTRUE(gzipped)) {
.checkOverwrite(paste0(assaypath, ".gz"), overwrite)
message(date(), " .. Compressing into ", paste0(assaypath, ".gz"))
p <- paste0(assaypath, ".gz")
message(date(), " .. Compressing into ", p)
R.utils::gzip(filename = assaypath, overwrite = overwrite)
}
}
Expand Down
5 changes: 3 additions & 2 deletions R/getTopHVG.R
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,9 @@ setTopHVG <- function(inSCE,
}
}
rowSubset(inSCE, featureSubsetName) <- features
message(paste0(date(), " ... Feature subset variable '", featureSubsetName,
"' created."))
p <- paste0(date(), " ... Feature subset variable '", featureSubsetName,
"' created.")
message(p)
metadata(inSCE)$sctk$featureSubsets[[featureSubsetName]] <-
list(method = method,
number = nFeature,
Expand Down
33 changes: 22 additions & 11 deletions R/ggPlotting.R
Original file line number Diff line number Diff line change
Expand Up @@ -1089,7 +1089,8 @@ plotSCEViolinColData <- function(inSCE,

if (!is.null(coldata)) {
if (!coldata %in% names(SummarizedExperiment::colData(inSCE))) {
stop("'", paste(coldata), "' is not found in ColData.")
p <- paste(coldata)
stop("'", p, "' is not found in ColData.")
}
coldata <- SummarizedExperiment::colData(inSCE)[, coldata]
} else {
Expand All @@ -1105,7 +1106,8 @@ plotSCEViolinColData <- function(inSCE,
}
} else {
if (!groupBy %in% names(SummarizedExperiment::colData(inSCE))) {
stop("'", paste(groupBy), "' is not found in ColData.")
p <- paste(groupBy)
stop("'", p, "' is not found in ColData.")
}
groupBy <- as.character(SummarizedExperiment::colData(inSCE)[, groupBy])
}
Expand Down Expand Up @@ -1314,7 +1316,8 @@ plotSCEViolinAssayData <- function(inSCE,
}
} else {
if (!groupBy %in% names(SummarizedExperiment::colData(inSCE))) {
stop("'", paste(groupBy), "' is not found in ColData.")
p <- paste(groupBy)
stop("'", p , "' is not found in ColData.")
}
groupBy <- as.character(SummarizedExperiment::colData(inSCE)[, groupBy])
}
Expand Down Expand Up @@ -1547,7 +1550,8 @@ plotSCEViolin <- function(inSCE,
}
} else {
if (!groupBy %in% names(SummarizedExperiment::colData(inSCE))) {
stop("'", paste(groupBy), "' is not found in ColData.")
p <- paste(groupBy)
stop("'", p , "' is not found in ColData.")
}
groupBy <- SummarizedExperiment::colData(inSCE)[, groupBy]
}
Expand Down Expand Up @@ -1768,7 +1772,8 @@ plotSCEDensityColData <- function(inSCE,

if (!is.null(coldata)) {
if (!coldata %in% names(SummarizedExperiment::colData(inSCE))) {
stop("'", paste(coldata), "' is not found in ColData.")
p <- paste(coldata)
stop("'", p , "' is not found in ColData.")
}
coldata <- SummarizedExperiment::colData(inSCE)[, coldata]
} else {
Expand All @@ -1784,7 +1789,8 @@ plotSCEDensityColData <- function(inSCE,
}
} else {
if (!groupBy %in% names(SummarizedExperiment::colData(inSCE))) {
stop("'", paste(groupBy), "' is not found in ColData.")
p <- paste(groupBy)
stop("'", p , "' is not found in ColData.")
}
groupBy <- as.character(SummarizedExperiment::colData(inSCE)[, groupBy])
}
Expand Down Expand Up @@ -1939,7 +1945,8 @@ plotSCEDensityAssayData <- function(inSCE,
}
} else {
if (!groupBy %in% names(SummarizedExperiment::colData(inSCE))) {
stop("'", paste(groupBy), "' is not found in ColData.")
p <- paste(groupBy)
stop("'", p , "' is not found in ColData.")
}
groupBy <- as.character(SummarizedExperiment::colData(inSCE)[, groupBy])
}
Expand Down Expand Up @@ -2103,7 +2110,8 @@ plotSCEDensity <- function(inSCE,
}
} else {
if (!groupBy %in% names(SummarizedExperiment::colData(inSCE))) {
stop("'", paste(groupBy), "' is not found in ColData.")
p <- paste(groupBy)
stop("'", p , "' is not found in ColData.")
}
groupBy <- as.character(SummarizedExperiment::colData(inSCE)[, groupBy])
}
Expand Down Expand Up @@ -2640,7 +2648,8 @@ plotSCEBarColData <- function(inSCE,
combinePlot = TRUE) {
if (!is.null(coldata)) {
if (!coldata %in% names(SummarizedExperiment::colData(inSCE))) {
stop("'", paste(coldata), "' is not found in ColData.")
p <- paste(coldata)
stop("'", p , "' is not found in ColData.")
}
coldata <- SummarizedExperiment::colData(inSCE)[, coldata]
} else {
Expand All @@ -2656,7 +2665,8 @@ plotSCEBarColData <- function(inSCE,
}
} else {
if (!groupBy %in% names(SummarizedExperiment::colData(inSCE))) {
stop("'", paste(groupBy), "' is not found in ColData.")
p <- paste(groupBy)
stop("'", p , "' is not found in ColData.")
}
groupBy <- as.character(SummarizedExperiment::colData(inSCE)[, groupBy])
}
Expand Down Expand Up @@ -2775,7 +2785,8 @@ plotSCEBarAssayData <- function(inSCE,
}
} else {
if (!groupBy %in% names(SummarizedExperiment::colData(inSCE))) {
stop("'", paste(groupBy), "' is not found in ColData.")
p <- paste(groupBy)
stop("'", p , "' is not found in ColData.")
}
groupBy <- as.character(SummarizedExperiment::colData(inSCE)[, groupBy])
}
Expand Down
27 changes: 18 additions & 9 deletions R/htmlReports.R
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,8 @@ reportSeuratRun <- function(inSCE,

path <- paste0(outputPath, "SCE_SeuratRun", "-", gsub(" ", "_", Sys.Date()), ".rds")
saveRDS(data, path)
message("Output SCE object stored as ", paste0("SCE_SeuratRun", "-", gsub(" ", "_", Sys.Date()), ".rds"), " in ", outputPath, ".")
p <- paste0("SCE_SeuratRun", "-", gsub(" ", "_", Sys.Date()), ".rds")
message("Output SCE object stored as ", p , " in ", outputPath, ".")
message("Output HTML file stored as ", outputFile, " in ", outputPath, ".")

return(data)
Expand Down Expand Up @@ -506,7 +507,8 @@ reportSeuratResults <- function(inSCE,

path <- paste0(outputPath, "SCE_SeuratResults", "-", gsub(" ", "_", Sys.Date()), ".rds")
saveRDS(data, path)
message("Output SCE object stored as ", paste0("SCE_SeuratResults", "-", gsub(" ", "_", Sys.Date()), ".rds"), " in ", outputPath, ".")
p <- paste0("SCE_SeuratResults", "-", gsub(" ", "_", Sys.Date()), ".rds")
message("Output SCE object stored as ", p , " in ", outputPath, ".")
message("Output HTML file stored as ", outputFile, " in ", outputPath, ".")

return(data)
Expand Down Expand Up @@ -593,7 +595,8 @@ reportSeuratDimRed <- function(inSCE,

path <- paste0(outputPath, "SCE_SeuratDimRed", "-", gsub(" ", "_", Sys.Date()), ".rds")
saveRDS(data, path)
message("Output SCE object stored as ", paste0("SCE_SeuratDimRed", "-", gsub(" ", "_", Sys.Date()), ".rds"), " in ", outputPath, ".")
p <- paste0("SCE_SeuratDimRed", "-", gsub(" ", "_", Sys.Date()), ".rds")
message("Output SCE object stored as ", p , " in ", outputPath, ".")
message("Output HTML file stored as ", outputFile, " in ", outputPath, ".")

return(data)
Expand Down Expand Up @@ -660,7 +663,8 @@ reportSeuratNormalization <- function(inSCE,

path <- paste0(outputPath, "SCE_SeuratNormalization", "-", gsub(" ", "_", Sys.Date()), ".rds")
saveRDS(data, path)
message("Output SCE object stored as ", paste0("SCE_SeuratNormalization", "-", gsub(" ", "_", Sys.Date()), ".rds"), " in ", outputPath, ".")
p <- paste0("SCE_SeuratNormalization", "-", gsub(" ", "_", Sys.Date()), ".rds")
message("Output SCE object stored as ", p , " in ", outputPath, ".")
message("Output HTML file stored as ", outputFile, " in ", outputPath, ".")

return(data)
Expand Down Expand Up @@ -735,7 +739,8 @@ reportSeuratFeatureSelection <- function(inSCE,

path <- paste0(outputPath, "SCE_SeuratFeatureSelection", "-", gsub(" ", "_", Sys.Date()), ".rds")
saveRDS(data, path)
message("Output SCE object stored as ", paste0("SCE_SeuratFeatureSelection", "-", gsub(" ", "_", Sys.Date()), ".rds"), " in ", outputPath, ".")
p <- paste0("SCE_SeuratFeatureSelection", "-", gsub(" ", "_", Sys.Date()), ".rds")
message("Output SCE object stored as ", p , " in ", outputPath, ".")
message("Output HTML file stored as ", outputFile, " in ", outputPath, ".")

return(data)
Expand Down Expand Up @@ -802,7 +807,8 @@ reportSeuratScaling <- function(inSCE,

path <- paste0(outputPath, "SCE_SeuratScaleData", "-", gsub(" ", "_", Sys.Date()), ".rds")
saveRDS(data, path)
message("Output SCE object stored as ", paste0("SCE_SeuratScaleData", "-", gsub(" ", "_", Sys.Date()), ".rds"), " in ", outputPath, ".")
p <- paste0("SCE_SeuratScaleData", "-", gsub(" ", "_", Sys.Date()), ".rds")
message("Output SCE object stored as ", p , " in ", outputPath, ".")
message("Output HTML file stored as ", outputFile, " in ", outputPath, ".")

return(data)
Expand Down Expand Up @@ -914,7 +920,8 @@ reportSeuratClustering <- function(inSCE,

path <- paste0(outputPath, "SCE_SeuratClustering", "-", gsub(" ", "_", Sys.Date()), ".rds")
saveRDS(data, path)
message("Output SCE object stored as ", paste0("SCE_SeuratClustering", "-", gsub(" ", "_", Sys.Date()), ".rds"), " in ", outputPath, ".")
p <- paste0("SCE_SeuratClustering", "-", gsub(" ", "_", Sys.Date()), ".rds")
message("Output SCE object stored as ", p , " in ", outputPath, ".")
message("Output HTML file stored as ", outputFile, " in ", outputPath, ".")

return(data)
Expand Down Expand Up @@ -1018,7 +1025,8 @@ reportSeuratMarkerSelection <- function(inSCE,

path <- paste0(outputPath, "SCE_SeuratResults", "-", gsub(" ", "_", Sys.Date()), ".rds")
saveRDS(data, path)
message("Output SCE object stored as ", paste0("SCE_SeuratResults", "-", gsub(" ", "_", Sys.Date()), ".rds"), " in ", outputPath, ".")
p <- paste0("SCE_SeuratResults", "-", gsub(" ", "_", Sys.Date()), ".rds")
message("Output SCE object stored as ", p , " in ", outputPath, ".")
message("Output HTML file stored as ", outputFile, " in ", outputPath, ".")

return(data)
Expand Down Expand Up @@ -1184,7 +1192,8 @@ reportSeurat <- function(

path <- paste0(outputPath, "SCE_SeuratReport", "-", gsub(" ", "_", Sys.Date()), ".rds")
saveRDS(data, path)
message("Output SCE object stored as ", paste0("SCE_SeuratReport", "-", gsub(" ", "_", Sys.Date()), ".rds"), " in ", outputPath, ".")
p <- paste0("SCE_SeuratReport", "-", gsub(" ", "_", Sys.Date()), ".rds")
message("Output SCE object stored as ", p , " in ", outputPath, ".")
message("Output HTML file stored as ", outputFile, " in ", outputPath, ".")

return(data)
Expand Down
6 changes: 4 additions & 2 deletions R/importExampleData.R
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ importExampleData <- function(dataset, class = c("Matrix", "matrix"),

if(dataset %in% scRNAseqDatasets) {
if(!("scRNAseq" %in% rownames(utils::installed.packages()))) {
stop(paste0("Package 'scRNAseq' is not installed. Please install to load dataset '", dataset, "'."))
p <- paste0("Package 'scRNAseq' is not installed. Please install to load dataset '", dataset, "'.")
stop(p)
}
if (dataset == "fluidigm_pollen") {
temp <- scRNAseq::ReprocessedFluidigmData()
Expand All @@ -84,7 +85,8 @@ importExampleData <- function(dataset, class = c("Matrix", "matrix"),
}
} else if (dataset %in% tenxPbmcDatasets) {
if(!("TENxPBMCData" %in% rownames(utils::installed.packages()))) {
stop(paste0("Package 'TENxPBMCData' is not installed. Please install to load dataset '", dataset, "'."))
p <- paste0("Package 'TENxPBMCData' is not installed. Please install to load dataset '", dataset, "'.")
stop(p)
}
temp <- TENxPBMCData::TENxPBMCData(dataset = dataset)
colnames(temp) <- paste(temp$Sample, temp$Barcode, sep="_")
Expand Down
18 changes: 11 additions & 7 deletions R/importGeneSets.R
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,9 @@ importGeneSetsFromMSigDB <- function(inSCE, categoryIDs,
gs.names <- unique(gs$gs_name)
num.gs.names <- length(gs.names)
if(isTRUE(verbose)){
message(paste0(date(), " .. Importing '", categoryIDs[i],
"' gene sets (n = ", num.gs.names, ")"))
p <- paste0(date(), " .. Importing '", categoryIDs[i],
"' gene sets (n = ", num.gs.names, ")")
message(p)
}

for(j in seq_along(gs.names)) {
Expand All @@ -424,19 +425,22 @@ importGeneSetsFromMSigDB <- function(inSCE, categoryIDs,
subCategory = subcat))
if(j %% 1000 == 0) {
if(isTRUE(verbose)) {
message(paste0(date(), " .... Completed ", j, " out of ",
num.gs.names, " gene sets"))
p <- paste0(date(), " .... Completed ", j, " out of ",
num.gs.names, " gene sets")
message(p)
}
}
}
if(isTRUE(verbose)) {
message(paste0(date(), " .... Completed ", num.gs.names, " gene sets ",
"for ", i))
p <- paste0(date(), " .... Completed ", num.gs.names, " gene sets ",
"for ", i)
message(p)
}

# Add to SCE
if(isTRUE(verbose)) {
message(paste0(date(), " .. Matching gene sets to '", by, "'"))
p <- paste0(date(), " .. Matching gene sets to '", by, "'")
message(p)
}
gsc <- GSEABase::GeneSetCollection(gs.list)
inSCE <- importGeneSetsFromCollection(inSCE = inSCE,
Expand Down
5 changes: 3 additions & 2 deletions R/importOptimus.R
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,10 @@
}, silent = TRUE)

if(inherits(error, "try-error")) {
stop(paste0("importOptimus did not complete successfully. SCE could not be",
p <- paste0("importOptimus did not complete successfully. SCE could not be",
"generated. Error given during the import process: \n\n",
error))
error)
stop(p)
}

if (class == "matrix") {
Expand Down
Loading
Loading