create.sumtable: create.sumtables - create a data.table 'summarising' cellular...

Description Usage Arguments Author(s) References Examples

View source: R/create.sumtable.R

Description

This function summarises cellular data and generates a summary data.table

Usage

1
create.sumtable(dat, sample.col, pop.col, use.cols, annot.cols, counts, func, sep)

Arguments

dat

NO DEFAULT. A data.table containing cells (rows) vs features/markers (columns). One column must represent sample names, and another must represent populations/clusters.

sample.col

NO DEFAULT. Character. Name of the sample column (e.g. "Sample").

pop.col

NO DEFAULT. Character. Name of the population/cluster column (e.g. "Population", "Cluster").

use.cols

NO DEFAULT. A character vector indicating the columns to be measured (e.g. cellular columns – c("CD45", "CD3e") etc).

annot.cols

DEFAULT = NULL. A character vector indicating the columns to be included as annotation columns (e.g. c("Batch", "Group") etc).

parent.col

DEFAULT = NULL. A character entry indicating a column that represents the 'lineage' each population belongs to (e.g. 'CD4 T cells' may belong to the 'T cells' lineage). Use this to also calculate each population as a percentage of lineage.

counts

DEFAULT = NULL. If you wish to calculate the actual number of cells per sample, a data.table containing the sample names (in column 1) and cell counts per sample (column 2).

perc.pos

DEFAULT = NULL. If you wish to calculate the percentage of each population that is 'positive' for a marker, you can provide a data.table containing the mark names (in column 1) and cut off values for positivity (column 2).

func

DEFAULT = "median". Can be "median" or "mean". Defines the type of function for calculating MFI data.

sep

DEFAULT = " – ". Character separation of the measurement type and the population (e.g. MFI of CD4 – T cells)

Author(s)

Thomas M Ashhurst, thomas.ashhurst@sydney.edu.au

References

https://sydneycytometry.org.au/spectre.

Examples

1
2
3
4
5
6
7
8
9
## Calculate and export results from demonstration data
dat <- Spectre::demo.clustered
counts <- data.frame('Sample' = unique(dat[['Sample']]), 'Counts' = c(rep(100000, 6), rep(1000000, 6)))

sum.dat <- create.sumtable(dat = dat,
                            sample.col = "Sample",
                            pop.col = "Population", 
                            use.cols = names(dat)[c(11:19)],
                            counts = counts)

sydneycytometry/Spectre documentation built on March 20, 2021, 2:15 a.m.