Skip to content

Commit

Permalink
Merge pull request #17 from compbiomed/devel
Browse files Browse the repository at this point in the history
Devel
  • Loading branch information
mingl1997 authored Oct 17, 2023
2 parents f290489 + 5a3df3d commit 74391f2
Show file tree
Hide file tree
Showing 415 changed files with 3,463 additions and 7,305 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: singleCellTK
Type: Package
Title: Comprehensive and Interactive Analysis of Single Cell RNA-Seq Data
Version: 2.10.1
Version: 2.11.0
Authors@R: c(person(given="Yichen", family="Wang", email="wangych@bu.edu", role=c("aut", "cre"),
comment = c(ORCID = "0000-0003-4347-5199")),
person(given="Irzam", family="Sarfraz", email="isarfraz@bu.edu", role=c("aut"),
Expand Down
14 changes: 10 additions & 4 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
Changes in Version 2.10.1 (2023-07-26)
================================================================================
* Added bubble plot
* Added support for batch processing multiple inputs
* Added support for importing and exporting AnnData objects
* Fixed a bug causing YAML output files to be empty
* Added function for bubble plot
* In SCTK-QC pipeline, added support for batch processing multiple inputs
* In SCTK-QC pipeline, added support for importing and exporting AnnData objects
* In SCTK-QC pipeline, fixed a bug causing YAML output files to be empty
* Update the SCTK-QC tutorial
* Fixed bug in combineSCE causing it to create multiple copies of row or column data

Changes in Version 2.10.0 (2023-04-25)
================================================================================
* Updated version to match Bioconductor 3.17

Changes in Version 2.8.1 (2023-03-10)
================================================================================
Expand Down
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
Loading

0 comments on commit 74391f2

Please sign in to comment.