Learn R Programming

sevenbridges (version 1.2.4)

Tool-class: Rabix CommandLineTool Class

Description

Rabix subclass for CommandLineTool used by rabix.org or sbg platform. Tool class extends CommandLineTool with more seven bridges fields.

Arguments

Value

a Tool object.

Fields

context
[character] by default: "https://github.com/common-workflow-language/common-workflow-language/blob/draft-1/specification/tool-description.md"
owner
[list] a list of owner names.
contributor
[list] a list of contributor names.

Methods

get_input(name = NULL, id = NULL)
get input objects by names or id
input_id(full = FALSE, requiredOnly = FALSE)
get input id from a Tool, when full = TRUE, connect tool id with input id e.g. if requiredOnly = TRUE, returne required field only
output_id(full = FALSE)
get output id from a Tool, when full = TRUE, connect tool id with input id e.g.
run(run_inputs = list(), engine = c("bunny", "rabix", "cwlrun"))
run this tool with inputs locally. engine supported: bunny, rabix, cwlrun. inputs accept list or json

Examples

Run this code
t1 = system.file("extdata/app", "tool_star.json", package = "sevenbridges")
## convert json file into a Tool object
t1 = convert_app(t1)
## get input type information
t1$input_type()
## get output type information
t1$output_type()
## get input id
t1$input_id()
## get full input id with Tool name
t1$input_id(TRUE)
## get output id
t1$output_id()
## get full output id
t1$output_id(TRUE)
## get required input id
t1$get_required()
## set input required
t1$set_required(c("#reads", "winFlankNbins"))
t1$get_required()
t1$set_required("reads", FALSE)
t1$get_required()
t1$get_input(name = "ins")
t1$get_input(id = "#winFlankNbins")
t1$get_output(name = "gene")
t1$get_output(id = "#aligned_reads")
## get a tool from a flow
f1 = system.file("extdata/app", "flow_star.json", package = "sevenbridges")
## convert json file into a Tool object
f1 = convert_app(f1)
t2 = f1$get_tool("STAR$")
oid = t2$get_input_port()
oid
## set new ports
t2$input_id()
t2$set_input_port("#chimScoreSeparation")
t2$get_input_port()
t2$set_input_port("#chimScoreSeparation", FALSE)
t2$get_input_port()
## run the tool locally with example data
## Not run: 
# t3 = system.file("extdata/app/dna2protein", "translate.cwl.json", package = "sevenbridges")
# t3 = convert_app(t3)
# fl = system.file("extdata/app/dna2protein/data", "input.txt", package = "sevenbridges")
# set_test_env("dind", "tengfei/testenv", "~/mounts")
# t3$input_type()
# t3$run(list(input_file = Files(fl))) ## Not File
# ## End(Not run)

Run the code above in your browser using DataLab