CLI Guide

library(knitr)
opts_chunk$set(tidy.opts=list(width.cutoff=60),tidy=TRUE)
knitr::opts_chunk$set(comment = "#>", collapse = TRUE)

BaMORC Command Line Interface (CLI) guide

This document describes each command line function built into the BaMORC package.

Overall CLI design

CLIs vary widely. Before diving into the actual command, it is important to understand the general pattern of the CLI commands so that you can construct a complete and coherent command for utilizing BaMORC functions.

The key features of any CLI is the structure of the command. A CLI consists of the following patterns:

  1. Language interpreter,
  2. A script for doing something,
  3. Arguments needed for the script to execute.

You need to be able to construct a command with these components in order to perform the desired CLI call.

BaMORC supports two type of CLI calls: innate R CMD BATCH, which supports all OS platforms, and Linux CLI.

Linux CLI

To use the "BaMORC CLI", you need to find the CLI run-script. Open terminal and type the following code:

> R -e 'system.file("exec", "bamorc.R", package = "BaMORC")'

You will see the R script location printed out in the terminal as shown in following image.

The standard Linux CLI follows the Docopt convention.

CLI syntex: bamorc.R <job> <arguments>

The available tasks in the Linux CLI

Following job can be used:

Valid CLI commands are described below. We will explain the arguments in next session.

Argument syntax: please don't leave a space before or after the =.

The arguments are in -- or - format, for example --ppm_range=<value> and -h.

The helper commands are: bamorc.R -h | --help: print out this CLI help information. bamorc.R -v | --version: print out package version.

Other arguments are divided into required or optional:

Examples:

> ./path-of-r-script/bamorc.R assigned --id=4020 --ppm_range=(-1,1) --output=./output/output.csv --report=./output/report.txt
> ./path-of-r-script/bamorc.R assigned --table=./input.csv --ppm_range=(-1,1) --output=./output/output.csv --report=./output/report.txt
> ./path-of-r-script/bamorc.R unassigned --table=./input.csv --seq=GSIPCLLSPWSEWSDCSVTCGKGMRTRQRMLKSLAELGDCNEDLEQAEKCMLPECP --ppm_range=(-1,1) --output=./output/output.csv --report=./output/report.txt

R CMD BATCH (Windows-friendly)

The R language has its own CLI command pattern via the functionality of R CMD BATCH. At the very beginning of R history, R CMD BATCH was the function handle all the non-interactive calls through the shell.

The patters is simple: R CMD BATCH [arguments-to-pass] [path-of-script.R] $

Here arguments are in the - format, for example -ppm_range=<value>.



Try the BaMORC package in your browser

Any scripts or data that you put into this service are public.

BaMORC documentation built on May 1, 2019, 6:35 p.m.