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