Skip to contents

A simple command line interface (CLI) for scdrake is available. It is already installed in the Docker image, otherwise it can be installed with

scdrake::install_cli()

See the above function’s help page for possible parameters. By default, the CLI is installed in user’s home as ~/.local/bin/scdrake.

Using the CLI

You can display the help message by running scdrake or scdrake -h.

The CLI offers several commands which wrap the most frequently used scdrake functions. Some options and flags are command-specific.

The usage is:

scdrake [OPTIONS/FLAGS] <COMMAND>

Current commands are listed below.

<init-project>

Initializes a new scdrake project, by default in the current working directory. It will also download example data if you specify the --download-example-data tag.

Wraps init_project().

<run>

Runs a pipeline according to --pipeline-type parameter which can be currently single_sample or integration.

Wraps run_single_sample_r() and run_integration_r().

<update-project>

Updates the project files, by default in the current working directory.

Wraps update_project().

<download-example-data>

Downloads example data: PBMC 1k and 3k from 10x Genomics.

Wraps download_pbmc1k() and download_pbmc3k().

<check>

Checks for scdrake dependencies.

Wraps check_scdrake().


Technical notes

The CLI actually consists of two scripts:

  • scdrake is a shell script which forwards parameters to r --interactive -t path/to/scdrake.R …
    • r is called littler and it is basically a more friendly and robust alternative to Rscript.
  • scdrake.R is the R part of the CLI and parses command line arguments using the argparser package.
    • We need to run this script interactively, but that can be only achieved with r --interactive and in that case we cannot use the shebang line (#!/usr/bin/env r --interactive) because then the script doesn’t accept additional parameters. That’s why we are using the intermediate shell script.