countMarkers: Generate a XLSX file of counts for all markers in a given...

Description Usage Arguments Details

View source: R/marker_counts.R View source: R/old_functions.R

Description

Given a marker file and a directory of *.rda files each containing Halo data for a single sample, generate a XLSX file with multiple sheets of counts, median counts for each marker in each sample, and fractions of counts using alternate "bases" (e.g., DAPI)

Usage

1
2
3
4
countMarkers(markerFile, dataDir, pad = 0, countsXLSXFile = NULL,
  countsRDAFile = NULL, writeXLSXfile = TRUE, saveRDSfile = TRUE,
  runCounts = TRUE, runFracTotal = FALSE, runMedians = TRUE,
  altBases = NULL)

Arguments

markerFile

File containing list of marker names

dataDir

directory of *.rda files containing Halo data

pad

amount that will be trimmed from FOV

countsXLSXFile

name of XLSX file to write to; if NULL, name will be automatically generated according to input file names and padding

countsRDAFile

name of RDA file to write to; if NULL, RDA file will NOT be written

writeXLSXfile

write counts to XLSX file; DEFAULT=TRUE

saveRDSfile

save counts table to RDS file; DEFAULT=TRUE

runCounts

include counts sheet in output; DEFAULT=TRUE

runFracTotal

include fractions of total counts sheet in output; DEFAULT=FALSE

runMedians

include medians of counts for each marker in each sample; DEFAULT=TRUE

altBases

vector of additional markers for which fractions of counts should be calculated; one sheet will be generated for each element

Details

By default, the file will contain at minimum a sheet of counts and a sheet containing fractions of total counts. In all sheets, a column represents a marker and a row represents a single FOV from a single sample.

If a vector of markers is provided (e.g., c("DAPI","CD3")), another sheet will be created for each of them containing the fraction of cells using those markers as "bases". IMPORTANT NOTE: Any altBases in addition to DAPI must be counted ONLY IF DAPI IS POSITIVE AS WELL (e.g., CD3+DAPI+). The names in the output .xlsx file, however will exclude the DAPI+ to avoid redundancy.


caitlinjones/halo documentation built on May 7, 2019, 8 a.m.