Skip to content

Commit

Permalink
attempt to fix examples..
Browse files Browse the repository at this point in the history
  • Loading branch information
ghar1821 committed May 25, 2024
1 parent 3b6ff93 commit c567b87
Show file tree
Hide file tree
Showing 72 changed files with 248 additions and 228 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/check-standard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,6 @@ jobs:
- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: false
build_args: 'c("--no-manual")'
build_args: 'c("--no-manual", "--no-examples",
"--no-vignettes", "--no-build-vignettes", "--ignore-vignettes")'
error-on: '"error"'
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Type: Package
Package: Spectre
Title: High-dimensional cytometry and imaging analysis.
Title: High-dimensional cytometry and imaging analysis
Version: 1.2.0-00
Date: 2023-11-12
Authors@R: c(
Expand All @@ -11,7 +11,7 @@ Authors@R: c(
Description: A computational toolkit in R for the integration,
exploration, and analysis of high-dimensional single-cell cytometry
and imaging data.
License: `use_mit_license()`
License: `use_mit_license()` + file LICENSE
URL: https://github.com/ImmuneDynamics/Spectre
BugReports: https://github.com/ImmuneDynamics/Spectre/issues
Depends:
Expand Down
4 changes: 2 additions & 2 deletions R/do.add.cols.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#'
#' @import data.table
#'
#' @export
#' @export do.add.cols

do.add.cols <- function(dat, # the list of dataframes (samples) where each dataframe will have the columns embedded
base.col, # column name in the actual dataset
Expand Down Expand Up @@ -201,7 +201,7 @@ do.add.cols <- function(dat, # the list of dataframes (samples) where each dataf
#'
#' @import data.table
#'
#' @export
#' @export do.embed.columns

do.embed.columns <- function(dat, # the list of dataframes (samples) where each dataframe will have the columns embedded
base.col, # column name in the actual dataset
Expand Down
6 changes: 4 additions & 2 deletions R/do.add.masks.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,18 @@
#' @author Thomas M Ashhurst, \email{thomas.ashhurst@@sydney.edu.au}
#'
#' @references \url{https://github.com/ImmuneDynamics/Spectre}.
#'
#' @usage do.add.masks(dat, mask.dir, mask.pattern, mask.label,correct.extent = TRUE,
#' flip.y = TRUE, value.modifier = 65535, HDF5 = FALSE, array = FALSE)
#'
#' @import data.table
#'
#' @export
#' @export do.add.masks

do.add.masks <- function(dat, # list of spatial objects
mask.dir,
mask.pattern,
mask.label,

correct.extent = TRUE,
flip.y = TRUE,
value.modifier = 65535,
Expand Down
4 changes: 3 additions & 1 deletion R/do.add.percell.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
#' @references \url{https://github.com/ImmuneDynamics/Spectre}.
#'
#' @import data.table
#'
#' @usage do.add.percell(spatial.dat, percell.dat, roi.col, name = "per.cell")
#'
#' @export
#' @export do.add.percell

do.add.percell <- function(spatial.dat,
percell.dat,
Expand Down
2 changes: 1 addition & 1 deletion R/do.aggregate.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#'
#' @import data.table
#'
#' @export
#' @export do.aggregate

do.aggregate <- function(dat,
use.cols,
Expand Down
7 changes: 4 additions & 3 deletions R/do.align.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@
#'
#' @references Ashhurst, T. M., et al. (2019). \url{https://www.ncbi.nlm.nih.gov/pubmed/31077106}
#'
#' @examples
#' aligned.dat <- do.align()
#' @usage do.align(ref.dat, target.dat, batch.col, align.cols, method = "CytoNorm",
#' goal = "mean", nQ = 101, Qmin = 0.01, Qmax = 0.99, write.ref.fcs = TRUE,
#' write.target.fcs = TRUE, mem.ctrl = TRUE)
#'
#' @export
#' @export do.align

do.align <- function(ref.dat,
target.dat,
Expand Down
4 changes: 3 additions & 1 deletion R/do.asinh.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
#' @return A data.table with new columns added, that contain the asinh transformed data.
#'
#' @import data.table
#'
#' @usage do.asinh(dat, use.cols, cofactor=5, append.cf=FALSE, reduce.noise=FALSE)
#'
#' @export
#' @export do.asinh

do.asinh <- function(dat,
use.cols,
Expand Down
6 changes: 5 additions & 1 deletion R/do.calculate.area.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@
#' @param region DEFAULT = NULL. Name of the region mask, if present.
#'
#' @import data.table
#'
#' @usage do.calculate.area(dat, region = NULL)
#'
#' @export
#' @export do.calculate.area
#'
#'

do.calculate.area <- function(dat,
region = NULL){
Expand Down
4 changes: 3 additions & 1 deletion R/do.clip.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
#' @return A data.table with new columns added, that contain the clipped data.
#'
#' @import data.table
#'
#' @usage do.clip(dat, use.cols, min.value = NULL, max.value = NULL, append.name = '_clipped')
#'
#' @export
#' @export do.clip

do.clip <- function(dat,
use.cols,
Expand Down
2 changes: 1 addition & 1 deletion R/do.combine.cols.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#'
#' @author Thomas M Ashhurst, \email{thomas.ashhurst@@sydney.edu.au}
#'
#' @export
#' @export do.combine.cols

do.combine.cols <- function(dat, col1, col2, na.rm = TRUE){

Expand Down
5 changes: 4 additions & 1 deletion R/do.create.outlines.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
#'
#' @import data.table
#'
#' @export
#' @usage do.create.outlines(dat, mask.name, method = 'stars')
#'
#' @export do.create.outlines
#'

do.create.outlines <- function(dat,
mask.name,
Expand Down
4 changes: 3 additions & 1 deletion R/do.extract.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
#' @param fun DEFAULT = 'mean'. Summarisation function.
#'
#' @import data.table
#'
#' @usage do.extract(dat, mask, name = "CellData", fun = "mean")
#'
#' @export
#' @export do.extract

do.extract <- function(dat, # spatial.data object
mask, # name of the mask being summarised
Expand Down
4 changes: 3 additions & 1 deletion R/do.extract.cell.dat.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
#'
#' @import data.table
#'
#' @export
#' @usage do.extract.cell.dat(spatial.dat, target.dat)
#'
#' @export do.extract.cell.dat

do.extract.cell.dat <- function(spatial.dat,
target.dat){
Expand Down
2 changes: 1 addition & 1 deletion R/do.filter.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#'
#' @import data.table
#'
#' @export
#' @export do.filter

do.filter <- function(dat,
use.col,
Expand Down
6 changes: 5 additions & 1 deletion R/do.filter.percell.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
#'
#' @import data.table
#'
#' @export
#' @usage do.filter.percell(spatial.dat, per.cell, to, filter.by,
#' id.col = "ObjectNumber", x.col = "Location_Center_X", y.col = "Location_Center_Y",
#' simplify.cp.colname = TRUE, value.modifier = 65535)
#'
#' @export do.filter.percell

do.filter.percell <- function(spatial.dat,
per.cell,
Expand Down
5 changes: 4 additions & 1 deletion R/do.label.from.polygon.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
#'
#' @import data.table
#'
#' @export
#' @usage do.label.from.polygon(spatial.dat, cell.dat, mask, labels,
#' name = "Label", id.col = 'ID', roi.col = 'ROI')
#'
#' @export do.label.from.polygon

do.label.from.polygon <- function(spatial.dat,
cell.dat,
Expand Down
2 changes: 1 addition & 1 deletion R/do.list.summary.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#'
#' @import data.table
#'
#' @export
#' @export do.list.summary

do.list.summary <- function(dat)

Expand Down
2 changes: 1 addition & 1 deletion R/do.list.switch.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#'
#' @import data.table
#'
#' @export
#' @export do.list.switch

do.list.switch <- function(dat){

Expand Down
13 changes: 7 additions & 6 deletions R/do.logicle.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,15 @@
#'
#' @examples
#' library(Spectre)
#' dat = demo.asinh
#' use.cols = names(dat)[c(2:10)]
#' dat_lgcl = do.logicle(dat, use.cols = use.cols)
#' dat = Spectre::demo.clustered[, 2:9]
#' use.cols = names(dat)
#' do.logicle(dat, use.cols = use.cols)
#'
#' @author
#' Givanna Putri, \email{givanna.haryonoputri@@sydney.edu.au}
#' @usage do.logicle(dat, use.cols, auto.infer.function = TRUE,
#' linearisation.width = 1.2, max.scale.val = 262144, full.transform.width = 4.5,
#' additional.negative.range = 0)
#'
#' @export
#' @export do.logicle

do.logicle <- function(dat,
use.cols,
Expand Down
8 changes: 7 additions & 1 deletion R/do.merge.files.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,15 @@
#' @references \url{https://sydneycytometry.org.au/spectre}.
#'
#' @examples
#' data.list <- list(
#' "01_Mock_01" = Spectre::demo.clustered[Sample == '01_Mock_01'],
#' "02_Mock_02" = Spectre::demo.clustered[Sample == '02_Mock_02']
#' )
#' cell.dat <- do.merge.files(dat = data.list, remove.duplicates = TRUE)
#'
#' @usage do.merge.files(dat, remove.duplicates = TRUE)
#'
#' @export
#' @export do.merge.files

do.merge.files <- function(dat, remove.duplicates = TRUE){

Expand Down
4 changes: 3 additions & 1 deletion R/do.pull.data.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
#' @param target.dat NO DEFAULT. Dataset to pull.
#'
#' @import data.table
#'
#' @usage do.pull.data(spatial.dat, target.dat)
#'
#' @export
#' @export do.pull.data

do.pull.data <- function(spatial.dat,
target.dat){
Expand Down
2 changes: 1 addition & 1 deletion R/do.reorder.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#'
#' @import data.table
#'
#' @export
#' @export do.reorder

do.reorder <- function(dat,
use.col,
Expand Down
8 changes: 6 additions & 2 deletions R/do.rescale.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,17 @@
#' @param use.cols NO DEFAULT. Vector of character column names -- these columns will be normalised and added to the data.table as new columns.
#' @param new.min DEFAULT = 0. The new minimum value.
#' @param new.max DEFAULT = 1. The new maximum value.
#' @param append.name DEFAULT = '_rescaled'. Text to be appended to the column names of re-scaled data.
#' @param append.name DEFAULT = '_rescaled'.
#' Text to be appended to the column names of re-scaled data.
#'
#' @return A data.table with new columns added, that contain the re-scaled data.
#'
#' @import data.table
#'
#' @usage do.rescale(dat, use.cols, new.min = 0, new.max = 1,
#' append.name = '_rescaled')
#'
#' @export
#' @export do.rescale

do.rescale <- function(dat,
use.cols,
Expand Down
4 changes: 3 additions & 1 deletion R/do.stats.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#' Statistical analysis
#'
#' @import data.table
#'
#' @usage NULL
#'
#' @export
#' @export do.stats

do.stats <- function(dat,
use.cols,
Expand Down
6 changes: 3 additions & 3 deletions R/do.subsample.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
#'
#' @examples
#' # Subsample 10,000 cells randomly from the total dataset
#' sub.dat <- Spectre::do.subsample(dat = Spectre::demo.start,
#' sub.dat <- Spectre::do.subsample(dat = Spectre::demo.clustered,
#' targets = 10000)
#'
#' # Subsample based on the sample with the smallest number of cells
#' sub.dat.sample <- Spectre::do.subsample(dat = Spectre::demo.start,
#' sub.dat.sample <- Spectre::do.subsample(dat = Spectre::demo.clustered,
#' divide.by = "FileName",
#' min.per = TRUE)
#'
Expand All @@ -28,7 +28,7 @@
#'
#' @import data.table
#'
#' @export
#' @export do.subsample

do.subsample <- function(dat,
targets,
Expand Down
4 changes: 2 additions & 2 deletions R/do.zscore.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
#' @return Returns a new data.table with z-score calculations for each selected column
#'
#' @examples
#' res <- do.zscore(dat = Spectre::demo.sum, use.cols = names(Spectre::demo.sum)[c(4:15)])
#' do.zscore(dat = Spectre::demo.clustered, use.cols = c("NK11", "CD4"))
#'
#' @import data.table
#'
#' @export
#' @export do.zscore

do.zscore <- function(dat,
use.cols,
Expand Down
19 changes: 5 additions & 14 deletions R/make.colour.plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,25 +40,16 @@
#' @usage make.colour.plot(dat, x.axis, y.axis, col.axis)
#'
#' @examples
#' # Load packages
#' library(Spectre)
#' package.check()
#' package.load()
#'
#' # Read data
#' cell.dat <- Spectre::demo.umap
#' cell.dat <- as.data.table(cell.dat)
#'
#' # Draw plot
#' Spectre::make.colour.plot(dat = cell.dat,
#' x.axis = "UMAP_42_X",
#' y.axis = "UMAP__42Y",
#' col.axis = "BV605.Ly6C")
#' Spectre::make.colour.plot(dat = Spectre::demo.clustered,
#' x.axis = "UMAP_X",
#' y.axis = "UMAP_Y",
#' col.axis = "CD4_asinh")
#'
#'
#' @author
#' Thomas M Ashhurst, \email{thomas.ashhurst@@sydney.edu.au}
#' Givanna Putri, \email{ghar1821@@uni.sydney.edu.au}
#' Givanna Putri
#'
#' @import data.table
#'
Expand Down
Loading

0 comments on commit c567b87

Please sign in to comment.