RunRosaceR Documentation

Run Rosace on an Assay/AssaySet object

Description

Rosace operates under the assumption that aligned counts are generated by a time-dependent linear function. This function performs inference using stan under a Bayesian framework to derive the functional score (regression coefficient), error term and parameters phi and sigma.

Usage

RunRosace(object, savedir, mc.cores, debug, install, ...)

## S3 method for class 'AssayGrowth'
RunRosace(
  object,
  savedir,
  mc.cores = 4,
  debug = FALSE,
  install = TRUE,
  pos.label,
  ctrl.label,
  ...
)

## S3 method for class 'AssaySetGrowth'
RunRosace(
  object,
  savedir,
  mc.cores = 4,
  debug = FALSE,
  install = TRUE,
  pos.label,
  ctrl.label,
  ...
)

## S3 method for class 'Rosace'
RunRosace(
  object,
  savedir,
  mc.cores = 4,
  debug = FALSE,
  install = TRUE,
  name,
  type,
  pos.col,
  ctrl.col,
  ctrl.name,
  ...
)

Arguments

object

Rosace, Assay/AssaySet (default)

savedir

directory to save the output

mc.cores

integer, number of cores to use for parallel computing

debug

logical, if TRUE, return a list of cmdstanfit and Score object.

install

logical, if TRUE, install or update cmdstanr There's a chance for Github download error if running multiple instances on a server.

...

Additional arguments to be passed to the run method.

pos.label

vector of true position of variants

ctrl.label

vector of whether variant is in the control group (NA if none provided)

name

Name of the object to be analyzed

type

"Assay" or "AssaySet"

pos.col

For Growth screen, the column name for position in the var.data (optional in no_pos mode)

ctrl.col

For Growth screen, optional for control to have one position index

ctrl.name

For Growth screen, optional, the name of the control type

Details

There are three ways to run the model. If no meta-info of the variant is given, the model treats variant independently. If position info is given, the model will have a position hierarchical layer (grouping variants of the same position together). If an additional control (synonymous) label is given, the model will group the control variants together into one position index.

The debug option will return a list of cmdstanfit object and the final Score object. Users familiar with stan could extract more diagnostics and sampling details from the cmdstanfit object. If a high percentage of divergent transitions exist during sampling, users could debug with this option. However, users not familiar with HMC or stan are recommended to report the error either on GitHub or send an email to the team.

Value

A object with Rosace result (Score object) if debug = FALSE