diff --git a/docs/404.html b/docs/404.html index cac2a3b..bb558eb 100644 --- a/docs/404.html +++ b/docs/404.html @@ -90,7 +90,7 @@ sevenbridges-r - 1.19.1 + 1.19.2 @@ -175,11 +175,11 @@

Contents

diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index 3cbc3b6..6d0746e 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -90,7 +90,7 @@ sevenbridges-r - 1.19.1 + 1.19.2 @@ -377,11 +377,11 @@

Contents

diff --git a/docs/articles/api.html b/docs/articles/api.html index 534ce67..70da4e5 100644 --- a/docs/articles/api.html +++ b/docs/articles/api.html @@ -44,7 +44,7 @@ sevenbridges-r - 1.19.1 + 1.19.2 @@ -107,12 +107,12 @@ -
+

@@ -159,28 +161,32 @@

Installation

The sevenbridges package is available on both the release and devel branch from Bioconductor.

To install it from the release branch, use:

-
install.packages("BiocManager")
-BiocManager::install("sevenbridges")
+
+install.packages("BiocManager")
+BiocManager::install("sevenbridges")

To install it from the devel branch, use:

-
install.packages("BiocManager")
-BiocManager::install("sevenbridges", version = "devel")
+
+install.packages("BiocManager")
+BiocManager::install("sevenbridges", version = "devel")

Since we are constantly improving our API and client libraries, please also visit our GitHub repository for the most recent news and the latest version of the package.

If you do not have devtools

This installation requires that you have the devtools package. If you do not have this package, you can install it from CRAN.

-
install.packages("devtools")
+
+install.packages("devtools")

You may get an error for missing system dependencies such as curl and openssl. For example, in Ubuntu, you probably need to do the following first to install devtools and to build vignettes since you need pandoc.

apt-get update
 apt-get install libcurl4-gnutls-dev libssl-dev pandoc pandoc-citeproc

If devtools is already installed

Install the latest version for sevenbridges from GitHub with the following:

-
install.packages("BiocManager")
-install.packages("readr")
+
+install.packages("BiocManager")
+install.packages("readr")
 
-devtools::install_github(
+devtools::install_github(
   "sbg/sevenbridges-r",
-  repos = BiocManager::repositories(),
-  build_vignettes = TRUE, dependencies = TRUE
-)
+ repos = BiocManager::repositories(), + build_vignettes = TRUE, dependencies = TRUE +)

If you have trouble with pandoc and do not want to install it, set build_vignettes = FALSE to avoid the vignettes build.

@@ -193,7 +199,8 @@

Create Auth Object

Before you can access your account via the API, you have to provide your credentials. You can obtain your credentials in the form of an “authentication token” from the Developer Tab under Account Settings on the visual interface. Once you’ve obtained this, create an Auth object, so it remembers your authentication token and the path for the API. All subsequent requests will draw upon these two pieces of information.

Let’s load the package first:

-
library("sevenbridges")
+

You have three different ways to provide your token. Choose from one method below:

  1. @@ -206,17 +213,20 @@

    Method 1: Direct authentication

    This is the most common method to construct the Auth object. For example:

    -
    (a <- Auth(platform = "cgc", token = "your_token"))
    +
    +(a <- Auth(platform = "cgc", token = "your_token"))
    Using platform: cgc
     == Auth ==
     url : https://cgc-api.sbgenomics.com/v2/
     token : <your_token>

    Method 2: Environment variables

    To set the two environment variables in your system, you could use the function sbg_set_env(). For example:

    -
    sbg_set_env("https://cgc-api.sbgenomics.com/v2", "your_token")
    +
    +sbg_set_env("https://cgc-api.sbgenomics.com/v2", "your_token")

    Note that this change might be just temporary, please feel free to use the standard method to set persistent environment variables according to your operating system.

    Create an Auth object:

    -
    a <- Auth(from = "env")
    +
    +a <- Auth(from = "env")

    Method 3: User configuration file

    Assume we have already created the configuration file named credentials under the directory $HOME/.sevenbridges/:

    [aws-us-rfranklin]
    @@ -237,9 +247,11 @@ 

    api_endpoint = https://gcp-api.sbgenomics.com/v2 auth_token = token_for_this_user

    To load the user profile aws-us-rfranklin from this configuration file, simply use:

    -
    a <- Auth(from = "file", profile_name = "aws-us-rfranklin")
    +
    +a <- Auth(from = "file", profile_name = "aws-us-rfranklin")

    If profile_name is not specified, we will try to load the profile named [default]:

    -
    a <- Auth(from = "file")
    +
    +a <- Auth(from = "file")

    Note: API paths (base URLs) differ for each Seven Bridges environment. Be sure to provide the correct path for the environment you are using. API paths for some of the environments are:

    @@ -296,7 +308,8 @@

    Get User Information

    Get your own information

    This call returns information about your account.

    -
    a$user()
    +
    +a$user()
    == User ==
     href : https://cgc-api.sbgenomics.com/v2/users/RFranklin
     username : RFranklin
    @@ -310,7 +323,8 @@ 

    Get information about a user

    This call returns information about the specified user. Note that currently you can view only your own user information, so this call is equivalent to the call to get information about your account.

    -
    a$user(username = "RFranklin")
    +
    +a$user(username = "RFranklin")
    top
    @@ -319,7 +333,8 @@

    Rate Limit

    This call returns information about your current rate limit. This is the number of API calls you can make in one hour.

    -
    a$rate_limit()
    +
    +a$rate_limit()
    == Rate Limit ==
     limit : 1000
     remaining : 993
    @@ -333,11 +348,13 @@ 

    Show Billing Information

    Each project must have a Billing Group associated with it. This Billing Group pays for the storage and computation in the project.

    For example, your first project(s) were created with the free funds from the Pilot Funds Billing Group assigned to each user at sign-up. To get information about billing:

    -
    # check your billing info
    -a$billing()
    -a$invoice()
    +
    +# check your billing info
    +a$billing()
    +a$invoice()

    For more information, use breakdown = TRUE.

    -
    a$billing(id = "your_billing_id", breakdown = TRUE)
    +
    +a$billing(id = "your_billing_id", breakdown = TRUE)
    top
    @@ -347,10 +364,11 @@

    Create Project

    Projects are the core building blocks of the platform. Each project corresponds to a distinct scientific investigation, serving as a container for its data, analysis tools, results, and collaborators.

    Create a new project called “api testing” with the billing group id obtained above.

    -
    # get billing group id
    -bid <- a$billing()$id
    +
    +# get billing group id
    +bid <- a$billing()$id
     # create new project
    -(p <- a$project_new(name = "api testing", bid, description = "Just a test"))
    +(p <- a$project_new(name = "api testing", bid, description = "Just a test"))
    == Project ==
     id : RFranklin/api-testing
     name : api testing
    @@ -365,14 +383,15 @@ 

    Get Details about Existing Project

    -
    # list first 100
    -a$project()
    +
    +# list first 100
    +a$project()
     # list all
    -a$project(complete = TRUE)
    +a$project(complete = TRUE)
     # return all named match "demo"
    -a$project(name = "demo", complete = TRUE)
    +a$project(name = "demo", complete = TRUE)
     # get the project you want by id
    -p <- a$project(id = "RFranklin/api-tutorial")
    +p <- a$project(id = "RFranklin/api-tutorial")
    top
    @@ -386,25 +405,27 @@

  2. Browse them online. Check out the tutorial for the “Find apps” section.
  3. You can use the sevenbridges package to find it, as shown below.
  4. -
    # search by name matching, complete = TRUE search all apps,
    +
    +# search by name matching, complete = TRUE search all apps,
     # not limited by offset or limit.
    -a$public_app(name = "STAR", complete = TRUE)
    +a$public_app(name = "STAR", complete = TRUE)
     # search by id is accurate
    -a$public_app(id = "admin/sbg-public-data/rna-seq-alignment-star/5")
    +a$public_app(id = "admin/sbg-public-data/rna-seq-alignment-star/5")
     # you can also get everything
    -a$public_app(complete = TRUE)
    +a$public_app(complete = TRUE)
     # default limit = 100, offset = 0 which means the first 100
    -a$public_app()
    +a$public_app()

    Now, from your Auth object, you copy an App id into your project id with a new name, following this logic.

    -
    # copy
    -a$copy_app(
    -  id = "admin/sbg-public-data/rna-seq-alignment-star/5",
    -  project = "RFranklin/api-testing", name = "new copy of star"
    -)
    +
    +# copy
    +a$copy_app(
    +  id = "admin/sbg-public-data/rna-seq-alignment-star/5",
    +  project = "RFranklin/api-testing", name = "new copy of star"
    +)
     # check if it is copied
    -p <- a$project(id = "RFranklin/api-testing")
    +p <- a$project(id = "RFranklin/api-testing")
     # list apps your got in your project
    -p$app()
    +p$app()

    The short name is changed to newcopyofstar.

    == App ==
     id : RFranklin/api-testing/newcopyofstar/0
    @@ -412,11 +433,12 @@ 

    project : RFranklin/api-testing-2 revision : 0

    Alternatively, you can copy it from the app object.

    -
    app <- a$public_app(id = "admin/sbg-public-data/rna-seq-alignment-star")
    -app$copy_to(
    -  project = "RFranklin/api-testing",
    -  name = "copy of star"
    -)
    +
    +app <- a$public_app(id = "admin/sbg-public-data/rna-seq-alignment-star")
    +app$copy_to(
    +  project = "RFranklin/api-testing",
    +  name = "copy of star"
    +)
    top
    @@ -426,10 +448,11 @@

    Import CWL App and Run a Task

    You can also upload your own Common Workflow Language JSON file which describes your app to your project.

    Note: Alternatively, you can directly describe your CWL tool in R with this package. Please read the vignette on “Describe CWL Tools/Workflows in R and Execution”.

    -
    # add an CWL file to your project
    -f.star <- system.file("extdata/app", "flow_star.json", package = "sevenbridges")
    -app <- p$app_add("starlocal", fl.runif)
    -(aid <- app$id)
    +
    +# add an CWL file to your project
    +f.star <- system.file("extdata/app", "flow_star.json", package = "sevenbridges")
    +app <- p$app_add("starlocal", fl.runif)
    +(aid <- app$id)

    You will get an app id, like the one below:

    "RFranklin/api-testing/starlocal/0"

    It’s composed of the following elements:

    @@ -445,11 +468,12 @@

    Alternatively, you can describe tools in R directly, as shown below:

    -
    fl <- system.file("docker", "sevenbridges/rabix/generator.R",
    -  package = "sevenbridges"
    -)
    -cat(readLines(fl), sep = "\n")
    -
    library("sevenbridges")
    +
    +fl <- system.file("docker", "sevenbridges/rabix/generator.R",
    +  package = "sevenbridges"
    +)
    +cat(readLines(fl), sep = "\n")
    +
    library("sevenbridges")
     
     in.lst <- list(
       input(
    @@ -517,9 +541,10 @@ 

    fl <- "inst/docker/sevenbridges/rabix/runif.json" write(rbx$toJSON(pretty = TRUE), fl)

    Then, you can add it like this:

    -
    # rbx is the object returned by `Tool` function
    -app <- p$app_add("runif", rbx)
    -(aid <- app$id)
    +
    +# rbx is the object returned by `Tool` function
    +app <- p$app_add("runif", rbx)
    +(aid <- app$id)

    Please consult another tutorial vignette("apps", "sevenbridges") about how to describe tools and flows in R.

    top @@ -540,17 +565,19 @@

  5. The inputs for your workflow. In this case, the CWL app accepts four parameters: number, min, max, and seed.
  6. You can always check the App details on the visual interface for task input requirements. To find the required inputs with R, you need to get an App object first.

    -
    app <- a$app(id = "RFranklin/api-testing-2/newcopyofstar")
    +
    +app <- a$app(id = "RFranklin/api-testing-2/newcopyofstar")
     # get input matrix
    -app$input_matrix()
    -app$input_matrix(c("id", "label", "type"))
    +app$input_matrix()
    +app$input_matrix(c("id", "label", "type"))
     # get required node only
    -app$input_matrix(c("id", "label", "type"), required = TRUE)
    +app$input_matrix(c("id", "label", "type"), required = TRUE)

    Conversely, you can load the app from a CWL JSON and convert it into an R object first, as shown below.

    -
    f1 <- system.file("extdata/app", "flow_star.json", package = "sevenbridges")
    -app <- convert_app(f1)
    +
    +f1 <- system.file("extdata/app", "flow_star.json", package = "sevenbridges")
    +app <- convert_app(f1)
     # get input matrix
    -app$input_matrix()
    +app$input_matrix()
    ##                                id                    label    type required
     ## 1                    #sjdbGTFfile              sjdbGTFfile File...    FALSE
     ## 2                          #fastq                    fastq File...     TRUE
    @@ -567,7 +594,8 @@ 

    ## 5 null ## 6 null ## 7 null

    -
    app$input_matrix(c("id", "label", "type"))
    +
    +app$input_matrix(c("id", "label", "type"))
    ##                                id                    label    type
     ## 1                    #sjdbGTFfile              sjdbGTFfile File...
     ## 2                          #fastq                    fastq File...
    @@ -576,20 +604,22 @@ 

    ## 5 #sjdbGTFtagExonParentGene Gene name string ## 6 #winAnchorMultimapNmax Max loci anchors int ## 7 #winAnchorDistNbins Max bins between anchors int

    -
    app$input_matrix(c("id", "label", "type"), required = TRUE)
    +
    +app$input_matrix(c("id", "label", "type"), required = TRUE)
    ##                  id            label    type
     ## 2            #fastq            fastq File...
     ## 3 #genomeFastaFiles genomeFastaFiles    File

    Note that input_matrix and output_matrix are useful accessors for Tool, Flow, you can call these two function on a JSON file directly as well.

    -
    tool.in <- system.file("extdata/app", "tool_unpack_fastq.json", package = "sevenbridges")
    -flow.in <- system.file("extdata/app", "flow_star.json", package = "sevenbridges")
    -input_matrix(tool.in)
    -input_matrix(tool.in, required = TRUE)
    -input_matrix(flow.in)
    -input_matrix(flow.in, c("id", "type"))
    -input_matrix(flow.in, required = TRUE)
    -output_matrix(tool.in)
    -output_matrix(flow.in)
    +
    +tool.in <- system.file("extdata/app", "tool_unpack_fastq.json", package = "sevenbridges")
    +flow.in <- system.file("extdata/app", "flow_star.json", package = "sevenbridges")
    +input_matrix(tool.in)
    +input_matrix(tool.in, required = TRUE)
    +input_matrix(flow.in)
    +input_matrix(flow.in, c("id", "type"))
    +input_matrix(flow.in, required = TRUE)
    +output_matrix(tool.in)
    +output_matrix(flow.in)

    In the response body, locate the names of the required inputs. Note that task inputs need to match the expected data type and name. In the above example, we see two required fields:

    • @@ -618,21 +648,22 @@

      Get your input files ready

      -
      fastqs <- c("SRR1039508_1.fastq", "SRR1039508_2.fastq")
      +
      +fastqs <- c("SRR1039508_1.fastq", "SRR1039508_2.fastq")
       
       # get all 2 exact files
      -fastq_in <- p$file(name = fastqs, exact = TRUE)
      +fastq_in <- p$file(name = fastqs, exact = TRUE)
       
       # get a single file
      -fasta_in <- p$file(
      -  name = "Homo_sapiens.GRCh38.dna.primary_assembly.fa",
      -  exact = TRUE
      -)
      +fasta_in <- p$file(
      +  name = "Homo_sapiens.GRCh38.dna.primary_assembly.fa",
      +  exact = TRUE
      +)
       # get all single file
      -gtf_in <- p$file(
      -  name = "Homo_sapiens.GRCh38.84.gtf",
      -  exact = TRUE
      -)
      +gtf_in <- p$file( + name = "Homo_sapiens.GRCh38.84.gtf", + exact = TRUE +)
      top
      @@ -640,58 +671,61 @@

      Create a new draft task

      -
      # add new tasks
      -taskName <- paste0("RFranklin-star-alignment ", date())
      -
      -tsk <- p$task_add(
      -  name = taskName,
      -  description = "star test",
      -  app = "RFranklin/api-testing-2/newcopyofstar/0",
      -  inputs = list(
      -    sjdbGTFfile = gtf_in,
      -    fastq = fastq_in,
      -    genomeFastaFiles = fasta_in
      -  )
      -)
      +
      +# add new tasks
      +taskName <- paste0("RFranklin-star-alignment ", date())
      +
      +tsk <- p$task_add(
      +  name = taskName,
      +  description = "star test",
      +  app = "RFranklin/api-testing-2/newcopyofstar/0",
      +  inputs = list(
      +    sjdbGTFfile = gtf_in,
      +    fastq = fastq_in,
      +    genomeFastaFiles = fasta_in
      +  )
      +)

      Remember the fastq input expects a list of files. You can also do something as follows:

      -
      f1 <- p$file(name = "SRR1039508_1.fastq", exact = TRUE)
      -f2 <- p$file(name = "SRR1039508_2.fastq", exact = TRUE)
      +
      +f1 <- p$file(name = "SRR1039508_1.fastq", exact = TRUE)
      +f2 <- p$file(name = "SRR1039508_2.fastq", exact = TRUE)
       # get all 2 exact files
      -fastq_in <- list(f1, f2)
      +fastq_in <- list(f1, f2)
       
       # or if you know you only have 2 files whose names match SRR924146*.fastq
      -fastq_in <- p$file(name = "SRR1039508*.fastq", complete = TRUE)
      +fastq_in <- p$file(name = "SRR1039508*.fastq", complete = TRUE)

      Use complete = TRUE when the number of items is over 100.

      Draft a batch task

      Now let’s do a batch with 8 files in 4 groups, which is batched by metadata sample_id and library_id. We will assume each file has these two metadata fields entered. Since these files can be evenly grouped into 4, we will have a single parent batch task with 4 child tasks.

      -
      fastqs <- c(
      +
      +fastqs <- c(
         "SRR1039508_1.fastq", "SRR1039508_2.fastq", "SRR1039509_1.fastq",
         "SRR1039509_2.fastq", "SRR1039512_1.fastq", "SRR1039512_2.fastq",
         "SRR1039513_1.fastq", "SRR1039513_2.fastq"
      -)
      +)
       
       # get all 8 files
      -fastq_in <- p$file(name = fastqs, exact = TRUE)
      +fastq_in <- p$file(name = fastqs, exact = TRUE)
       # can also try to returned all SRR*.fastq files
       # fastq_in <- p$file(name= "SRR*.fastq", complete = TRUE)
       
      -tsk <- p$task_add(
      -  name = taskName,
      -  description = "Batch Star Test",
      -  app = "RFranklin/api-testing-2/newcopyofstar/0",
      -  batch = batch(
      -    input = "fastq",
      -    criteria = c("metadata.sample_id", "metadata.noexist_id")
      -  ),
      -  inputs = list(
      -    sjdbGTFfile = gtf_in,
      -    fastq = fastqs_in,
      -    genomeFastaFiles = fasta_in
      -  )
      -)
      +tsk <- p$task_add( + name = taskName, + description = "Batch Star Test", + app = "RFranklin/api-testing-2/newcopyofstar/0", + batch = batch( + input = "fastq", + criteria = c("metadata.sample_id", "metadata.noexist_id") + ), + inputs = list( + sjdbGTFfile = gtf_in, + fastq = fastqs_in, + genomeFastaFiles = fasta_in + ) +)

      Now you have a draft batch task. Please check it out in the visual interface. Your response body should inform you of any errors or warnings.

      Note: you can also directly pass file id or file names as characters to inputs list, the package will first guess if the passed strings are file id (24-bit hexadecimal) or names, then convert it to Files or FilesList object. However, as a good practice, we recommend you construct your files object(e.g. p$file(id = ..., name = ...)) first, check the value, then pass it to task_add inputs. This is a safer approach.

      @@ -703,20 +737,24 @@

      Run a Task

      Now, we are ready to run our task.

      -
      # run your task
      -tsk$run()
      +
      +# run your task
      +tsk$run()

      Before you run your task, you can adjust your draft task if you have any final modifications. Alternatively, you can delete the draft task if you no longer wish to run it.

      -
      # # not run
      -# tsk$delete()
      +
      +# # not run
      +# tsk$delete()

      After you run a task, you can abort it.

      -
      # abort your task
      -tsk$abort()
      +
      +# abort your task
      +tsk$abort()

      If you want to update your task and then re-run it, follow the example below.

      -
      tsk$getInputs()
      +
      +tsk$getInputs()
       # missing number input, only update number
      -tsk$update(inputs = list(sjdbGTFfile = "some new file"))
      +tsk$update(inputs = list(sjdbGTFfile = "some new file"))
       # double check
      -tsk$getInputs()
      +tsk$getInputs()
      top
      @@ -726,19 +764,21 @@

      Run tasks using spot instances

      Running tasks with spot instances could potentially reduce a considerable amount of computational cost. This option can be controlled on the project level or the task level on Seven Bridges platforms. Our package follows the same logic as our platform’s web interface (the current default setting for spot instances is on).

      For example, when we create a project using project_new(), we can set use_interruptible = FALSE to use on-demand instances (non-interruptible but more expensive) instead of the spot instances (interruptible but cheaper):

      -
      p <- a$project_new(
      -  name = "spot-disabled-project", bid, description = "spot disabled project",
      -  use_interruptible = FALSE
      -)
      +
      +p <- a$project_new(
      +  name = "spot-disabled-project", bid, description = "spot disabled project",
      +  use_interruptible = FALSE
      +)

      Then all the new tasks created under this project will use on-demand instances to run by default, unless an argument use_interruptible_instances is specifically set to TRUE when drafting the new task using task_add().

      For example, if p is the above spot disabled project, to draft a task that will use spot instances to run:

      -
      tsk <- p$task_add(
      -  name = paste0("spot enabled task in a spot disabled project"),
      -  description = "spot enabled task",
      -  app = ...,
      -  inputs = list(...),
      -  use_interruptible_instances = TRUE
      -)
      +
      +tsk <- p$task_add(
      +  name = paste0("spot enabled task in a spot disabled project"),
      +  description = "spot enabled task",
      +  app = ...,
      +  inputs = list(...),
      +  use_interruptible_instances = TRUE
      +)

      Conversely, you can have a spot instance enabled project, but draft and run specific tasks using on-demand instances, by setting use_interruptible_instances = FALSE in task_add() explicitly.

      @@ -746,39 +786,45 @@

      Execution hints per task run

      During workflow development and benchmarking, sometimes we need to view and make adjustments to the computational resources needed for a task to run more efficiently. Also, if a task fails due to resource deficiency, we often want to define a larger instance for the task re-run without editing the app itself. This is particularly important in cases where there is not enough disk space.

      The Seven Bridges API allows setting specific task execution parameters by using execution_settings. It includes the instance type (instance_type) and the maximum number of parallel instances (max_parallel_instances):

      -
      tsk <- p$task_add(
      -  ...,
      -  execution_settings = list(
      -    instance_type = "c4.2xlarge;ebs-gp2;2000",
      -    max_parallel_instances = 2
      -  )
      -)
      +
      +tsk <- p$task_add(
      +  ...,
      +  execution_settings = list(
      +    instance_type = "c4.2xlarge;ebs-gp2;2000",
      +    max_parallel_instances = 2
      +  )
      +)

      For details about execution_settings, please check create a new draft task.

      Task Monitoring

      To monitor your task as it runs, you can always request a task update to ask your task to report its status. Or, you can monitor a running task with a hook function, which triggers the function when that status is “completed”. Please check the details in section below.

      -
      tsk$update()
      +
      +tsk$update()

      By default, your task alerts you by email when it has been completed.

      -
      # Monitor your task (skip this part)
      -# tsk$monitor()
      +
      +# Monitor your task (skip this part)
      +# tsk$monitor()

      Use the following to download all files from a completed task.

      -
      tsk$download("~/Downloads")
      +
      +tsk$download("~/Downloads")

      Instead of the default task monitor action, you can use setTaskHook to connect a function call to the status of a task. When you run tsk$monitor(time = 30) it will check your task every 30 seconds to see if the current task status matches one of the following statuses: “queued”, “draft”, “running”, “completed”, “aborted”, and “failed”. When it finds a match for the task status, getTaskHook returns the function call for the specific status.

      -
      getTaskHook("completed")
      +
      +getTaskHook("completed")
      ## function(...) {
       ##           cat("\r", "completed")
       ##           return(TRUE)
       ##         }
      -## <environment: 0x7ff6d69367f0>
      +## <environment: 0x7f8e8929a698>

    If you want to customize the monitor function, you can adjust the following requirement. Your function must return TRUE or FALSE in the end. When it is TRUE (or non-logical value) it means the monitoring will be terminated after it finds a status matched and the function executes, such as when the task is completed. When it is FALSE, it means the monitoring will continue for the next iteration of checking, e.g., when it is “running”, you want to keep tracking.

    Follow the example below to set a new function to monitor the status “completed”. Then, when the task is completed, it will download all task output files to the local folder.

    -
    setTaskHook("completed", function() {
    -  tsk$download("~/Downloads")
    -  return(TRUE)
    -})
    -tsk$monitor()
    +
    +setTaskHook("completed", function() {
    +  tsk$download("~/Downloads")
    +  return(TRUE)
    +})
    +tsk$monitor()
    top
    @@ -811,17 +857,20 @@

    Direct authentication

    To use direct authentication, users need to specify one of platform or url, with the corresponding token. Examples of direct authentication:

    -
    a <- Auth(
    -  token = "your_token",
    -  platform = "aws-us"
    -)
    +
    +a <- Auth(
    +  token = "your_token",
    +  platform = "aws-us"
    +)

    The above will use the Seven Bridges Platform on AWS (US).

    -
    a <- Auth(
    -  token = "your_token",
    -  url = "https://gcp-api.sbgenomics.com/v2"
    -)
    +
    +a <- Auth(
    +  token = "your_token",
    +  url = "https://gcp-api.sbgenomics.com/v2"
    +)

    The above will use the specified url as the base URL for the API calls. In this example, the url points to the Seven Bridges Platform on Google Cloud Platform (GCP).

    -
    a <- Auth(token = "your_token")
    +
    +a <- Auth(token = "your_token")

    The above will use the Cancer Genomics Cloud environment since no platform nor url were explicitly specified (not recommended).

    Note: platform and url should not be specified at the same time.

    @@ -833,20 +882,24 @@

    Authentication via system environment variables

    The R API client supports reading authentication information stored in system environment variables.

    To set the two environment variables in your system, you could use the function sbg_set_env(). For example:

    -
    sbg_set_env(
    -  url = "https://cgc-api.sbgenomics.com/v2",
    -  token = "your_token"
    -)
    +
    +sbg_set_env(
    +  url = "https://cgc-api.sbgenomics.com/v2",
    +  token = "your_token"
    +)

    See if the environment variables are correctly set:

    -
    sbg_get_env("SB_API_ENDPOINT")
    +
    +sbg_get_env("SB_API_ENDPOINT")
     ## "https://cgc-api.sbgenomics.com/v2"
    -sbg_get_env("SB_AUTH_TOKEN")
    -## "your_token"
    +sbg_get_env("SB_AUTH_TOKEN") +## "your_token"

    To create an Auth object:

    -
    a <- Auth(from = "env")
    +
    +a <- Auth(from = "env")

    To unset the two environment variables:

    -
    Sys.unsetenv("SB_API_ENDPOINT")
    -Sys.unsetenv("SB_AUTH_TOKEN")
    +
    +Sys.unsetenv("SB_API_ENDPOINT")
    +Sys.unsetenv("SB_AUTH_TOKEN")
    top
    @@ -874,14 +927,17 @@

    auth_token = token_for_this_user

    Please make sure to have two fields exactly named as api_endpoint and auth_token under each profile.

    To load the default profile (named [default]) from the default user configuration file ($HOME/.sevenbridges/credentials), please use:

    -
    a <- Auth(from = "file")
    +
    +a <- Auth(from = "file")

    To load the user profile aws-us-rfranklin from this configuration file, change the profile_name:

    -
    a <- Auth(from = "file", profile_name = "aws-us-rfranklin")
    +
    +a <- Auth(from = "file", profile_name = "aws-us-rfranklin")

    To use a user configuration file from other locations (not recommended), please specify the file path using the argument config_file. For example:

    -
    a <- Auth(
    -  from = "file", config_file = "~/sevenbridges.cfg",
    -  profile_name = "aws-us-rfranklin"
    -)
    +
    +a <- Auth(
    +  from = "file", config_file = "~/sevenbridges.cfg",
    +  profile_name = "aws-us-rfranklin"
    +)

    Note: If you edited the credentials file, please use Auth() to re-authenticate.

    top @@ -892,7 +948,8 @@

    List All API Calls

    If you did not pass any parameters to api() from Auth, it would list all API calls. Any parameters you provide will be passed to the api() function, but you do not have to pass your input token and path once more since the Auth object already has this information. The following call from the Auth object will check the response as well.

    -
    a$api()
    +
    +a$api()
    top
    @@ -912,8 +969,9 @@

    limit defines the number of items you want to get.

    By default, offset is set to 0 and limit is set to 50. As such, your API request returns the first 100 items when you list items or search for items by name. To search and list all items, use complete = TRUE in your API request.

    -
    getOption("sevenbridges")$offset
    -getOption("sevenbridges")$limit
    +
    +getOption("sevenbridges")$offset
    +getOption("sevenbridges")$limit
    top
    @@ -931,19 +989,20 @@

    Search by name

    Search by name returns all partial matches unless you specify exact = TRUE. This type of search will only search across current pulled content, so use complete = TRUE if you want to search across everything.

    For example, to list all public apps, use visibility argument, but make sure you pass complete = TRUE to it, to show everything. This arguments generally works for items like “App”, “Project”, “Task”, “File”, etc.

    -
    # first, search by id is fast
    -x <- a$app(visibility = "public", id = "admin/sbg-public-data/sbg-ucsc-b37-bed-converter/1")
    +
    +# first, search by id is fast
    +x <- a$app(visibility = "public", id = "admin/sbg-public-data/sbg-ucsc-b37-bed-converter/1")
     
     # show 100 items from public
    -x <- a$app(visibility = "public")
    -length(x) # 100
    +x <- a$app(visibility = "public")
    +length(x) # 100
     
    -x <- a$app(visibility = "public", complete = TRUE)
    -length(x) # 272 by Nov 2016
    +x <- a$app(visibility = "public", complete = TRUE)
    +length(x) # 272 by Nov 2016
     # this return nothing, because it is not in the first 100 returned names
    -a$app(visibility = "public", name = "bed converter")
    +a$app(visibility = "public", name = "bed converter")
     # this return an app, because it pulls *all* app names and did search
    -a$app(visibility = "public", name = "bed converter", complete = TRUE)
    +a$app(visibility = "public", name = "bed converter", complete = TRUE)
    top
    @@ -953,31 +1012,37 @@

    Experiment with Advance Access features

    Similar to offset and limit, every API call accepts an argument named advance_access. This argument was first introduced in August 2017 and controls if a special field in the HTTP request header will be sent, which can enable the access to the “Advance Access” features in the Seven Bridges API. Note that the Advance Access features in the API are not officially released yet, therefore the API usages are subject to change, so please use with discretion.

    In addition to modifying each API call that uses Advance Access features, the option can also be set globally at the beginning of your API script. This offers a one-button switch for users who want to experiment with the Advance Access features. The option is disabled by default:

    -
    library("sevenbridges")
    -getOption("sevenbridges")$advance_access
    +
    +library("sevenbridges")
    +getOption("sevenbridges")$advance_access
    ## [1] FALSE

    For example, the Markers API is in Advance Access as of November 2018. If we try to use the Markers API to list markers available on a BAM file with the advance_access option disabled, it will return an error message:

    -
    req <- api(
    -  token = "your_token", path = "genome/markers?file={bam_file_id}",
    -  method = "GET"
    -)
    +
    +req <- api(
    +  token = "your_token", path = "genome/markers?file={bam_file_id}",
    +  method = "GET"
    +)
     
    -httr::content(req)$"message"
    +httr::content(req)$"message"
    ## [1] "Advance access feature needs X-SBG-Advance-Access: advance header."

    To enable the Advance Access features, one can use

    -
    opt <- getOption("sevenbridges")
    -opt$advance_access <- TRUE
    -options(sevenbridges = opt)
    +
    +opt <- getOption("sevenbridges")
    +opt$advance_access <- TRUE
    +options(sevenbridges = opt)

    at the beginning of their scripts. Let’s check if the option has been enabled:

    -
    getOption("sevenbridges")$advance_access
    +
    +getOption("sevenbridges")$advance_access
    ## [1] TRUE

    Send the API call again:

    -
    req <- api(
    -  token = "your_token", path = "genome/markers?file={bam_file_id}",
    -  method = "GET"
    -)
    +
    +req <- api(
    +  token = "your_token", path = "genome/markers?file={bam_file_id}",
    +  method = "GET"
    +)

    The information of the markers available on that BAM file will be returned:

    -
    httr::content(req)
    +
    +httr::content(req)
    $href
     [1] "https://api.sbgenomics.com/v2/genome/markers?file={bam_file_id}&offset=0&limit=2"
     
    @@ -1019,20 +1084,21 @@ 

    1. No fields parameter specified: calls return default fields. For calls that return complete details of a single resource, this is all their properties; for calls that list resources of a certain type, this is some default properties.

    2. The fields parameter can be set to a list of fields: for example, to return the fields id, name and size for files in a project, you may issue the call p$file(fields = "id,name,size")

    3. -
    4. The fields parameter can be used to exclude a specific file: if you wish to omit certain field from the response, do so using the fields parameter with the prefix !. For example, to get the details of a file without listing its metadata, issue a call p$file(fields = '!metadata') The entire metadata field will be removed from the response.

    5. +
    6. The fields parameter can be used to exclude a specific file: if you wish to omit certain field from the response, do so using the fields parameter with the prefix !. For example, to get the details of a file without listing its metadata, issue a call p$file(fields = '!metadata') The entire metadata field will be removed from the response.

    7. The fields parameter can be used to include or omit certain nested fields, in the same way as listed in 2 and 3 above: for example, you can use metadata.sample_id or origin.task for files.

    8. To see all fields for a resource, specify fields="_all". This returns all fields for each resource returned. Note that if you are getting the details of a specific resource, the use of fields="_all" won’t return any more properties than would have been shown without this parameter — the use case is instead for when you are listing details of many resources. Please use with care if your resource has particularly large fields; for example, the raw field for an app resource contains the complete CWL specification of the app which can result in bulky response if listing many apps.

    9. Negations and nesting can be combined freely, so, for example, you can issue p$file(fields="id,name,status,!metadata.library,!origin") or p$task(fields="!inputs,!outputs").

    Please try the following examples.

    -
    ## default fields id, name, project
    -p$file()
    +
    +## default fields id, name, project
    +p$file()
     ## return file(s) with id, name, siae information
    -p$file(fields = "id,name,size")
    +p$file(fields = "id,name,size")
     ## return file(s) with all available info
    -p$file(detail = TRUE)
    +p$file(detail = TRUE)
     ## same as above
    -p$file(fields = "_all")
    +p$file(fields = "_all")
    top
    @@ -1041,7 +1107,8 @@

    Rate Limits

    This call returns information about your current rate limit. This is the number of API calls you can make in one hour.

    -
    a$rate_limit()
    +
    +a$rate_limit()
    top
    @@ -1051,10 +1118,11 @@

    Users

    This call returns a list of the resources, such as projects, billing groups, and organizations, that are accessible to you. Currently, this call will only return a successful response if {username} is replaced with your own username. Be sure to capitalize your username in the same way as when you registered for an account.

    If you did not provide a username, it will show your user information.

    -
    # return your information
    -a$user()
    +
    +# return your information
    +a$user()
     # return user RFranklin's information
    -a$user("RFranklin")
    +a$user("RFranklin")
    top
    @@ -1066,9 +1134,10 @@

    For billing

    If no billing group id is provided, this call returns a list of paths used to access billing information via the API. If a username is provided, this call lists all your billing groups, including groups that are pending or which have been disabled. If you specify breakdown = TRUE, the call below returns a breakdown of the spending per-project for the billing group specified by billing_group. Information is also displayed for each of the projects a particular billing group is associated with, including task executions, their initiating user, start and end time, and their cost.

    -
    # return a BillingList object
    -(b <- a$billing())
    -a$billing(id = b$id, breakdown = TRUE)
    +
    +# return a BillingList object
    +(b <- a$billing())
    +a$billing(id = b$id, breakdown = TRUE)
    top
    @@ -1077,8 +1146,9 @@

    For invoices

    If no Billing Group id provided, This call returns a list of invoices, with information about each, including whether or not the invoice is pending and the billing period it covers. This call returns information about all your available invoices unless you use the query parameter bg_id to specify the ID of a particular Billing Group, in which case it will return the invoice incurred by that Billing Group only. If an invoice id is provided, this call retrieves information about the specified invoice, including the costs for analysis and storage and the invoice period.

    -
    a$invoice()
    -a$invoice(id = "your_id")
    +
    +a$invoice()
    +a$invoice(id = "your_id")

    Note: Currently, invoice is not an object. Instead, it just returns a regular R list.

    top @@ -1096,12 +1166,15 @@

    List all projects

    The following call returns a list of all projects of which you are a member. Each project’s project_id and the path will be returned.

    -
    a$project()
    +
    +a$project()

    If you want to list the projects owned by and accessible to a particular user, specify the owner argument as follows. Each project’s ID and path will be returned.

    -
    a$project(owner = "RFranklin")
    -a$project(owner = "Rosalind.Franklin")
    +
    +a$project(owner = "RFranklin")
    +a$project(owner = "Rosalind.Franklin")

    To get details about the project(s), use detail = TRUE, as shown below.

    -
    a$project(detail = TRUE)
    +
    +a$project(detail = TRUE)
    top
    @@ -1110,8 +1183,9 @@

    Partial match project name

    For a more friendly interface and convenient search, the sevenbridges package supports partial name matching. The first argument for the following request is name.

    -
    # want to return a project called
    -a$project("hello")
    +
    +# want to return a project called
    +a$project("hello")
    top
    @@ -1120,20 +1194,21 @@

    Filter by project creation date, modification date, and creator

    Project creation date, modification date, and creator information is useful for quickly locating the project you need, especially when you want to follow the life cycle of a large number of projects and distinguish recent projects from old ones. To facilitate such needs, the fields created_by, created_on, and modified_on are returned in the project query calls:

    -
    # return all projects matching the name "wgs"
    -p <- a$project("wgs", complete = TRUE)
    +
    +# return all projects matching the name "wgs"
    +p <- a$project("wgs", complete = TRUE)
     
     # filter by project creators
    -creators <- sapply(p, "[[", "created_by")
    -which(creator == "RFranklin")
    +creators <- sapply(p, "[[", "created_by")
    +which(creator == "RFranklin")
     
     # filter by project creation date
    -create_date <- as.Date(sapply(p, "[[", "created_on"))
    -which(as.Date(create_date) < as.Date("2019-01-01"))
    +create_date <- as.Date(sapply(p, "[[", "created_on"))
    +which(as.Date(create_date) < as.Date("2019-01-01"))
     
     # filter by project modification date
    -modify_date <- as.Date(sapply(p, "[[", "modified_on"))
    -which(as.Date(modify_date) < as.Date("2019-01-01"))
    +modify_date <- as.Date(sapply(p, "[[", "modified_on")) +which(as.Date(modify_date) < as.Date("2019-01-01"))
    top
    @@ -1154,9 +1229,10 @@

  7. type (optional): By default, we create a V2, CWL compatible project.
  8. -
    a$project_new("api_testing_tcga", b$id,
    -  description = "Test for API"
    -)
    +
    +a$project_new("api_testing_tcga", b$id,
    +  description = "Test for API"
    +)
    top
    @@ -1165,9 +1241,10 @@

    Create a new project with TCGA controlled data on CGC

    Follow the directions above, but pass tcga as a value for tags.

    -
    a$project_new("controlled_project", b$id,
    -  description = "Test for API", tags = list("tcga")
    -)
    +
    +a$project_new("controlled_project", b$id,
    +  description = "Test for API", tags = list("tcga")
    +)
    top
    @@ -1176,11 +1253,12 @@

    Delete a project

    You can delete a single project by making the request to $delete(). Note that the returned object from a$project() sometimes returns list if you use partial matching by name. The $delete() request cannot operate on a list. If you want to operate on a list of object, read more about batch functions in the relevant section below.

    -
    # remove it, not run
    -a$project("api_testing")$delete()
    +
    +# remove it, not run
    +a$project("api_testing")$delete()
     # check
     # will delete all projects match the name
    -delete(a$project("api_testing_donnot_delete_me"))
    +delete(a$project("api_testing_donnot_delete_me"))
    top
    @@ -1194,11 +1272,12 @@

  9. description
  10. billing_group_id
  11. -
    a$project(id = "RFranklin/helloworld")
    -a$project(id = "RFranklin/helloworld")$update(
    -  name = "Hello World Update",
    -  description = "Update description"
    -)
    +
    +a$project(id = "RFranklin/helloworld")
    +a$project(id = "RFranklin/helloworld")$update(
    +  name = "Hello World Update",
    +  description = "Update description"
    +)

    @@ -1211,7 +1290,8 @@

  12. The member’s username
  13. The member’s permissions in the specified project
  14. -
    a$project(id = "RFranklin/demo-project")$member()
    +
    +a$project(id = "RFranklin/demo-project")$member()
    top
    @@ -1223,8 +1303,9 @@

    Requests to add a project member must include the key permissions. However, if you do not include a value, the member’s permissions will be set to false by default.

    Set permission by passing the following values: copy, write, execute, admin, or read.

    Note: read is implicit and set by default. You can not be a project member without having read permissions.

    -
    m <- a$project(id = "RFranklin/demo-project")$
    -  member_add(username = "Rosalind.Franklin")
    +
    +m <- a$project(id = "RFranklin/demo-project")$
    +  member_add(username = "Rosalind.Franklin")
    top
    @@ -1233,9 +1314,10 @@

    Update a member

    This call edits a user’s permissions in the specified project. It can only be made by a user who has admin permissions in the project.

    -
    m <- a$project(id = "RFranklin/demo-project")$
    -  member(username = "Rosalind.Franklin")
    -m$update(copy = TRUE)
    +
    +m <- a$project(id = "RFranklin/demo-project")$
    +  member(username = "Rosalind.Franklin")
    +m$update(copy = TRUE)
    == Member ==
     username : Rosalind.Franklin
     -- Permission --
    @@ -1251,10 +1333,11 @@ 

    Delete a member

    -

    To delete an existing member, call the delete() action on the Member object.

    -
    m$delete()
    +

    To delete an existing member, call the delete() action on the Member object.

    +
    +m$delete()
     # confirm
    -a$project(id = "RFranklin/demo-project")$member()
    +a$project(id = "RFranklin/demo-project")$member()
    top
    @@ -1264,8 +1347,9 @@

    List all files

    To list all files belonging to a project, use the following request:

    -
    p <- a$project(id = "RFranklin/demo-project")
    -p$file()
    +
    +p <- a$project(id = "RFranklin/demo-project")
    +p$file()
    top
    @@ -1278,13 +1362,15 @@

    List all files

    A better way to list files in a project uses the following:

    -
    # first 100 files, default offset = 0, limit = 100
    -p$file()
    +
    +# first 100 files, default offset = 0, limit = 100
    +p$file()
     # list all files
    -p$file(complete = TRUE)
    +p$file(complete = TRUE)

    Alternatively, you can get files from the Auth object.

    -
    a$file(project = p$id)
    -a$file(name = "omni", project = p$id, detail = TRUE)
    +
    +a$file(project = p$id)
    +a$file(name = "omni", project = p$id, detail = TRUE)
    top
    @@ -1301,15 +1387,16 @@

  15. Second rule: understand the operation: When filtering on any resource, including the same field several times with different filtering criteria results in an implicit OR operation for that field and the different criteria.When filtering by different specified fields, an implicit AND is performed between those criteria." so which are different fields, metadata, origin.task, tags, those are different fields. Note different metadata fields are treated as different fields as well, so it will be an AND operation for different metadata fields.

  16. As a quick example, the following code gives us all files in the project RFranklin/demo that with metadata sample_id “Sample1” OR “Sample2”, AND the library id has to be “EXAMPLE”, AND tags has either “hello” OR “world”.

    -
    p <- a$project(id = "RFranklin/demo")
    -p$file(
    -  metadata = list(
    -    sample_id = "Sample1",
    -    sample_id = "Sample2",
    -    library_id = "EXAMPLE"
    -  ),
    -  tag = c("hello", "world")
    -)
    +
    +p <- a$project(id = "RFranklin/demo")
    +p$file(
    +  metadata = list(
    +    sample_id = "Sample1",
    +    sample_id = "Sample2",
    +    library_id = "EXAMPLE"
    +  ),
    +  tag = c("hello", "world")
    +)
    top
    @@ -1320,28 +1407,31 @@

    There are two ways to return the exact file you want. One is by id, the other one is by exact name.

    For advanced users: When searching by name with exact = TRUE, it directly uses our public API call to match the exact name and return the object with a single query. When you turn off exact, it will grep all files or files defined with limit and offset first, then match by name, which could be slow.

    To get the file id, you can check the URL on the web interface from the file details page.

    -
    # return single object id is "some_file_id"
    -p$file(id = "some_file_id")
    +
    +# return single object id is "some_file_id"
    +p$file(id = "some_file_id")
     # return a single object named a.fastq
    -p$file(name = "a.fastq", exact = TRUE)
    +p$file(name = "a.fastq", exact = TRUE)
     # public file search using Auth object
    -a$public_file(name = "ucsc.hg19.fasta.fai", exact = TRUE)
    -a$public_file(id = "578cf94a507c17681a3117e8")
    +a$public_file(name = "ucsc.hg19.fasta.fai", exact = TRUE) +a$public_file(id = "578cf94a507c17681a3117e8")

    To get more than one object, the arguments id and name both accept vectors, so you can pass more than one id or name to it.

    -
    # get two files
    -p$file(name = c("test1.fastq", "test2.fastq"), exact = TRUE)
    +
    +# get two files
    +p$file(name = c("test1.fastq", "test2.fastq"), exact = TRUE)
     # get two files from public files using shorthand
    -a$public_file(
    -  name = c("ucsc.hg19.fasta.fai", "ucsc.hg19.fasta"),
    -  exact = TRUE
    -)
    +a$public_file( + name = c("ucsc.hg19.fasta.fai", "ucsc.hg19.fasta"), + exact = TRUE +)

    If you did not use exact = TRUE, the API would assume it is pattern grep and use partial matching.

    -
    # get matchd the pattern for searching first 100 files
    -p$file(name = c("gz", "fastq"))
    +
    +# get matchd the pattern for searching first 100 files
    +p$file(name = c("gz", "fastq"))
     # get all matched files from the project
    -p$file(name = c("gz", "fastq"), complete = TRUE)
    +p$file(name = c("gz", "fastq"), complete = TRUE)
     # get all files matched ucsc
    -a$public_file(name = "ucsc.hg19", complete = TRUE)
    +a$public_file(name = "ucsc.hg19", complete = TRUE)
    top
    @@ -1351,12 +1441,13 @@

    Search by metadata

    When you specify different metadata fields, the values use an AND operation, and when you specify the same metadata fields, the values use an OR operation.

    To list all files in project RFranklin/demo, that have a sample_id of “Sample1” OR “Sample2” AND another metadata field library_id set to “EXAMPLE”, make the following request.

    -
    p <- a$project(id = "RFranklin/demo")
    -p$file(metadata = list(
    -  sample_id = "Sample1",
    -  sample_id = "Sample2",
    -  library_id = "EXAMPLE"
    -))
    +
    +p <- a$project(id = "RFranklin/demo")
    +p$file(metadata = list(
    +  sample_id = "Sample1",
    +  sample_id = "Sample2",
    +  library_id = "EXAMPLE"
    +))
    top
    @@ -1366,8 +1457,9 @@

    Search by tags

    Tags are more flexible than metadata. You can search with multiple tags using an OR operation.

    This example shows how to return all files with the tag “s1” OR “s2”.

    -
    p <- a$project(id = "RFranklin/demo")
    -p$file(tag = c("s1", "s2"))
    +
    +p <- a$project(id = "RFranklin/demo")
    +p$file(tag = c("s1", "s2"))
    top
    @@ -1380,12 +1472,13 @@

  17. Started from the Task object;
  18. Use the filter criteria.
  19. -
    # list all outputs file from a task id
    -a$task(id = "53020538-6936-422f-80de-02fa65ae4b39")$file()
    +
    +# list all outputs file from a task id
    +a$task(id = "53020538-6936-422f-80de-02fa65ae4b39")$file()
     
     # OR
    -p <- a$project(id = "RFranklin/demo")
    -p$file(origin.task = "53020538-6936-422f-80de-02fa65ae4b39")
    +p <- a$project(id = "RFranklin/demo") +p$file(origin.task = "53020538-6936-422f-80de-02fa65ae4b39")
    top
    @@ -1406,15 +1499,17 @@

  20. name (optional):if omitted, use the same name as the original file name
  21. -
    # 1000G_omni2.5.b37.vcf
    -fid <- "561e1b33e4b0aa6ec48167d7"
    -fid2 <- "561e1b33e4b0aa6ec48167d3"
    -pid <- a$project("demo")$id
    -a$copyFile(c(fid, fid2), project = pid)
    -a$project(id = pid)$file()
    +
    +# 1000G_omni2.5.b37.vcf
    +fid <- "561e1b33e4b0aa6ec48167d7"
    +fid2 <- "561e1b33e4b0aa6ec48167d3"
    +pid <- a$project("demo")$id
    +a$copyFile(c(fid, fid2), project = pid)
    +a$project(id = pid)$file()

    NOTE: To copy a group of files, you need the Auth$copyFile() interface. The id of the files in your project will be different from their id in the Public Files repository.

    Alternatively, you copy a single file as shown below.

    -
    a$project("hello")$file(id = fid)$copyTo(pid)
    +
    +a$project("hello")$file(id = fid)$copyTo(pid)

    Notably, if you have many files to copy between projects, we would always recommend using the Auth$bulk_file_copy() method described in the Actions API section below, to batch copy the files in a single API call and save the number of API calls.

    top @@ -1424,15 +1519,17 @@

    Delete file(s)

    Note: The delete action only works for one file at a time. Be sure your file call returns a single file rather than a file list.

    -
    a$project("demo")$file()[[1]]$delete()
    +
    +a$project("demo")$file()[[1]]$delete()
     ## confirm the deletion
    -a$project("demo")$file()
    +a$project("demo")$file()

    You can also delete a group of files or FilesList object, just be careful when using this function.

    -
    ## return 5 files
    -a$project("demo")$file("phase1")
    +
    +## return 5 files
    +a$project("demo")$file("phase1")
     ## delete all of them
    -delete(a$project("demo")$file("phase1"))
    -a$project("demo")$file("phase1")
    +delete(a$project("demo")$file("phase1")) +a$project("demo")$file("phase1")
    top
    @@ -1441,15 +1538,19 @@

    Download files

    To get the download information, please use the following:

    -
    a$project("demo")$file()[[1]]$download_url()
    +
    +a$project("demo")$file()[[1]]$download_url()

    To download directly from R, use the download call directly from a single File object.

    -
    fid <- a$project("demo")$file()[[1]]$id
    -a$project("demo")$file(id = fid3)$download("~/Downloads/")
    +
    +fid <- a$project("demo")$file()[[1]]$id
    +a$project("demo")$file(id = fid3)$download("~/Downloads/")

    I also created a download function for FilesList object to save your time, as follows:

    -
    fls <- a$project("demo")$file()
    -download(fls, "~/Downloads/")
    +
    +fls <- a$project("demo")$file()
    +download(fls, "~/Downloads/")

    To download all files from a project, use the following:

    -
    a$project("demo")$download("~/Downloads")
    +
    +a$project("demo")$download("~/Downloads")
    top
    @@ -1468,36 +1569,39 @@

    Upload single file

    -
    a <- Auth(username = "RFranklin", platform = "cgc")
    -fl <- system.file("extdata", "sample1.fastq", package = "sevenbridges")
    +
    +a <- Auth(username = "RFranklin", platform = "cgc")
    +fl <- system.file("extdata", "sample1.fastq", package = "sevenbridges")
     
    -(p <- a$project(id = "RFranklin/quickstart"))
    +(p <- a$project(id = "RFranklin/quickstart"))
     
     # by default load .meta for the file
    -p$upload(fl, overwrite = TRUE)
    +p$upload(fl, overwrite = TRUE)
     # pass metadata
    -p$upload(fl, overwrite = TRUE, metadata = list(library_id = "testid2", platform = "Illumina x11"))
    +p$upload(fl, overwrite = TRUE, metadata = list(library_id = "testid2", platform = "Illumina x11"))
     # rename
    -p$upload(fl,
    -  overwrite = TRUE, name = "sample_new_name.fastq",
    -  metadata = list(library_id = "new_id")
    -)
    +p$upload(fl, + overwrite = TRUE, name = "sample_new_name.fastq", + metadata = list(library_id = "new_id") +)

    Upload a folder

    -
    dir.ext <- system.file("extdata", package = "sevenbridges")
    -list.files(dir.ext)
    -p$upload(dir.ext, overwrite = TRUE)
    +
    +dir.ext <- system.file("extdata", package = "sevenbridges")
    +list.files(dir.ext)
    +p$upload(dir.ext, overwrite = TRUE)

    Upload a list of files

    -
    dir.ext <- system.file("extdata", package = "sevenbridges")
    +
    +dir.ext <- system.file("extdata", package = "sevenbridges")
     # enable full name
    -fls <- list.files(dir.ext, recursive = TRUE, full.names = TRUE)
    -p$upload(fls, overwrite = TRUE)
    -p$upload("~/Documents/Data/sbgtest/1000G_phase1.snps.high_confidence.b37.vcf")
    +fls <- list.files(dir.ext, recursive = TRUE, full.names = TRUE) +p$upload(fls, overwrite = TRUE) +p$upload("~/Documents/Data/sbgtest/1000G_phase1.snps.high_confidence.b37.vcf")

    @@ -1515,23 +1619,24 @@

  22. choose to use subset to upload only part of files with filter
  23. Please check the examples below.

    -
    # upload all fiels and all metadata
    -p$upload(manifest_file = "~/manifest.csv")
    +
    +# upload all fiels and all metadata
    +p$upload(manifest_file = "~/manifest.csv")
     
     # verbal = TRUE, print single file level progress
    -p$upload(manifest_file = "~/manifest.csv", overwrite = TRUE, verbal = TRUE)
    +p$upload(manifest_file = "~/manifest.csv", overwrite = TRUE, verbal = TRUE)
     
     # manifest_metadata = FALSE doens't attach any metadata
    -p$upload(manifest_file = "~/manifest.csv", manifest_metadata = FALSE, overwrite = TRUE)
    +p$upload(manifest_file = "~/manifest.csv", manifest_metadata = FALSE, overwrite = TRUE)
     
     # filter files first, upload only files with score < 0.5
    -p$upload(manifest_file = "~/manifest.csv", overwrite = TRUE, subset = score < 0.5)
    +p$upload(manifest_file = "~/manifest.csv", overwrite = TRUE, subset = score < 0.5)
     
     # attach all meta except "bad_field" and "sample_id"
    -p$upload(
    -  manifest_file = "~/manifest.csv", overwrite = TRUE,
    -  subset = score < 0.5, select = -c(bad_field, sample_id)
    -)
    +p$upload( + manifest_file = "~/manifest.csv", overwrite = TRUE, + subset = score < 0.5, select = -c(bad_field, sample_id) +)
    top
    @@ -1542,29 +1647,33 @@

    Upload files via command line uploader

    As an alternative to API file uploading, we also offer an interface in the sevenbridges package for uploading (possibly large) files via the Java-based command line uploader.

    The first step is to download the command line uploader. With get_uploader(), users can easily download the uploader to a local directory for a specified Seven Bridges platform, for example, the Cancer Genomics Cloud:

    -
    get_uploader("cgc", "~/Downloads/")
    +
    +get_uploader("cgc", "~/Downloads/")

    To list the available projects accessible from your account via the uploader, use cli_list_projects(), with your authentication token for that platform and the directory containing the uploader:

    -
    cgc_token <- "your_cgc_token"
    -cgc_uploader <- "~/Downloads/cgc-uploader/"
    -
    -cli_list_projects(
    -  token = cgc_token,
    -  uploader = cgc_uploader
    -)
    +
    +cgc_token <- "your_cgc_token"
    +cgc_uploader <- "~/Downloads/cgc-uploader/"
    +
    +cli_list_projects(
    +  token = cgc_token,
    +  uploader = cgc_uploader
    +)

    The function will return a character vector containing the available projects which you could upload files to, in the form of username/project-name.

    Similarly, to list all the file tags in a project via the uploader, use cli_list_tags():

    -
    cli_list_tags(
    -  token = cgc_token,
    -  uploader = cgc_uploader,
    -  project = "username/project-name"
    -)
    +
    +cli_list_tags(
    +  token = cgc_token,
    +  uploader = cgc_uploader,
    +  project = "username/project-name"
    +)

    Eventually, use cli_upload() to upload local files to a project:

    -
    cli_upload(
    -  token = cgc_token,
    -  uploader = cgc_uploader,
    -  file = "~/example.fastq",
    -  project = "username/project-name"
    -)
    +
    +cli_upload(
    +  token = cgc_token,
    +  uploader = cgc_uploader,
    +  file = "~/example.fastq",
    +  project = "username/project-name"
    +)
    top
    @@ -1578,25 +1687,28 @@

  24. The file’s metadata. The metadata is in the form of a list. Note that as this call overwrites all the metadata for a given file, please supply a full list of all the metadata for the file. Conversely, you can use the set_meta() function to patch but not overwrite the metadata for a file.
  25. If no parameters were provided, this call will get the details of that file and update the object itself.

    -
    (fl <- a$project(id = "RFranklin/demo-project")$file(name = "sample.fastq"))
    +
    +(fl <- a$project(id = "RFranklin/demo-project")$file(name = "sample.fastq"))
    == File ==
     id : 56c7916ae4b03b56a7d7
     name : sample.fastq
     project : RFranklin/demo-project

    Show metadata

    -
    # show metadata
    -fl$meta()
    +
    +# show metadata
    +fl$meta()

    Update meta

    -
    fl$update(
    -  name = "sample.fastq",
    -  metadata = list(
    -    new_item1 = "item1",
    -    new_item2 = "item2",
    -    file_extension = "fastq"
    -  )
    -)
    +
    +fl$update(
    +  name = "sample.fastq",
    +  metadata = list(
    +    new_item1 = "item1",
    +    new_item2 = "item2",
    +    file_extension = "fastq"
    +  )
    +)
     # check it out
    -fl$meta()
    +fl$meta()
    top
    @@ -1608,33 +1720,37 @@

    Note that the name of a file is not the same as its ID. A file’s ID is a hexadecimal string automatically assigned to a file in a project. The file’s name is a human-readable string. For information, please see the API overview for the Seven Bridges Platform and for the CGC.

    Get metadata

    To get the metadata for a file, call the meta() function, as shown below.

    -
    # meta is pulling the latest information via API
    -fl$meta()
    +
    +# meta is pulling the latest information via API
    +fl$meta()
     # field metadata saved the previously saved one
    -fl$metadata
    +fl$metadata

    Set metadata

    Files from curated datasets on Seven Bridges environments have a defined set of metadata which is visible on the visual interface of each environment. However, you can also pass additional metadata for each file which is stored with your copy of the file in your project.

    To set metadata but not overwrite all previously stored metadata, call the set_meta() function from the Files object. Unlike the update() function for the Files object, the set_meta() function doesn’t overwrite the metadata field. To overwrite the metadata field, use the update() function or pass the optional argument overwrite = TRUE for the set_meta() call.

    -
    fl$set_meta(new_item3 = "item3")
    -fl
    +
    +fl$set_meta(new_item3 = "item3")
    +fl
     # oops it removed rest of the meta
    -fl$set_meta(new_item4 = "item4", overwrite = TRUE)
    -fl
    +fl$set_meta(new_item4 = "item4", overwrite = TRUE) +fl

    Check details of each metadata field

    -

    You can use the Metadata() constructor to check the details of each metadata field. Simply call the function (name of the metadata) to display descriptions and enumerated items. Please pay attention to the suggested_values field.

    -
    # check which schema we have
    -Metadata()$show(full = TRUE)
    +

    You can use the Metadata() constructor to check the details of each metadata field. Simply call the function (name of the metadata) to display descriptions and enumerated items. Please pay attention to the suggested_values field.

    +
    +# check which schema we have
    +Metadata()$show(full = TRUE)
     # check details for each, play with it
    -platform()
    -paired_end()
    -quality_scale()
    -

    As you can see, some metadata fields have suggested values. To construct the metadata, use Metadata() directly to pass the metadata fields and their values directly into the call. The call will perform the validation.

    -
    Metadata(
    -  platform = "Affymetrix SNP Array 6.0",
    -  paired_end = 1,
    -  quality_scale = "sanger",
    -  new_item = "new test"
    -)
    +platform() +paired_end() +quality_scale()
    +

    As you can see, some metadata fields have suggested values. To construct the metadata, use Metadata() directly to pass the metadata fields and their values directly into the call. The call will perform the validation.

    +
    +Metadata(
    +  platform = "Affymetrix SNP Array 6.0",
    +  paired_end = 1,
    +  quality_scale = "sanger",
    +  new_item = "new test"
    +)
    top
    @@ -1648,34 +1764,36 @@

    Overwrite the tags for a file

    To completely overwrite the tags for a file, use the obj$set_tag() method, which contains the default argument overwrite = TRUE.

    Let’s use a file called sample.bam and play with its tags.

    -
    p <- a$project(id = "RFranklin/s3tutorial")
    -fl <- p$file("sample.bam", exact = TRUE)
    +
    +p <- a$project(id = "RFranklin/s3tutorial")
    +fl <- p$file("sample.bam", exact = TRUE)
     # show tags for single file
    -fl$tag()
    +fl$tag()
     # add new tags
    -fl$add_tag("new tag")
    +fl$add_tag("new tag")
     # equavilent to
    -fl$set_tag("new tag 2", overwrite = FALSE)
    +fl$set_tag("new tag 2", overwrite = FALSE)
     # set tags to overwrite existing
    -x <- list("this", "is", 1234)
    -fl$set_tag(x)
    +x <- list("this", "is", 1234)
    +fl$set_tag(x)
     # filter by tags
    -p$file(tag = c("1234", "new"))
    -p$file(tag = list("1234", "new"))
    -p$file(tag = "1234")
    +p$file(tag = c("1234", "new")) +p$file(tag = list("1234", "new")) +p$file(tag = "1234")

    Below, find convenient methods for FilesList. Let’s add the tag “s1” to a group files matching “Sample1” and add the tag “s2” to a group of files that match “s2”. Then, we will filter by these tags to obtain specific files.

    -
    # work on a group of files
    +
    +# work on a group of files
     # add tag "s2" to a group of files named with "Sample2" in it
    -fl2 <- p$file("Sample2")
    -add_tag(fl2, "s2")
    +fl2 <- p$file("Sample2")
    +add_tag(fl2, "s2")
     # add tag "s2" to a group of files named with "Sample1" in it
    -fl1 <- p$file("Sample1")
    -add_tag(fl1, "s1")
    +fl1 <- p$file("Sample1")
    +add_tag(fl1, "s1")
     # filter by tag s1 or s2
    -p$file(tag = "s1")
    -p$file(tag = "s2")
    +p$file(tag = "s1")
    +p$file(tag = "s2")
     # get files tagged with s2 and 1234
    -p$file(tag = list("s2", "s1"))
    +p$file(tag = list("s2", "s1"))
    top
    @@ -1692,12 +1810,15 @@

    Get project root folder

    To create new folders and manage files using folders in a project, we first need to get the information about the root folder of the project. For example

    -
    p <- a$project(id = "RFranklin/folders-api-testing")
    +
    +p <- a$project(id = "RFranklin/folders-api-testing")

    We can get the project root folder ID:

    -
    p$get_root_folder_id()
    +
    +p$get_root_folder_id()
    [1] "5bd7c53ee4b04b8fb1a9f63c"

    Or, return the project root folder as an object:

    -
    (root_folder <- p$get_root_folder())
    +
    +(root_folder <- p$get_root_folder())
    == Files ==
     id : 5bd7c53ee4b04b8fb1a9f63c
     name : 8c02ceda-e46b-49c0-362f-4318fa8f3e4k
    @@ -1713,9 +1834,11 @@ 

    Create a folder

    To create a new_folder under the project root folder, use

    -
    folder1 <- root_folder$create_folder("folder1")
    +
    +folder1 <- root_folder$create_folder("folder1")

    To create a new folder under folder1, use

    -
    folder2 <- folder1$create_folder("folder2")
    +
    +folder2 <- folder1$create_folder("folder2")
    top
    @@ -1724,10 +1847,12 @@

    Copy files between folders

    Let’s copy a public reference file into the project root folder:

    -
    file_public <- a$public_file(name = "Homo_sapiens_assembly38.fasta", exact = TRUE)
    -file1 <- file_public$copy_to_folder(root_folder$id)
    +
    +file_public <- a$public_file(name = "Homo_sapiens_assembly38.fasta", exact = TRUE)
    +file1 <- file_public$copy_to_folder(root_folder$id)

    We can also rename the file when copying it into a folder:

    -
    file2 <- file_public$copy_to_folder(root_folder$id, "ref_grch38.fasta")
    +
    +file2 <- file_public$copy_to_folder(root_folder$id, "ref_grch38.fasta")
    top
    @@ -1736,7 +1861,8 @@

    Move files between folders

    To move files to another folder (for example, folder1 we just created), use

    -
    file1 <- file1$move_to_folder(folder1$id)
    +
    +file1 <- file1$move_to_folder(folder1$id)
    top
    @@ -1745,7 +1871,8 @@

    List folder contents

    To list all files and folders in a folder (for example, the root folder), use

    -
    (contents_root <- root_folder$list_folder_contents(complete = TRUE))
    +
    +(contents_root <- root_folder$list_folder_contents(complete = TRUE))
    [[1]]
     == Files ==
     id : 5bede476e4b03b8ff38c28ba
    @@ -1763,8 +1890,9 @@ 

    type : file

    If complete = FALSE (default), it will only return the (first) page from the API based on offset and limit.

    To list only files or only folders, set type = "file" or type = "folder":

    -
    root_folder$list_folder_contents(type = "file", complete = TRUE)
    -root_folder$list_folder_contents(type = "folder", complete = TRUE)
    +
    +root_folder$list_folder_contents(type = "file", complete = TRUE)
    +root_folder$list_folder_contents(type = "folder", complete = TRUE)
    top
    @@ -1773,16 +1901,20 @@

    Get file and folder details

    Get the type of a single file/folder object:

    -
    contents_root[[1]]$typeof()
    +
    +contents_root[[1]]$typeof()
    [1] "folder"

    Or, get the type(s) for all objects in the folder:

    -
    sapply(contents_root, function(x) x$typeof())
    +
    +sapply(contents_root, function(x) x$typeof())
    [1] "folder" "file"

    Sometimes, it’s convenient to get the parent folder ID for a file or folder:

    -
    contents_root[[1]]$get_parent_folder_id()
    +
    +contents_root[[1]]$get_parent_folder_id()
    [1] "5bd7c53ee4b04b8fb1a9f63c"

    This is essentially the root folder ID. Alternatively, to get the parent folder as an object, use

    -
    contents_root[[1]]$get_parent_folder()
    +
    +contents_root[[1]]$get_parent_folder()
    top
    @@ -1791,7 +1923,8 @@

    Delete files in a folder

    We can delete a file in a folder:

    -
    file1$delete()
    +
    +file1$delete()
    top
    @@ -1800,13 +1933,15 @@

    Delete a folder

    If a folder still has files in it, it cannot be deleted:

    -
    file2 <- file2$move_to_folder(folder2$id)
    -folder2$delete()
    +
    +file2 <- file2$move_to_folder(folder2$id)
    +folder2$delete()
    Error: HTTP Status 400: Deleting non-empty folders is not supported.

    We need to delete all files (and subfolders) within a folder before deleting the folder itself:

    -
    file2$delete()
    -folder2$delete()
    -folder1$delete()
    +
    +file2$delete()
    +folder2$delete()
    +folder1$delete()
    top
    @@ -1823,40 +1958,45 @@

    List all apps

    This call lists all the apps available to you.

    -
    a$app()
    +
    +a$app()
     # or show details
    -a$app(detail = TRUE)
    +a$app(detail = TRUE)

    Search for an app by name

    To search for a specific app by its name, pass a pattern for the name argument or provide a unique id as shown below.

    -
    # pattern match
    -a$app(name = "STAR")
    +
    +# pattern match
    +a$app(name = "STAR")
     # unique id
    -aid <- a$app()[[1]]$id
    -aid
    -a$app(id = aid)
    +aid <- a$app()[[1]]$id
    +aid
    +a$app(id = aid)
     # get a specific revision from an app
    -a$app(id = aid, revision = 0)
    +a$app(id = aid, revision = 0)

    List all apps in a project

    To list all apps belonging to a specific project, use the project argument.

    -
    # my favorite, always
    -a$project("demo")$app()
    +
    +# my favorite, always
    +a$project("demo")$app()
     
     # or alternatviely
    -pid <- a$project("demo")$id
    -a$app(project = pid)
    +pid <- a$project("demo")$id +a$app(project = pid)

    List all public apps

    To list all public apps, use the visibility argument.

    -
    # show 100 items from public
    -x <- a$app(visibility = "public")
    -length(x)
    -x <- a$app(visibility = "public", complete = TRUE)
    -length(x)
    -x <- a$app(project = "RFranklin/helloworld", complete = TRUE)
    -length(x)
    -a$app(visibility = "public", limit = 5, offset = 150)
    +
    +# show 100 items from public
    +x <- a$app(visibility = "public")
    +length(x)
    +x <- a$app(visibility = "public", complete = TRUE)
    +length(x)
    +x <- a$app(project = "RFranklin/helloworld", complete = TRUE)
    +length(x)
    +a$app(visibility = "public", limit = 5, offset = 150)

    Search through all public apps in all locations

    To search for a public app cross all locations, make the following call. Note that this may take a bit of time.

    -
    a$app("STAR", visibility = "public", complete = TRUE)
    +
    +a$app("STAR", visibility = "public", complete = TRUE)
    top
    @@ -1872,16 +2012,18 @@

  26. name (optional): use this field to optionally re-name your app
  27. -
    aid <- a$public_app()[[1]]$id
    -a$copy_app(aid, project = pid, name = "copy-rename-test")
    +
    +aid <- a$public_app()[[1]]$id
    +a$copy_app(aid, project = pid, name = "copy-rename-test")
     # check if it is copied
    -a$app(project = pid)
    +a$app(project = pid)

    You can also copy directly from the app object, as shown below.

    -
    app <- a$public_app(id = "admin/sbg-public-data/rna-seq-alignment-star")
    -app$copy_to(
    -  project = "RFranklin/api-testing",
    -  name = "copy of star"
    -)
    +
    +app <- a$public_app(id = "admin/sbg-public-data/rna-seq-alignment-star")
    +app$copy_to(
    +  project = "RFranklin/api-testing",
    +  name = "copy of star"
    +)
    top
    @@ -1892,10 +2034,11 @@

    This call returns the raw CWL of a specific app, including its raw CWL. The call differs from the call to GET details of an app in that it returns a JSON object that is the CWL.

    The app should be one in a project that you can access, either an app which has been uploaded by a project member or a publicly available app which has been copied to the project.

    To get a specific revision, pass the revision argument.

    -
    ap <- a$app(visibility = "public")[[1]]
    -a$project("demo")$app("index")
    +
    +ap <- a$app(visibility = "public")[[1]]
    +a$project("demo")$app("index")
     # get a specific revision
    -a$project("demo")$app("index", revision = 0)
    +a$project("demo")$app("index", revision = 0)

    Coming soon: converting apps to CWL objects

    top @@ -1911,9 +2054,10 @@

  28. filename: The name of the JSON file containing the CWL.
  29. -
    cwl.fl <- system.file("extdata", "bam_index.json", package = "sevenbridges")
    -a$project("demo")$app_add(short_name = "new_bam_index_app", filename = cwl.fl)
    -a$project("demo")$app_add(short_name = "new_bam_index_app", revision = 2, filename = cwl.fl)
    +
    +cwl.fl <- system.file("extdata", "bam_index.json", package = "sevenbridges")
    +a$project("demo")$app_add(short_name = "new_bam_index_app", filename = cwl.fl)
    +a$project("demo")$app_add(short_name = "new_bam_index_app", revision = 2, filename = cwl.fl)

    Note: If you provide the same short_name, this will add a new revision.

    top @@ -1931,35 +2075,37 @@

    Create test or keep the previous test for Tool

    On Seven Bridges platforms, when you create or update your tools in the GUI, there is a test tab allow users to tweak the parameters and see what it looks like in your command line simulated terminal. To do this via R when you push your Tool object to your project, you need to provide "sbg:job" information like the example shown below

    -
    rbx <- Tool(
    -  id = "runif",
    -  label = "Random number generator",
    -  hints = requirements(
    -    docker(pull = "RFranklin/runif"),
    -    cpu(1), mem(2000)
    -  ),
    -  baseCommand = "runif.R",
    -  inputs = in.lst,
    -  outputs = out.lst,
    -  "sbg:job" = list(
    -    allocatedResources = list(mem = 9000, cpu = 1),
    -    inputs = list(min = 1, max = 150)
    -  )
    -)
    -p$app_add("random", rbx)
    +
    +rbx <- Tool(
    +  id = "runif",
    +  label = "Random number generator",
    +  hints = requirements(
    +    docker(pull = "RFranklin/runif"),
    +    cpu(1), mem(2000)
    +  ),
    +  baseCommand = "runif.R",
    +  inputs = in.lst,
    +  outputs = out.lst,
    +  "sbg:job" = list(
    +    allocatedResources = list(mem = 9000, cpu = 1),
    +    inputs = list(min = 1, max = 150)
    +  )
    +)
    +p$app_add("random", rbx)

    Or if you have created test info on the platform or previously pushed one, and you want to keep the previous test setup. We provide an argument named keep_test to allow you to keep the previous revision’s test information.

    -
    rbx <- Tool(
    -  id = "runif",
    -  label = "Random number generator",
    -  hints = requirements(
    -    docker(pull = "RFranklin/runif"),
    -    cpu(1), mem(2000)
    -  ),
    -  baseCommand = "runif.R",
    -  inputs = in.lst,
    -  outputs = out.lst
    -)
    -p$app_add("random", rbx, keep_test = TRUE)
    +
    +rbx <- Tool(
    +  id = "runif",
    +  label = "Random number generator",
    +  hints = requirements(
    +    docker(pull = "RFranklin/runif"),
    +    cpu(1), mem(2000)
    +  ),
    +  baseCommand = "runif.R",
    +  inputs = in.lst,
    +  outputs = out.lst
    +)
    +p$app_add("random", rbx, keep_test = TRUE)
    top
    @@ -1972,27 +2118,31 @@

    List tasks

    This call returns a list of tasks that you can access. You can filter tasks by status.

    -
    # all tasks
    -a$task()
    +
    +# all tasks
    +a$task()
     # filter
    -a$task(status = "completed")
    -a$task(status = "running")
    +a$task(status = "completed") +a$task(status = "running")

    To list all the tasks in a project, use the following.

    -
    # a better way
    -a$project("demo")$task()
    +
    +# a better way
    +a$project("demo")$task()
     
     # alternatively
    -pid <- a$project("demo")$id
    -a$task(project = pid)
    +pid <- a$project("demo")$id +a$task(project = pid)

    To list all tasks with details, pass detail = TRUE.

    -
    p$task(id = "your task id here", detail = TRUE)
    -p$task(detail = TRUE)
    +
    +p$task(id = "your task id here", detail = TRUE)
    +p$task(detail = TRUE)

    To list a batch task using the parent parameter, pass the batch parent task id.

    -
    p <- a$project(id = "RFranklin/demo")
    -p$task(id = "2e1ebed1-c53e-4373-870d-4732acacbbbb")
    -p$task(parent = "2e1ebed1-c53e-4373-870d-4732acacbbbb")
    -p$task(parent = "2e1ebed1-c53e-4373-870d-4732acacbbbb", status = "completed")
    -p$task(parent = "2e1ebed1-c53e-4373-870d-4732acacbbbb", status = "draft")
    +
    +p <- a$project(id = "RFranklin/demo")
    +p$task(id = "2e1ebed1-c53e-4373-870d-4732acacbbbb")
    +p$task(parent = "2e1ebed1-c53e-4373-870d-4732acacbbbb")
    +p$task(parent = "2e1ebed1-c53e-4373-870d-4732acacbbbb", status = "completed")
    +p$task(parent = "2e1ebed1-c53e-4373-870d-4732acacbbbb", status = "draft")
    top
    @@ -2011,19 +2161,20 @@

  30. inputs: A list of inputs for this task
  31. -
    # push an app first
    -fl.runif <- system.file("extdata", "runif.json", package = "sevenbridges")
    -a$project("demo")$app_add("runif_draft", fl.runif)
    -runif_id <- "RFranklin/demo-project/runif_draft"
    +
    +# push an app first
    +fl.runif <- system.file("extdata", "runif.json", package = "sevenbridges")
    +a$project("demo")$app_add("runif_draft", fl.runif)
    +runif_id <- "RFranklin/demo-project/runif_draft"
     # create a draft task
    -a$project("demo")$task_add(
    -  name = "Draft runif 3",
    -  description = "Description for runif 3",
    -  app = runif_id,
    -  inputs = list(min = 1, max = 10)
    -)
    +a$project("demo")$task_add(
    +  name = "Draft runif 3",
    +  description = "Description for runif 3",
    +  app = runif_id,
    +  inputs = list(min = 1, max = 10)
    +)
     # confirm
    -a$project("demo")$task(status = "draft")
    +a$project("demo")$task(status = "draft")
    top
    @@ -2038,16 +2189,17 @@

  32. inputs list. Note that you can only update the items you provided.
  33. -
    # get the single task you want to update
    -tsk <- a$project("demo")$task("Draft runif 3")
    -tsk
    -tsk$update(
    -  name = "Draft runif update",
    -  description = "draft 2",
    -  inputs = list(max = 100)
    -)
    +
    +# get the single task you want to update
    +tsk <- a$project("demo")$task("Draft runif 3")
    +tsk
    +tsk$update(
    +  name = "Draft runif update",
    +  description = "draft 2",
    +  inputs = list(max = 100)
    +)
     # alternative way to check all inputs
    -tsk$getInputs()
    +tsk$getInputs()
    top
    @@ -2056,9 +2208,10 @@

    Run a task

    This call runs (“executes”) the specified task. Only tasks with a “DRAFT” status may be run.

    -
    tsk$run()
    +
    +tsk$run()
     # run update without information just return latest information
    -tsk$update()
    +tsk$update()
    top
    @@ -2068,16 +2221,18 @@

  34. The first argument sets the interval time to check the status
  35. Rest of the arguments might be used for the hook function
  36. -
    tsk$monitor()
    +
    +tsk$monitor()

    Get and set default a hook function for task status. Currently, failed tasks will break the monitoring.

    Note: Hook function has to return TRUE (break monitoring) or FALSE (continuing) in the end.

    -
    getTaskHook("completed")
    -getTaskHook("draft")
    -setTaskHook("draft", function() {
    -  message("never happens")
    -  return(TRUE)
    -})
    -getTaskHook("draft")
    +
    +getTaskHook("completed")
    +getTaskHook("draft")
    +setTaskHook("draft", function() {
    +  message("never happens")
    +  return(TRUE)
    +})
    +getTaskHook("draft")
    top
    @@ -2086,10 +2241,11 @@

    Abort a running task

    This call aborts the specified task. Only tasks whose status is “RUNNING” may be aborted.

    -
    # abort
    -tsk$abort()
    +
    +# abort
    +tsk$abort()
     # check
    -tsk$update()
    +tsk$update()
    top
    @@ -2098,13 +2254,14 @@

    Delete a task

    Note that you can only delete DRAFT tasks, not running tasks.

    -
    tsklst <- a$task(status = "draft")
    +
    +tsklst <- a$task(status = "draft")
     # delete a single task
    -tsklst[[1]]$delete()
    +tsklst[[1]]$delete()
     # confirm
    -a$task(status = "draft")
    +a$task(status = "draft")
     # delete a list of tasks
    -delete(tsklst)
    +delete(tsklst)
    top
    @@ -2112,7 +2269,8 @@

    Download all files from a completed task

    -
    tsk$download("~/Downloads")
    +
    +tsk$download("~/Downloads")
    top
    @@ -2121,34 +2279,35 @@

    Run tasks in batch mode

    To run tasks in batch mode, (check ?batch) for more details. The code below is a mockup example.

    -
    # batch by items
    -(tsk <- p$task_add(
    -  name = "RNA DE report new batch 2",
    -  description = "RNA DE analysis report",
    -  app = rna.app$id,
    -  batch = batch(input = "bamfiles"),
    -  inputs = list(
    -    bamfiles = bamfiles.in,
    -    design = design.in,
    -    gtffile = gtf.in
    -  )
    -))
    +
    +# batch by items
    +(tsk <- p$task_add(
    +  name = "RNA DE report new batch 2",
    +  description = "RNA DE analysis report",
    +  app = rna.app$id,
    +  batch = batch(input = "bamfiles"),
    +  inputs = list(
    +    bamfiles = bamfiles.in,
    +    design = design.in,
    +    gtffile = gtf.in
    +  )
    +))
     
     # batch by metadata, input files has to have metadata fields specified
    -(tsk <- p$task_add(
    -  name = "RNA DE report new batch 3",
    -  description = "RNA DE analysis report",
    -  app = rna.app$id,
    -  batch = batch(
    -    input = "fastq",
    -    c("metadata.sample_id", "metadata.library_id")
    -  ),
    -  inputs = list(
    -    bamfiles = bamfiles.in,
    -    design = design.in,
    -    gtffile = gtf.in
    -  )
    -))
    +(tsk <- p$task_add( + name = "RNA DE report new batch 3", + description = "RNA DE analysis report", + app = rna.app$id, + batch = batch( + input = "fastq", + c("metadata.sample_id", "metadata.library_id") + ), + inputs = list( + bamfiles = bamfiles.in, + design = design.in, + gtffile = gtf.in + ) +))
    top
    @@ -2157,13 +2316,14 @@

    Download all files from a batch task

    We can loop through the batch task and download the files in each child task:

    -
    batch_task <- p$task(parent = "<parent_task_id>")
    -tsk_id <- sapply(batch_task, "[[", "id")
    -for (i in 1:length(tsk_id)) {
    -  tsk <- p$task(id = tsk_id[i])
    -  tsk$file()
    -  tsk$download()
    -}
    +
    +batch_task <- p$task(parent = "<parent_task_id>")
    +tsk_id <- sapply(batch_task, "[[", "id")
    +for (i in 1:length(tsk_id)) {
    +  tsk <- p$task(id = tsk_id[i])
    +  tsk$file()
    +  tsk$download()
    +}

    @@ -2176,18 +2336,19 @@

    Create a volume

    -
    a <- Auth(user = "RFranklin", platform = "aws-us")
    +
    +a <- Auth(user = "RFranklin", platform = "aws-us")
     
    -a$add_volume(
    -  name = "tutorial_volume",
    -  type = "s3",
    -  bucket = "RFranklin-demo",
    -  prefix = "",
    -  access_key_id = "your_access_key_id",
    -  secret_access_key = "your_secret_access_key",
    -  sse_algorithm = "AES256",
    -  access_mode = "RW"
    -)
    +a$add_volume( + name = "tutorial_volume", + type = "s3", + bucket = "RFranklin-demo", + prefix = "", + access_key_id = "your_access_key_id", + secret_access_key = "your_secret_access_key", + sse_algorithm = "AES256", + access_mode = "RW" +)
    top
    @@ -2195,12 +2356,13 @@

    List and search all volumes

    -
    # list all volume
    -a$volume()
    +
    +# list all volume
    +a$volume()
     # get unique volume by id
    -a$volume(id = "RFranklin/RFranklin_demo")
    +a$volume(id = "RFranklin/RFranklin_demo")
     # partial search by name
    -a$volume(name = "demo")
    +a$volume(name = "demo")
    top
    @@ -2208,8 +2370,9 @@

    Get a volume’s detail

    -
    v <- a$volume()
    -v[[1]]$detail()
    +
    +v <- a$volume()
    +v[[1]]$detail()
    top
    @@ -2219,7 +2382,8 @@

    Delete volume

    This call deletes a volume you’ve created to refer to storage on Amazon Web Services or Google Cloud Storage.

    Note that any files you’ve imported from your volume onto a Seven Bridges environment, known as an alias, will no longer be usable. If a new volume is created with the same volume_id as the deleted volume, aliases will point to files on the newly created volume instead (if those exist).

    -
    a$volume(id = "RFranklin/RFranklin_demo")$delete()
    +
    +a$volume(id = "RFranklin/RFranklin_demo")$delete()
    top
    @@ -2228,18 +2392,19 @@

    Import file from volume to project

    This call imports a file from volume to your project.

    -
    v <- a$volume(id = "RFranklin/tutorial_volume")
    -res <- v$import(
    -  location = "A-RNA-File.bam.bai",
    -  project = "RFranklin/s3tutorial",
    -  name = "new.bam.bai",
    -  overwrite = TRUE
    -)
    +
    +v <- a$volume(id = "RFranklin/tutorial_volume")
    +res <- v$import(
    +  location = "A-RNA-File.bam.bai",
    +  project = "RFranklin/s3tutorial",
    +  name = "new.bam.bai",
    +  overwrite = TRUE
    +)
     
     # get job status update
     # state will be "COMPLETED" when it's finished, otherwise "PENDING"
    -v$get_import_job(res$id)
    -v
    +v$get_import_job(res$id) +v

    @@ -2250,16 +2415,17 @@

  37. If this call is successful, the original project file will become an alias to the newly exported object on the volume. The source file will be deleted from the Seven Bridges environment and, if no more copies of this file exist, it will no longer count towards your total storage price on the Seven Bridges environment.
  38. When testing, please update your file in a project.

    -
    res <- v$export(
    -  file = "579fb1c9e4b08370afe7903a",
    -  volume = "RFranklin/tutorial_volume",
    -  location = "", # when "" use old name
    -  sse_algorithm = "AES256"
    -)
    +
    +res <- v$export(
    +  file = "579fb1c9e4b08370afe7903a",
    +  volume = "RFranklin/tutorial_volume",
    +  location = "", # when "" use old name
    +  sse_algorithm = "AES256"
    +)
     # get job status update
     # state will be "COMPLETED" when it's finished other wise "PENDING"
    -v$get_export_job(res$id)
    -v
    +v$get_export_job(res$id) +v
    top
    @@ -2272,19 +2438,20 @@

    Public files

    -
    # list the first 100 files
    -a$public_file()
    +
    +# list the first 100 files
    +a$public_file()
     # list by offset and limit
    -a$public_file(offset = 100, limit = 100)
    +a$public_file(offset = 100, limit = 100)
     # simply list everything!
    -a$public_file(complete = TRUE)
    +a$public_file(complete = TRUE)
     # get exact file by id
    -a$public_file(id = "5772b6f0507c175267448700")
    +a$public_file(id = "5772b6f0507c175267448700")
     # get exact file by name with exact = TRUE
    -a$public_file(name = "G20479.HCC1143.2.converted.pe_1_1Mreads.fastq", exact = TRUE)
    +a$public_file(name = "G20479.HCC1143.2.converted.pe_1_1Mreads.fastq", exact = TRUE)
     # with exact = FALSE by default search by name pattern
    -a$public_file(name = "fastq")
    -a$public_file(name = "G20479.HCC1143.2.converted.pe_1_1Mreads.fastq")
    +a$public_file(name = "fastq") +a$public_file(name = "G20479.HCC1143.2.converted.pe_1_1Mreads.fastq")

    Public files are hosted in the project called admin/sbg-public-data, and you can alternatively use the file request to get files you need.

    top @@ -2294,16 +2461,17 @@

    Public apps

    For public apps, there are similar API calls.

    -
    # list for 100 apps
    -a$public_app()
    +
    +# list for 100 apps
    +a$public_app()
     # list by offset and limit
    -a$public_app(offset = 100, limit = 50)
    +a$public_app(offset = 100, limit = 50)
     # search by id
    -a$public_app(id = "admin/sbg-public-data/control-freec-8-1/12")
    +a$public_app(id = "admin/sbg-public-data/control-freec-8-1/12")
     # search by name in ALL apps
    -a$public_app(name = "STAR", complete = TRUE)
    +a$public_app(name = "STAR", complete = TRUE)
     # search by name with exact match
    -a$public_app(name = "Control-FREEC", exact = TRUE, complete = TRUE)
    +a$public_app(name = "Control-FREEC", exact = TRUE, complete = TRUE)
    top
    @@ -2317,14 +2485,15 @@

    Copy files between projects

    This call allows you to copy files between projects. Unlike a$copyFile() or file(...)$copyTo(...) which only copy one file with each API call, this call lets you batch the copy operation and copy a list of files at a time.

    -
    p <- a$project(id = "RFranklin/source-project")
    -f <- p$file(complete = TRUE)
    +
    +p <- a$project(id = "RFranklin/source-project")
    +f <- p$file(complete = TRUE)
     # get all file IDs
    -file_ids <- sapply(f, "[[", "id")
    +file_ids <- sapply(f, "[[", "id")
     # bulk copy files to the target project
    -req <- a$bulk_file_copy(file_ids, "RFranklin/target-project")
    +req <- a$bulk_file_copy(file_ids, "RFranklin/target-project")
     # print the response list
    -(req <- unname(req))
    +(req <- unname(req))
    [[1]]
     [[1]]$status
     [1] "OK"
    @@ -2337,11 +2506,14 @@ 

    ...

    We can use sapply to get the copy operation status, new file IDs, and (new) file names for the copied files:

    -
    sapply(req, "[[", "status")
    +
    +sapply(req, "[[", "status")
    [1] "OK" "OK" "OK" "OK"
    -
    sapply(req, "[[", "new_file_id")
    +
    +sapply(req, "[[", "new_file_id")
    [1] "5bf31316e4b09b8ff39f9df7" "5bf31316e4b09b8ff39f9dfa" "5bf31316e4b09b8ff39f9df4" "5bf31316e4b09b8ff39f9df1"
    -
    sapply(req, "[[", "new_file_name")
    +
    +sapply(req, "[[", "new_file_name")
    [1] "merged-tumor.converted.pe_1.fastq"  "merged-tumor.converted.pe_2.fastq"  "merged-normal.converted.pe_2.fastq"
     [4] "merged-normal.converted.pe_1.fastq"

    Note that a file’s ID is dependent on the project it is contained in. So, when you copy files from one project to another, their IDs will be different in the target project. The file names, however, do not change by copying, except where copying would yield non-unique file names in the target project.

    @@ -2353,10 +2525,11 @@

    Send a feedback item

    Use this call to send feedbacks to Seven Bridges via the API. There are three feedback types available: "idea", "thought", or "problem". You can send one feedback item per minute.

    -
    a$send_feedback(
    +
    +a$send_feedback(
       "This is a test for sending feedback via API. Please ignore this message.",
    -  type = "thought"
    -)
    + type = "thought" +)
    top
    @@ -2380,9 +2553,10 @@

    List all divisions

    To list all divisions you have access to, use

    -
    a <- Auth(...)
    +
    +a <- Auth(...)
     
    -a$division()
    +a$division()
    [[1]]
     == Division ==
       id : the-division
    @@ -2399,7 +2573,8 @@ 

    Get details of a division

    To get the details (ID and name) of a division, for example, the first division listed above, use

    -
    (d <- a$division("the-division"))
    +
    +(d <- a$division("the-division"))
    == Division ==
       id : the-division
     name : The Division
    @@ -2411,8 +2586,9 @@

    Create a team

    Let’s create two new teams under this division:

    -
    team1 <- d$create_team(name = "New Team 1")
    -team2 <- d$create_team(name = "New Team 2")
    +
    +team1 <- d$create_team(name = "New Team 1")
    +team2 <- d$create_team(name = "New Team 2")
    top
    @@ -2421,7 +2597,8 @@

    Get details of a team

    To check the details (ID and name) of the first team we just created, use

    -
    d$team(team1$id)
    +
    +d$team(team1$id)
    == Team ==
     id : 39f6cb44-9e3c-40e7-8639-3c0f3c1e4892
     name : New Team 1
    @@ -2433,10 +2610,11 @@

    Add a team member

    We can add division members to the teams we created. For example, let’s add yourself (with the division username the-division/your_username) and another division member (with the division username the-division/another_username) to the first team. Also, let’s add yourself to the second team:

    -
    team1$add_member("the-division/your_username")
    -team1$add_member("the-division/another_username")
    +
    +team1$add_member("the-division/your_username")
    +team1$add_member("the-division/another_username")
     
    -team2$add_member("the-division/your_username")
    +team2$add_member("the-division/your_username")
    top
    @@ -2445,8 +2623,9 @@

    List team members

    List all team members and their roles:

    -
    (m1 <- team1$member())
    -(m2 <- team2$member())
    +
    +(m1 <- team1$member())
    +(m2 <- team2$member())
    [[1]]
     == Team Member ==
     username : the-division/another_username
    @@ -2467,7 +2646,8 @@ 

    Remove a team member

    Let’s remove a user from the first team:

    -
    team1$remove_member(m1[[1]]$username)
    +
    +team1$remove_member(m1[[1]]$username)
    top
    @@ -2476,7 +2656,8 @@

    Rename a team

    To rename a team, use:

    -
    team1$rename("Another Team Name")
    +
    +team1$rename("Another Team Name")
    == Team ==
     id : 39f6cb44-9e3c-40e7-8639-3c0f3c1e4892
     name : Another Team Name
    @@ -2489,7 +2670,8 @@

    List your teams in the division

    To list the teams that you are a member of in a division, use

    -
    d$team()
    +
    +d$team()

    Note that there could be a one-minute delay in the backend here if you just added yourself to the teams seconds ago.

    top @@ -2499,8 +2681,9 @@

    Delete a team

    To delete the teams we created, use

    -
    team1$delete()
    -team2$delete()
    +
    +team1$delete()
    +team2$delete()
    top
    @@ -2511,23 +2694,25 @@

    Markers

    The Markers API allows you to add, get, modify, and delete genetic markers on BAM files. These genetic markers can be then examined in the Seven Bridges Genome Browser.

    As of November 2018, the Markers API is still an Advance Access feature. To use this API, set the advance_access option to TRUE:

    -
    opt <- getOption("sevenbridges")
    -opt$advance_access <- TRUE
    -options(sevenbridges = opt)
    +
    +opt <- getOption("sevenbridges")
    +opt$advance_access <- TRUE
    +options(sevenbridges = opt)

    Create a marker

    Let’s create a new marker on a BAM file first:

    -
    # locate the project
    -p <- a$project(id = "RFranklin/api-markers")
    +
    +# locate the project
    +p <- a$project(id = "RFranklin/api-markers")
     # search for files with `.bam` in their names
    -f <- p$file(name = ".bam")
    +f <- p$file(name = ".bam")
     # use the first BAM file
    -f <- p$file(id = f[[1]]$id)
    +f <- p$file(id = f[[1]]$id)
     
     # create two markers
    -m1 <- f$create_marker("The First Marker", start = 21631232, end = 21631232)
    -m2 <- f$create_marker("The Second Marker", start = 21631156, end = 21631158, chromosome = "chr7", private = FALSE)
    +m1 <- f$create_marker("The First Marker", start = 21631232, end = 21631232) +m2 <- f$create_marker("The Second Marker", start = 21631156, end = 21631158, chromosome = "chr7", private = FALSE)

    The possible parameters for creating the marker include

    • The marker’s name (name)
    • @@ -2541,7 +2726,8 @@

      List markers available on a file

      To list all markers on a file, use:

      -
      f$marker()
      +
      +f$marker()
      [[1]]
       == Marker ==
       id : 5bf478e5d38f185f0c23bc44
      @@ -2555,8 +2741,9 @@ 

      Get details for a marker

      We can also check the details for a specific marker:

      -
      marker_id <- m1$id
      -f$marker(id = marker_id)
      +
      +marker_id <- m1$id
      +f$marker(id = marker_id)
      == Marker ==
       id : 5bf478e5d38f185f0c23bc44
       name : The First Marker
      @@ -2572,7 +2759,8 @@ 

      Modify a marker

      We can also modify the information of existing markers:

      -
      (m1 <- m1$modify(name = "New Marker Name", end = 21631233, private = FALSE))
      +
      +(m1 <- m1$modify(name = "New Marker Name", end = 21631233, private = FALSE))
      == Marker ==
       id : 5bf478e5d38f185f0c23bc44
       name : New Marker Name
      @@ -2589,14 +2777,15 @@ 

      Delete a marker

      To delete the markers we just added, use

      -
      m1$delete()
      -m2$delete()
      +
      +m1$delete()
      +m2$delete()

    Get Raw Response from httr

    -

    In the easy API, we return an object which contains the raw response from httr as a field. You can either call response() on that object or use the field as is.

    +

    In the easy API, we return an object which contains the raw response from httr as a field. You can either call response() on that object or use the field as is.

    top
    @@ -2615,120 +2804,121 @@

    API Cheatsheet

    Quick API cheat sheet (work in progress):

    -
    # 01 - Authentication ----------------------------------------------------------
    +
    +# 01 - Authentication ----------------------------------------------------------
     
    -getToken()
    +getToken()
     
     # authentication methods
    -a <- Auth(token = token)
    -a <- Auth(token = token, platform = "cgc")
    -a <- Auth(from = "env")
    -a <- Auth(from = "file", profile_name = "aws-us-user")
    +a <- Auth(token = token)
    +a <- Auth(token = token, platform = "cgc")
    +a <- Auth(from = "env")
    +a <- Auth(from = "file", profile_name = "aws-us-user")
     
     # list all API calls
    -a$api()
    +a$api()
     
     # API rate limit
    -a$rate_limit()
    +a$rate_limit()
     
     # 02 - User -------------------------------------------------------------------
     
    -a$user()
    -a$user("RFranklin")
    +a$user()
    +a$user("RFranklin")
     
     # 03 - Billing -----------------------------------------------------------------
     
    -a$billing()
    -a$billing(id = ..., breakdown = TRUE)
    -a$invoice()
    -a$invoice(id = "your_id")
    +a$billing()
    +a$billing(id = ..., breakdown = TRUE)
    +a$invoice()
    +a$invoice(id = "your_id")
     
     # 04 - Project -----------------------------------------------------------------
     
     # create new project
    -a$project_new(name = ..., billing_group_id = ..., description = ...)
    +a$project_new(name = ..., billing_group_id = ..., description = ...)
     
     # list all project owned by you
    -a$project()
    -a$project(owner = "Rosalind.Franklin")
    +a$project()
    +a$project(owner = "Rosalind.Franklin")
     
     # partial match
    -p <- a$project(name = ..., id = ..., exact = TRUE)
    +p <- a$project(name = ..., id = ..., exact = TRUE)
     
     # delete
    -p$delete()
    +p$delete()
     
     # update
    -p$update(name = ..., description = ...)
    +p$update(name = ..., description = ...)
     
     # members
    -p$member()
    -p$member_add(username = ...)
    -p$member(username = ...)$update(write = ..., copy = ..., execute = ...)
    -p$memeber(usrname = ...)$delete()
    +p$member()
    +p$member_add(username = ...)
    +p$member(username = ...)$update(write = ..., copy = ..., execute = ...)
    +p$memeber(usrname = ...)$delete()
     
     # 05 - File --------------------------------------------------------------------
     
     # list all files in this project
    -p$file()
    +p$file()
     
     # list all public files
    -a$file(visibility = "public")
    +a$file(visibility = "public")
     
     # copy
    -a$copyFile(c(fid, fid2), project = pid)
    +a$copyFile(c(fid, fid2), project = pid)
     
     # delete
    -p$file(id = fid)$delete()
    +p$file(id = fid)$delete()
     
     # download
    -p$file()[[1]]$download_url()
    -p$file(id = fid3)$download("~/Downloads/")
    +p$file()[[1]]$download_url()
    +p$file(id = fid3)$download("~/Downloads/")
     
     # download all
    -download(p$file())
    +download(p$file())
     
     # update a file
    -fl$update(name = ..., metadata = list(a = ..., b = ..., ...))
    +fl$update(name = ..., metadata = list(a = ..., b = ..., ...))
     
     # metadata
    -fl$meta()
    -fl$setMeta()
    -fl$setMeta(..., overwrite = TRUE)
    +fl$meta()
    +fl$setMeta()
    +fl$setMeta(..., overwrite = TRUE)
     
     # 06 - App ---------------------------------------------------------------------
     
    -a$app()
    +a$app()
     
     # apps in a project
    -p$app()
    -p$app(name, id, revision = ...)
    -a$copy_app(aid, project = pid, name = ...)
    +p$app()
    +p$app(name, id, revision = ...)
    +a$copy_app(aid, project = pid, name = ...)
     
     # add new app
    -p$app_add(short_name = ..., filename = ...)
    +p$app_add(short_name = ..., filename = ...)
     
     # 07 - Task --------------------------------------------------------------------
     
    -a$task()
    -a$task(id = ...)
    -a$task(status = ...)
    +a$task()
    +a$task(id = ...)
    +a$task(status = ...)
     
    -p$task()
    -p$task(id = ...)
    -p$task(status = ...)
    +p$task()
    +p$task(id = ...)
    +p$task(status = ...)
     
    -tsk <- p$task(id = ...)
    -tsk$update()
    -tsk$abort()
    -tsk$run()
    -tsk$download()
    -tsk$detele()
    -tsk$getInputs()
    -tsk$monitor()
    +tsk <- p$task(id = ...)
    +tsk$update()
    +tsk$abort()
    +tsk$run()
    +tsk$download()
    +tsk$detele()
    +tsk$getInputs()
    +tsk$monitor()
     
    -getTaskHook()
    -setTaskHook(status = ..., fun = ...)
    +getTaskHook() +setTaskHook(status = ..., fun = ...)
    top
    @@ -2746,11 +2936,11 @@

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/articles/api_files/header-attrs-2.4/header-attrs.js b/docs/articles/api_files/header-attrs-2.4/header-attrs.js new file mode 100644 index 0000000..dd57d92 --- /dev/null +++ b/docs/articles/api_files/header-attrs-2.4/header-attrs.js @@ -0,0 +1,12 @@ +// Pandoc 2.9 adds attributes on both header and div. We remove the former (to +// be compatible with the behavior of Pandoc < 2.8). +document.addEventListener('DOMContentLoaded', function(e) { + var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); + var i, h, a; + for (i = 0; i < hs.length; i++) { + h = hs[i]; + if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 + a = h.attributes; + while (a.length > 0) h.removeAttribute(a[0].name); + } +}); diff --git a/docs/articles/apps.html b/docs/articles/apps.html index aeda395..766dd6f 100644 --- a/docs/articles/apps.html +++ b/docs/articles/apps.html @@ -44,7 +44,7 @@ sevenbridges-r - 1.19.1 + 1.19.2

    @@ -107,12 +107,12 @@ -
    +
    @@ -172,22 +173,25 @@

    Utilitites for Tool object

    We provide couple utitlities to help construct your own CWL tool quickly in R. For all availale utiles please check out help("Tool")

    Some utiles you will find it useful when you execute a task, you need to know what is the input type and what is the input id and if it’s required or not, so you can execute the task with parameters it need. Try play with input_matrix or input_type as shown below.

    -
    # get input type information
    -head(t1$input_type())
    +
    +# get input type information
    +head(t1$input_type())
                  reads  readMatesLengthsIn       readMapNumber   limitOutSJoneRead 
               "File..."              "enum"               "int"               "int" 
     limitOutSJcollapsed    outReadsUnmapped 
                   "int"              "enum" 
    -
    # get output type information
    -head(t1$output_type())
    +
    +# get output type information
    +head(t1$output_type())
                  aligned_reads transcriptome_aligned_reads 
                          "File"                      "File" 
                  reads_per_gene                   log_files 
                          "File"                   "File..." 
                splice_junctions          chimeric_junctions 
                          "File"                      "File" 
    -
    # return a input matrix with more information
    -head(t1$input_matrix())
    +
    +# return a input matrix with more information
    +head(t1$input_matrix())
                         id                label    type required
     1                #reads        Read sequence File...     TRUE
     95         #sjdbGTFfile Splice junction file File...    FALSE
    @@ -209,8 +213,9 @@ 

    2 null 3 null 4 null

    -
    # return only a few fields
    -head(t1$input_matrix(c("id", "type", "required")))
    +
    +# return only a few fields
    +head(t1$input_matrix(c("id", "type", "required")))
                         id    type required
     1                #reads File...     TRUE
     95         #sjdbGTFfile File...    FALSE
    @@ -218,16 +223,18 @@ 

    2 #readMatesLengthsIn enum FALSE 3 #readMapNumber int FALSE 4 #limitOutSJoneRead int FALSE

    -
    # return only required
    -t1$input_matrix(required = TRUE)
    +
    +# return only required
    +t1$input_matrix(required = TRUE)
             id         label    type required prefix
     1    #reads Read sequence File...     TRUE   <NA>
     102 #genome  Genome files    File     TRUE   <NA>
                                                        fileTypes
     1   FASTA, FASTQ, FA, FQ, FASTQ.GZ, FQ.GZ, FASTQ.BZ2, FQ.BZ2
     102                                                      TAR
    -
    # return a output matrix with more information
    -t1$output_matrix()
    +
    +# return a output matrix with more information
    +t1$output_matrix()
                                id                     label    type fileTypes
     1               #aligned_reads           Aligned SAM/BAM    File  SAM, BAM
     2 #transcriptome_aligned_reads  Transcriptome alignments    File       BAM
    @@ -238,8 +245,9 @@ 

    7 #unmapped_reads Unmapped reads File... FASTQ 8 #intermediate_genome Intermediate genome files File TAR 9 #chimeric_alignments Chimeric alignments File SAM

    -
    # return only a few fields
    -t1$output_matrix(c("id", "type"))
    +
    +# return only a few fields
    +t1$output_matrix(c("id", "type"))
                                id    type
     1               #aligned_reads    File
     2 #transcriptome_aligned_reads    File
    @@ -250,54 +258,64 @@ 

    7 #unmapped_reads File... 8 #intermediate_genome File 9 #chimeric_alignments File

    -
    # get required input id
    -t1$get_required()
    +
    +# get required input id
    +t1$get_required()
        reads    genome 
     "File..."    "File" 
    -
    # set new required input with ID, # or without #
    -t1$set_required(c("#reads", "winFlankNbins"))
    +
    +# set new required input with ID, # or without #
    +t1$set_required(c("#reads", "winFlankNbins"))
    not implemented yet!
    -
    t1$get_required()
    +
    +t1$get_required()
        reads    genome 
     "File..."    "File" 
    -
    # turn off requirements for input node #reads
    -t1$set_required("reads", FALSE)
    +
    +# turn off requirements for input node #reads
    +t1$set_required("reads", FALSE)
    not implemented yet!
    -
    t1$get_required()
    +
    +t1$get_required()
        reads    genome 
     "File..."    "File" 
    -
    # get input id
    -head(t1$input_id())
    +
    +# get input id
    +head(t1$input_id())
                     #STAR                  #STAR                  #STAR 
                   "#reads"  "#readMatesLengthsIn"       "#readMapNumber" 
                      #STAR                  #STAR                  #STAR 
       "#limitOutSJoneRead" "#limitOutSJcollapsed"    "#outReadsUnmapped" 
    -
    # get full input id with Tool name
    -head(t1$input_id(TRUE))
    +
    +# get full input id with Tool name
    +head(t1$input_id(TRUE))
                        File...                        enum 
                   "#STAR.reads"  "#STAR.readMatesLengthsIn" 
                             int                         int 
           "#STAR.readMapNumber"   "#STAR.limitOutSJoneRead" 
                             int                        enum 
     "#STAR.limitOutSJcollapsed"    "#STAR.outReadsUnmapped" 
    -
    # get output id
    -head(t1$output_id())
    +
    +# get output id
    +head(t1$output_id())
                             #STAR                          #STAR 
                   "#aligned_reads" "#transcriptome_aligned_reads" 
                              #STAR                          #STAR 
                  "#reads_per_gene"                   "#log_files" 
                              #STAR                          #STAR 
                "#splice_junctions"          "#chimeric_junctions" 
    -
    # get full output id
    -head(t1$output_id(TRUE))
    +
    +# get full output id
    +head(t1$output_id(TRUE))
                                   File                                File 
                   "#STAR.aligned_reads" "#STAR.transcriptome_aligned_reads" 
                                    File                             File... 
                  "#STAR.reads_per_gene"                   "#STAR.log_files" 
                                    File                                File 
                "#STAR.splice_junctions"          "#STAR.chimeric_junctions" 
    -
    # get input and output object
    -t1$get_input(id = "#winFlankNbins")
    +
    +# get input and output object
    +t1$get_input(id = "#winFlankNbins")
    type:
     - 'null'
     - int
    @@ -317,7 +335,8 @@ 

    sbg:category: Windows, Anchors, Binning sbg:toolDefaultValue: '4' required: no

    -
    t1$get_input(name = "ins")
    +
    +t1$get_input(name = "ins")
    [[1]]
     type:
     - 'null'
    @@ -360,7 +379,8 @@ 

    sbg:category: Limits sbg:toolDefaultValue: '1000000' required: no

    -
    t1$get_output(id = "#aligned_reads")
    +
    +t1$get_output(id = "#aligned_reads")
    type:
     - 'null'
     - File
    @@ -389,7 +409,8 @@ 

    } class: Expression sbg:fileTypes: SAM, BAM

    -
    t1$get_output(name = "gene")
    +
    +t1$get_output(name = "gene")
    type:
     - 'null'
     - File
    @@ -409,9 +430,10 @@ 

    Introduction

    Before we continue, this is how it looks like for full tool description, you don’t always need to describe all those details, following section will walk you through simple examples to full examples like this one.

    -
    fl <- system.file("docker/rnaseqGene/rabix", "generator.R", package = "sevenbridges")
    -cat(readLines(fl), sep = "\n")
    -
    library("sevenbridges")
    +
    +fl <- system.file("docker/rnaseqGene/rabix", "generator.R", package = "sevenbridges")
    +cat(readLines(fl), sep = "\n")
    +
    library("sevenbridges")
     
     rbx <- Tool(
       id = "rnaseqGene",
    @@ -488,9 +510,9 @@ 

  39. outputs: outputs you want to collect
  40. -Requirements and hints: in short, hints are not required for execution. We now accept following requirement items cpu, mem, docker, fileDef; and you can easily construct them via requirements() constructor. This is how you describe the resources you need to execute the tool, so the system knows what type of instances suit your case best.
  41. +Requirements and hints: in short, hints are not required for execution. We now accept following requirement items cpu, mem, docker, fileDef; and you can easily construct them via requirements() constructor. This is how you describe the resources you need to execute the tool, so the system knows what type of instances suit your case best. -

    To specify inputs and outpus, usually your command line interface accept extra arguments as input, for example, file(s), string, enum, int, float, boolean. So to specify that in your tool, you can use input function, then pass it to the inputs arguments as a list or single item. You can even construct them as data.frame with less flexibility. input() require arguments id and type. output() require arguments id because type by default is file.

    +

    To specify inputs and outpus, usually your command line interface accept extra arguments as input, for example, file(s), string, enum, int, float, boolean. So to specify that in your tool, you can use input function, then pass it to the inputs arguments as a list or single item. You can even construct them as data.frame with less flexibility. input() require arguments id and type. output() require arguments id because type by default is file.

    There are some special type: ItemArray and enum. For ItemArray the type could be an array of single type, the most common case is that if your input is a list of files, you can do something like type = ItemArray("File") or as simple as type = "File..." to diffenciate from a single file input. When you add “…” suffix, R will know it’s an ItemArray.

    We also provide an enum type, when you specify the enum, please pass the required name and symbols like this type = enum("format", c("pdf", "html")) then in the UI on the platform you will be poped with drop down when you execute the task.

    Now let’s work though from simple case to most flexible case.

    @@ -500,18 +522,19 @@

    Using existing Docker images and command

    If you already have a Docker image in mind that provide the functionality you need, you can just use it. The baseCommand is the command line you want to execute in that container. stdout specify the output file you want to capture the standard output and collect it on the platform.

    In this simple example, we know Docker image rocker/r-base has a function called runif we can directly call in the command line with Rscript -e. Then we want the ouput to be collected in stdout and ask the file system to capture the output files that matches the pattern *.txt. Please pay attention to this, your tool may produce many intermediate files in the current folder, if you don’t tell which output you need, they will all be ignored, so make sure you collect those files via the outputs parameter.

    -
    library("sevenbridges")
    +
    +library("sevenbridges")
     
    -rbx <- Tool(
    -  id = "runif",
    -  label = "runif",
    -  hints = requirements(docker(pull = "rocker/r-base")),
    -  baseCommand = "Rscript -e 'runif(100)'",
    -  stdout = "output.txt",
    -  outputs = output(id = "random", glob = "*.txt")
    -)
    +rbx <- Tool(
    +  id = "runif",
    +  label = "runif",
    +  hints = requirements(docker(pull = "rocker/r-base")),
    +  baseCommand = "Rscript -e 'runif(100)'",
    +  stdout = "output.txt",
    +  outputs = output(id = "random", glob = "*.txt")
    +)
     
    -rbx
    +rbx
    sbg:id: runif
     id: '#runif'
     inputs: []
    @@ -536,12 +559,15 @@ 

    - Rscript -e 'runif(100)' arguments: [] stdout: output.txt

    -
    rbx$toJSON()
    +
    +rbx$toJSON()
    {"sbg:id":"runif","id":"#runif","inputs":[],"outputs":[{"type":["null","File"],"label":"","description":"","streamable":false,"default":"","id":"#random","outputBinding":{"glob":"*.txt"}}],"requirements":[],"hints":[{"class":"DockerRequirement","dockerPull":"rocker/r-base"}],"label":"runif","class":"CommandLineTool","baseCommand":["Rscript -e 'runif(100)'"],"arguments":[],"stdout":"output.txt"} 

    By default, the tool object shows YAML, but you can simply convert it to JSON and copy it to your seven bridges platform graphic editor by importing JSON.

    -
    rbx$toJSON()
    +
    +rbx$toJSON()
    {"sbg:id":"runif","id":"#runif","inputs":[],"outputs":[{"type":["null","File"],"label":"","description":"","streamable":false,"default":"","id":"#random","outputBinding":{"glob":"*.txt"}}],"requirements":[],"hints":[{"class":"DockerRequirement","dockerPull":"rocker/r-base"}],"label":"runif","class":"CommandLineTool","baseCommand":["Rscript -e 'runif(100)'"],"arguments":[],"stdout":"output.txt"} 
    -
    rbx$toJSON(pretty = TRUE)
    +
    +rbx$toJSON(pretty = TRUE)
    {
       "sbg:id": "runif",
       "id": "#runif",
    @@ -574,59 +600,62 @@ 

    "arguments": [], "stdout": "output.txt" }

    -
    rbx$toYAML()
    +
    +rbx$toYAML()
    [1] "sbg:id: runif\nid: '#runif'\ninputs: []\noutputs:\n- type:\n  - 'null'\n  - File\n  label: ''\n  description: ''\n  streamable: no\n  default: ''\n  id: '#random'\n  outputBinding:\n    glob: '*.txt'\nrequirements: []\nhints:\n- class: DockerRequirement\n  dockerPull: rocker/r-base\nlabel: runif\nclass: CommandLineTool\nbaseCommand:\n- Rscript -e 'runif(100)'\narguments: []\nstdout: output.txt\n"

    Add customized script to existing Docker image

    Now you may want to run your own R script, but you still don’t want to create new command line and a new Docker image. You just want to run your script with new input files in existing container, it’s time to introduce fileDef. You can either directly write script as string or just import a R file to content. And provided as requirements.

    -
    # Make a new file
    -fd <- fileDef(
    -  name = "runif.R",
    -  content = "set.seed(1); runif(100)"
    -)
    +
    +# Make a new file
    +fd <- fileDef(
    +  name = "runif.R",
    +  content = "set.seed(1); runif(100)"
    +)
     
     # read via reader
    -.srcfile <- system.file("docker/sevenbridges/src/runif.R", package = "sevenbridges")
    +.srcfile <- system.file("docker/sevenbridges/src/runif.R", package = "sevenbridges")
     
    -fd <- fileDef(
    -  name = "runif.R",
    -  content = readr::read_file(.srcfile)
    -)
    +fd <- fileDef(
    +  name = "runif.R",
    +  content = readr::read_file(.srcfile)
    +)
     
     # add script to your tool
    -rbx <- Tool(
    -  id = "runif",
    -  label = "runif",
    -  hints = requirements(docker(pull = "rocker/r-base")),
    -  requirements = requirements(fd),
    -  baseCommand = "Rscript runif.R",
    -  stdout = "output.txt",
    -  outputs = output(id = "random", glob = "*.txt")
    -)
    +rbx <- Tool( + id = "runif", + label = "runif", + hints = requirements(docker(pull = "rocker/r-base")), + requirements = requirements(fd), + baseCommand = "Rscript runif.R", + stdout = "output.txt", + outputs = output(id = "random", glob = "*.txt") +)

    How about multiple script?

    -
    # or simply readLines
    -.srcfile <- system.file("docker/sevenbridges/src/runif.R", package = "sevenbridges")
    +
    +# or simply readLines
    +.srcfile <- system.file("docker/sevenbridges/src/runif.R", package = "sevenbridges")
     
    -fd1 <- fileDef(
    -  name = "runif.R",
    -  content = readr::read_file(.srcfile)
    -)
    -fd2 <- fileDef(
    -  name = "runif2.R",
    -  content = "set.seed(1); runif(100)"
    -)
    +fd1 <- fileDef(
    +  name = "runif.R",
    +  content = readr::read_file(.srcfile)
    +)
    +fd2 <- fileDef(
    +  name = "runif2.R",
    +  content = "set.seed(1); runif(100)"
    +)
     
    -rbx <- Tool(
    -  id = "runif_twoscript",
    -  label = "runif_twoscript",
    -  hints = requirements(docker(pull = "rocker/r-base")),
    -  requirements = requirements(fd1, fd2),
    -  baseCommand = "Rscript runif.R",
    -  stdout = "output.txt",
    -  outputs = output(id = "random", glob = "*.txt")
    -)
    +rbx <- Tool( + id = "runif_twoscript", + label = "runif_twoscript", + hints = requirements(docker(pull = "rocker/r-base")), + requirements = requirements(fd1, fd2), + baseCommand = "Rscript runif.R", + stdout = "output.txt", + outputs = output(id = "random", glob = "*.txt") +)

    @@ -660,99 +689,101 @@

    cmdInclude: included in command line or not.

    Output is similar, espeicaly when you want to collect file, you can use glob for pattern matching.

    -
    # pass a input list
    -in.lst <- list(
    -  input(
    -    id = "number",
    -    description = "number of observations",
    -    type = "integer",
    -    label = "number",
    -    prefix = "--n",
    -    default = 1,
    -    required = TRUE,
    -    cmdInclude = TRUE
    -  ),
    -  input(
    -    id = "min",
    -    description = "lower limits of the distribution",
    -    type = "float",
    -    label = "min",
    -    prefix = "--min",
    -    default = 0
    -  ),
    -  input(
    -    id = "max",
    -    description = "upper limits of the distribution",
    -    type = "float",
    -    label = "max",
    -    prefix = "--max",
    -    default = 1
    -  ),
    -  input(
    -    id = "seed",
    -    description = "seed with set.seed",
    -    type = "float",
    -    label = "seed",
    -    prefix = "--seed",
    -    default = 1
    -  )
    -)
    +
    +# pass a input list
    +in.lst <- list(
    +  input(
    +    id = "number",
    +    description = "number of observations",
    +    type = "integer",
    +    label = "number",
    +    prefix = "--n",
    +    default = 1,
    +    required = TRUE,
    +    cmdInclude = TRUE
    +  ),
    +  input(
    +    id = "min",
    +    description = "lower limits of the distribution",
    +    type = "float",
    +    label = "min",
    +    prefix = "--min",
    +    default = 0
    +  ),
    +  input(
    +    id = "max",
    +    description = "upper limits of the distribution",
    +    type = "float",
    +    label = "max",
    +    prefix = "--max",
    +    default = 1
    +  ),
    +  input(
    +    id = "seed",
    +    description = "seed with set.seed",
    +    type = "float",
    +    label = "seed",
    +    prefix = "--seed",
    +    default = 1
    +  )
    +)
     
     # the same method for outputs
    -out.lst <- list(
    -  output(
    -    id = "random",
    -    type = "file",
    -    label = "output",
    -    description = "random number file",
    -    glob = "*.txt"
    -  ),
    -  output(
    -    id = "report",
    -    type = "file",
    -    label = "report",
    -    glob = "*.html"
    -  )
    -)
    +out.lst <- list(
    +  output(
    +    id = "random",
    +    type = "file",
    +    label = "output",
    +    description = "random number file",
    +    glob = "*.txt"
    +  ),
    +  output(
    +    id = "report",
    +    type = "file",
    +    label = "report",
    +    glob = "*.html"
    +  )
    +)
     
    -rbx <- Tool(
    -  id = "runif",
    -  label = "Random number generator",
    -  hints = requirements(docker(pull = "RFranklin/runif")),
    -  baseCommand = "runif.R",
    -  inputs = in.lst, # or ins.df
    -  outputs = out.lst
    -)
    +rbx <- Tool( + id = "runif", + label = "Random number generator", + hints = requirements(docker(pull = "RFranklin/runif")), + baseCommand = "runif.R", + inputs = in.lst, # or ins.df + outputs = out.lst +)

    Alternatively you can use data.frame as example for input and output, but it’s less flexible.

    -
    in.df <- data.frame(
    -  id = c("number", "min", "max", "seed"),
    -  description = c(
    +
    +in.df <- data.frame(
    +  id = c("number", "min", "max", "seed"),
    +  description = c(
         "number of observation",
         "lower limits of the distribution",
         "upper limits of the distribution",
         "seed with set.seed"
    -  ),
    -  type = c("integer", "float", "float", "float"),
    -  label = c("number", "min", "max", "seed"),
    -  prefix = c("--n", "--min", "--max", "--seed"),
    -  default = c(1, 0, 10, 123),
    -  required = c(TRUE, FALSE, FALSE, FALSE)
    -)
    +  ),
    +  type = c("integer", "float", "float", "float"),
    +  label = c("number", "min", "max", "seed"),
    +  prefix = c("--n", "--min", "--max", "--seed"),
    +  default = c(1, 0, 10, 123),
    +  required = c(TRUE, FALSE, FALSE, FALSE)
    +)
     
    -out.df <- data.frame(
    -  id = c("random", "report"),
    -  type = c("file", "file"),
    -  glob = c("*.txt", "*.html")
    -)
    +out.df <- data.frame(
    +  id = c("random", "report"),
    +  type = c("file", "file"),
    +  glob = c("*.txt", "*.html")
    +)
     
    -rbx <- Tool(
    -  id = "runif",
    -  label = "Random number generator",
    -  hints = requirements(docker(pull = "RFranklin/runif"), cpu(1), mem(2000)),
    -  baseCommand = "runif.R",
    -  inputs = in.df, # or ins.df
    -  outputs = out.df
    -)
    +rbx <- Tool( + id = "runif", + label = "Random number generator", + hints = requirements(docker(pull = "RFranklin/runif"), cpu(1), mem(2000)), + baseCommand = "runif.R", + inputs = in.df, # or ins.df + outputs = out.df +)

    @@ -767,10 +798,11 @@

    My base command will be somethine like

    Rscript runif2spin.R 10 30 50

    This is how you do in your R script

    -
    fl <- system.file("docker/sevenbridges/src", "runif2spin.R",
    -  package = "sevenbridges"
    -)
    -cat(readLines(fl), sep = "\n")
    +
    +fl <- system.file("docker/sevenbridges/src", "runif2spin.R",
    +  package = "sevenbridges"
    +)
    +cat(readLines(fl), sep = "\n")
    #' ---
     #' title: "Uniform random number generator example"
     #' output:
    @@ -794,42 +826,44 @@ 

    hist(r)

    Ignore the comment part, I will introduce spin/stich later.

    Then just describe my tool in this way, add your script as you learned in previous sections.

    -
    fd <- fileDef(
    -  name = "runif.R",
    -  content = readr::read_file(fl)
    -)
    +
    +fd <- fileDef(
    +  name = "runif.R",
    +  content = readr::read_file(fl)
    +)
     
    -rbx <- Tool(
    -  id = "runif",
    -  label = "runif",
    -  hints = requirements(docker(pull = "rocker/r-base"), cpu(1), mem(2000)),
    -  requirements = requirements(fd),
    -  baseCommand = "Rscript runif.R",
    -  stdout = "output.txt",
    -  inputs = list(
    -    input(
    -      id = "number",
    -      type = "integer",
    -      position = 1
    -    ),
    -    input(
    -      id = "min",
    -      type = "float",
    -      position = 2
    -    ),
    -    input(
    -      id = "max",
    -      type = "float",
    -      position = 3
    -    )
    -  ),
    -  outputs = output(id = "random", glob = "output.txt")
    -)
    +rbx <- Tool( + id = "runif", + label = "runif", + hints = requirements(docker(pull = "rocker/r-base"), cpu(1), mem(2000)), + requirements = requirements(fd), + baseCommand = "Rscript runif.R", + stdout = "output.txt", + inputs = list( + input( + id = "number", + type = "integer", + position = 1 + ), + input( + id = "min", + type = "float", + position = 2 + ), + input( + id = "max", + type = "float", + position = 3 + ) + ), + outputs = output(id = "random", glob = "output.txt") +)

    How about named argumentments? I will still recommend use “docopt” package, but for simple way. You want command line looks like this

    Rscript runif_args.R --n=10 --min=30 --max=50

    Here is how you do in R script.

    -
    fl <- system.file("docker/sevenbridges/src", "runif_args.R", package = "sevenbridges")
    -cat(readLines(fl), sep = "\n")
    +
    +fl <- system.file("docker/sevenbridges/src", "runif_args.R", package = "sevenbridges")
    +cat(readLines(fl), sep = "\n")
    #' ---
     #' title: "Uniform random number generator example"
     #' output:
    @@ -865,41 +899,42 @@ 

    summary(r) hist(r) write.csv(r, file = "out.csv")

    -

    Then just describe my tool in this way, note, I use separate=FALSE and add = to my prefix as a hack.

    -
    fd <- fileDef(
    -  name = "runif.R",
    -  content = readr::read_file(fl)
    -)
    +

    Then just describe my tool in this way, note, I use separate=FALSE and add = to my prefix as a hack.

    +
    +fd <- fileDef(
    +  name = "runif.R",
    +  content = readr::read_file(fl)
    +)
     
    -rbx <- Tool(
    -  id = "runif",
    -  label = "runif",
    -  hints = requirements(docker(pull = "rocker/r-base"), cpu(1), mem(2000)),
    -  requirements = requirements(fd),
    -  baseCommand = "Rscript runif.R",
    -  stdout = "output.txt",
    -  inputs = list(
    -    input(
    -      id = "number",
    -      type = "integer",
    -      separate = FALSE,
    -      prefix = "--n="
    -    ),
    -    input(
    -      id = "min",
    -      type = "float",
    -      separate = FALSE,
    -      prefix = "--min="
    -    ),
    -    input(
    -      id = "max",
    -      type = "float",
    -      separate = FALSE,
    -      prefix = "--max="
    -    )
    -  ),
    -  outputs = output(id = "random", glob = "output.txt")
    -)
    +rbx <- Tool( + id = "runif", + label = "runif", + hints = requirements(docker(pull = "rocker/r-base"), cpu(1), mem(2000)), + requirements = requirements(fd), + baseCommand = "Rscript runif.R", + stdout = "output.txt", + inputs = list( + input( + id = "number", + type = "integer", + separate = FALSE, + prefix = "--n=" + ), + input( + id = "min", + type = "float", + separate = FALSE, + prefix = "--min=" + ), + input( + id = "max", + type = "float", + separate = FALSE, + prefix = "--max=" + ) + ), + outputs = output(id = "random", glob = "output.txt") +)

    @@ -910,8 +945,9 @@

    Generate reports

    Quick report: Spin and Stich

    You can use spin/stich from knitr to generate report directly from a Rscript with special format. For example, let’s use above example

    -
    fl <- system.file("docker/sevenbridges/src", "runif_args.R", package = "sevenbridges")
    -cat(readLines(fl), sep = "\n")
    +
    +fl <- system.file("docker/sevenbridges/src", "runif_args.R", package = "sevenbridges")
    +cat(readLines(fl), sep = "\n")
    #' ---
     #' title: "Uniform random number generator example"
     #' output:
    @@ -950,44 +986,45 @@ 

    You command is something like this

    Rscript -e "rmarkdown::render(knitr::spin('runif_args.R', FALSE))" --args --n=100 --min=30 --max=50

    And so I describe my tool like this with Docker image rocker/tidyverse which contians the knitr and rmarkdown packages.

    -
    fd <- fileDef(
    -  name = "runif.R",
    -  content = readr::read_file(fl)
    -)
    +
    +fd <- fileDef(
    +  name = "runif.R",
    +  content = readr::read_file(fl)
    +)
     
    -rbx <- Tool(
    -  id = "runif",
    -  label = "runif",
    -  hints = requirements(docker(pull = "rocker/tidyverse"), cpu(1), mem(2000)),
    -  requirements = requirements(fd),
    -  baseCommand = "Rscript -e \"rmarkdown::render(knitr::spin('runif.R', FALSE))\" --args",
    -  stdout = "output.txt",
    -  inputs = list(
    -    input(
    -      id = "number",
    -      type = "integer",
    -      separate = FALSE,
    -      prefix = "--n="
    -    ),
    -    input(
    -      id = "min",
    -      type = "float",
    -      separate = FALSE,
    -      prefix = "--min="
    -    ),
    -    input(
    -      id = "max",
    -      type = "float",
    -      separate = FALSE,
    -      prefix = "--max="
    -    )
    -  ),
    -  outputs = list(
    -    output(id = "stdout", type = "file", glob = "output.txt"),
    -    output(id = "random", type = "file", glob = "*.csv"),
    -    output(id = "report", type = "file", glob = "*.html")
    -  )
    -)
    +rbx <- Tool( + id = "runif", + label = "runif", + hints = requirements(docker(pull = "rocker/tidyverse"), cpu(1), mem(2000)), + requirements = requirements(fd), + baseCommand = "Rscript -e \"rmarkdown::render(knitr::spin('runif.R', FALSE))\" --args", + stdout = "output.txt", + inputs = list( + input( + id = "number", + type = "integer", + separate = FALSE, + prefix = "--n=" + ), + input( + id = "min", + type = "float", + separate = FALSE, + prefix = "--min=" + ), + input( + id = "max", + type = "float", + separate = FALSE, + prefix = "--max=" + ) + ), + outputs = list( + output(id = "stdout", type = "file", glob = "output.txt"), + output(id = "random", type = "file", glob = "*.csv"), + output(id = "report", type = "file", glob = "*.html") + ) +)

    You will get a report in the end.

    @@ -995,27 +1032,28 @@

    Misc

    Inherit metadata and additional metadata

    Sometimes if you want your output files inherit from particular input file, just use inheritMetadataFrom in your output() call and pass the input file id. If you want to add additional metadata, you could pass metadata a list in your output() function call. For example, I want my output report inherit all metadata from my “bam_file” input node (which I don’t have in this example though) with two additional metadata fields.

    -
    out.lst <- list(
    -  output(
    -    id = "random",
    -    type = "file",
    -    label = "output",
    -    description = "random number file",
    -    glob = "*.txt"
    -  ),
    -  output(
    -    id = "report",
    -    type = "file",
    -    label = "report",
    -    glob = "*.html",
    -    inheritMetadataFrom = "bam_file",
    -    metadata = list(
    -      author = "RFranklin",
    -      sample = "random"
    -    )
    -  )
    -)
    -out.lst
    +
    +out.lst <- list(
    +  output(
    +    id = "random",
    +    type = "file",
    +    label = "output",
    +    description = "random number file",
    +    glob = "*.txt"
    +  ),
    +  output(
    +    id = "report",
    +    type = "file",
    +    label = "report",
    +    glob = "*.html",
    +    inheritMetadataFrom = "bam_file",
    +    metadata = list(
    +      author = "RFranklin",
    +      sample = "random"
    +    )
    +  )
    +)
    +out.lst
    [[1]]
     type:
     - 'null'
    @@ -1045,9 +1083,10 @@ 

    author: RFranklin sample: random

    Example with file/files as input node

    -
    fl <- system.file("docker/rnaseqGene/rabix", "generator.R", package = "sevenbridges")
    -cat(readLines(fl), sep = "\n")
    -
    library("sevenbridges")
    +
    +fl <- system.file("docker/rnaseqGene/rabix", "generator.R", package = "sevenbridges")
    +cat(readLines(fl), sep = "\n")
    +
    library("sevenbridges")
     
     rbx <- Tool(
       id = "rnaseqGene",
    @@ -1115,13 +1154,15 @@ 

    Note the stageInput example in the above script, you can set it to “copy” or “link”.

    Input node batch mode

    Batch by File (the long output has been omitted here):

    -
    f1 <- system.file("extdata/app", "flow_star.json", package = "sevenbridges")
    -f1 <- convert_app(f1)
    -f1$set_batch("sjdbGTFfile", type = "ITEM")
    +
    +f1 <- system.file("extdata/app", "flow_star.json", package = "sevenbridges")
    +f1 <- convert_app(f1)
    +f1$set_batch("sjdbGTFfile", type = "ITEM")

    Batch by other critieria such as metadta, following example, is using sample_id and library_id (the long output has been omitted here):

    -
    f1 <- system.file("extdata/app", "flow_star.json", package = "sevenbridges")
    -f1 <- convert_app(f1)
    -f1$set_batch("sjdbGTFfile", c("metadata.sample_id", "metadata.library_id"))
    +
    +f1 <- system.file("extdata/app", "flow_star.json", package = "sevenbridges")
    +f1 <- convert_app(f1)
    +f1$set_batch("sjdbGTFfile", c("metadata.sample_id", "metadata.library_id"))
    criteria provided, convert type from ITEM to CRITERIA

    When you push your app to the platform, you will see the batch available at task page or workflow editor.

    @@ -1135,19 +1176,21 @@

    Import from a JSON file

    Yes, you could use the same function convert_app to import JSON files.

    -
    f1 <- system.file("extdata/app", "flow_star.json", package = "sevenbridges")
    -f1 <- convert_app(f1)
    +
    +f1 <- system.file("extdata/app", "flow_star.json", package = "sevenbridges")
    +f1 <- convert_app(f1)
     # show it
    -# f1
    +# f1

    Utilities for Flow objects

    Just like Tool object, you also have convenient utils for it, especially useful when you execute task.

    -
    f1 <- system.file("extdata/app", "flow_star.json", package = "sevenbridges")
    -f1 <- convert_app(f1)
    +
    +f1 <- system.file("extdata/app", "flow_star.json", package = "sevenbridges")
    +f1 <- convert_app(f1)
     # input matrix
    -head(f1$input_matrix())
    +head(f1$input_matrix())
                                   id               label    type required
     1                    #sjdbGTFfile         sjdbGTFfile File...    FALSE
     2                          #fastq               fastq File...     TRUE
    @@ -1162,8 +1205,9 @@ 

    4 null 5 null 6 null

    -
    # by name
    -head(f1$input_matrix(c("id", "type", "required")))
    +
    +# by name
    +head(f1$input_matrix(c("id", "type", "required")))
                                   id    type required
     1                    #sjdbGTFfile File...    FALSE
     2                          #fastq File...     TRUE
    @@ -1171,13 +1215,15 @@ 

    4 #sjdbGTFtagExonParentTranscript string FALSE 5 #sjdbGTFtagExonParentGene string FALSE 6 #winAnchorMultimapNmax int FALSE

    -
    # return only required
    -head(f1$input_matrix(required = TRUE))
    +
    +# return only required
    +head(f1$input_matrix(required = TRUE))
                     id            label    type required fileTypes
     2            #fastq            fastq File...     TRUE      null
     3 #genomeFastaFiles genomeFastaFiles    File     TRUE      null
    -
    # return everything
    -head(f1$input_matrix(NULL))
    +
    +# return everything
    +head(f1$input_matrix(NULL))
                                   id    type required fileTypes
     1                    #sjdbGTFfile File...    FALSE      null
     2                          #fastq File...     TRUE      null
    @@ -1213,8 +1259,9 @@ 

    4 transcript_id #STAR_Genome_Generate.sjdbGTFtagExonParentTranscript 5 gene_id #STAR_Genome_Generate.sjdbGTFtagExonParentGene 6 50 #STAR.winAnchorMultimapNmax

    -
    # return a output matrix with more information
    -head(f1$output_matrix())
    +
    +# return a output matrix with more information
    +head(f1$output_matrix())
                                id                       label    type fileTypes
     1              #unmapped_reads              unmapped_reads File...      null
     2 #transcriptome_aligned_reads transcriptome_aligned_reads    File      null
    @@ -1222,8 +1269,9 @@ 

    4 #reads_per_gene reads_per_gene File null 5 #log_files log_files File... null 6 #chimeric_junctions chimeric_junctions File null

    -
    # return only a few fields
    -head(f1$output_matrix(c("id", "type")))
    +
    +# return only a few fields
    +head(f1$output_matrix(c("id", "type")))
                                id    type
     1              #unmapped_reads File...
     2 #transcriptome_aligned_reads    File
    @@ -1231,8 +1279,9 @@ 

    4 #reads_per_gene File 5 #log_files File... 6 #chimeric_junctions File

    -
    # return everything
    -head(f1$output_matrix(NULL))
    +
    +# return everything
    +head(f1$output_matrix(NULL))
                                id                       label    type fileTypes
     1              #unmapped_reads              unmapped_reads File...      null
     2 #transcriptome_aligned_reads transcriptome_aligned_reads    File      null
    @@ -1254,8 +1303,9 @@ 

    4 1394.4164 245.74996 #STAR.reads_per_gene 5 1505.0830 322.99995 #STAR.log_files 6 1278.7498 446.74996 #STAR.chimeric_junctions

    -
    # flow inputs
    -f1$input_type()
    +
    +# flow inputs
    +f1$input_type()
                       sjdbGTFfile                          fastq 
                          "File..."                      "File..." 
                   genomeFastaFiles sjdbGTFtagExonParentTranscript 
    @@ -1264,8 +1314,9 @@ 

    "string" "int" winAnchorDistNbins "int"

    -
    # flow outouts
    -f1$output_type()
    +
    +# flow outouts
    +f1$output_type()
                 unmapped_reads transcriptome_aligned_reads 
                       "File..."                      "File" 
                splice_junctions              reads_per_gene 
    @@ -1276,8 +1327,9 @@ 

    "File" "File" sorted_bam result "File" "File"

    -
    # list tools
    -f1$list_tool()
    +
    +# list tools
    +f1$list_tool()
                           label
     1       STAR Genome Generate
     2 SBG FASTQ Quality Detector
    @@ -1293,8 +1345,9 @@ 

    2 #SBG_FASTQ_Quality_Detector 3 #Picard_SortSam 4 #STAR

    -
    # f1$get_tool("STAR")
    -

    There are more utilities please check example at help(Flow)

    +
    +# f1$get_tool("STAR")
    +

    There are more utilities please check example at help(Flow)

    @@ -1318,99 +1371,103 @@

  42. Tool 2 take log on it
  43. Tool 3 do a mean calculation of everything
  44. -
    library("sevenbridges")
    +
    +library("sevenbridges")
     # A tool that generates 100 random numbers
    -t1 <- Tool(
    -  id = "runif new test 3", label = "random number",
    -  hints = requirements(docker(pull = "rocker/r-base")),
    -  baseCommand = "Rscript -e 'x = runif(100); write.csv(x, file = 'random.txt', row.names = FALSE)'",
    -  outputs = output(
    -    id = "random",
    -    type = "file",
    -    glob = "random.txt"
    -  )
    -)
    +t1 <- Tool(
    +  id = "runif new test 3", label = "random number",
    +  hints = requirements(docker(pull = "rocker/r-base")),
    +  baseCommand = "Rscript -e 'x = runif(100); write.csv(x, file = 'random.txt', row.names = FALSE)'",
    +  outputs = output(
    +    id = "random",
    +    type = "file",
    +    glob = "random.txt"
    +  )
    +)
     
     # A tool that takes log
    -fd <- fileDef(
    -  name = "log.R",
    -  content = "args = commandArgs(TRUE)
    +fd <- fileDef(
    +  name = "log.R",
    +  content = "args = commandArgs(TRUE)
                              x = read.table(args[1], header = TRUE)[,'x']
                              x = log(x)
                              write.csv(x, file = 'random_log.txt', row.names = FALSE)
                              "
    -)
    +)
     
    -t2 <- Tool(
    -  id = "log new test 3", label = "get log",
    -  hints = requirements(docker(pull = "rocker/r-base")),
    -  requirements = requirements(fd),
    -  baseCommand = "Rscript log.R",
    -  inputs = input(
    -    id = "number",
    -    type = "file"
    -  ),
    -  outputs = output(
    -    id = "log",
    -    type = "file",
    -    glob = "*.txt"
    -  )
    -)
    +t2 <- Tool(
    +  id = "log new test 3", label = "get log",
    +  hints = requirements(docker(pull = "rocker/r-base")),
    +  requirements = requirements(fd),
    +  baseCommand = "Rscript log.R",
    +  inputs = input(
    +    id = "number",
    +    type = "file"
    +  ),
    +  outputs = output(
    +    id = "log",
    +    type = "file",
    +    glob = "*.txt"
    +  )
    +)
     
     # A tool that do a mean
    -fd <- fileDef(
    -  name = "mean.R",
    -  content = "args = commandArgs(TRUE)
    +fd <- fileDef(
    +  name = "mean.R",
    +  content = "args = commandArgs(TRUE)
                              x = read.table(args[1], header = TRUE)[,'x']
                              x = mean(x)
                              write.csv(x, file = 'random_mean.txt', row.names = FALSE)"
    -)
    +)
     
    -t3 <- Tool(
    -  id = "mean new test 3", label = "get mean",
    -  hints = requirements(docker(pull = "rocker/r-base")),
    -  requirements = requirements(fd),
    -  baseCommand = "Rscript mean.R",
    -  inputs = input(
    -    id = "number",
    -    type = "file"
    -  ),
    -  outputs = output(
    -    id = "mean",
    -    type = "file",
    -    glob = "*.txt"
    -  )
    -)
    +t3 <- Tool(
    +  id = "mean new test 3", label = "get mean",
    +  hints = requirements(docker(pull = "rocker/r-base")),
    +  requirements = requirements(fd),
    +  baseCommand = "Rscript mean.R",
    +  inputs = input(
    +    id = "number",
    +    type = "file"
    +  ),
    +  outputs = output(
    +    id = "mean",
    +    type = "file",
    +    glob = "*.txt"
    +  )
    +)
     
    -f <- t1 %>>% t2
    +f <- t1 %>>% t2
    flow_output: #get_log.log
    -
    f <- link(t1, t2, "#random", "#number")
    +
    +f <- link(t1, t2, "#random", "#number")
    flow_output: #get_log.log
    -
    # # you cannot directly copy-paste it
    +
    +# # you cannot directly copy-paste it
     # # please push it using API, we will register each tool for you
     # clipr::write_clip(jsonlite::toJSON(f, pretty = TRUE))
     
    -t2 <- Tool(
    -  id = "log new test 3", label = "get log",
    -  hints = requirements(docker(pull = "rocker/r-base")),
    -  requirements = requirements(fd),
    -  baseCommand = "Rscript log.R",
    -  inputs = input(
    -    id = "number",
    -    type = "file",
    -    secondaryFiles = sevenbridges:::set_box(".bai")
    -  ),
    -  outputs = output(
    -    id = "log",
    -    type = "file",
    -    glob = "*.txt"
    -  )
    -)
    +t2 <- Tool(
    +  id = "log new test 3", label = "get log",
    +  hints = requirements(docker(pull = "rocker/r-base")),
    +  requirements = requirements(fd),
    +  baseCommand = "Rscript log.R",
    +  inputs = input(
    +    id = "number",
    +    type = "file",
    +    secondaryFiles = sevenbridges:::set_box(".bai")
    +  ),
    +  outputs = output(
    +    id = "log",
    +    type = "file",
    +    glob = "*.txt"
    +  )
    +)
     
    -# clipr::write_clip(jsonlite::toJSON(t2, pretty = TRUE))
    +# clipr::write_clip(jsonlite::toJSON(t2, pretty = TRUE))

    Note: this workflow contains tools that do not exist on the platform, so if you copy and paste the JSON directly into the GUI, it won’t work properly. However, a simple way is to push your app to the platform via API. This will add new tools one by one to your project before add your workflow app on the platform. Alternatively, if you connect two tools you know that exist on the platform, you don’t need to do so.

    -
    # auto-check tool info and push new tools
    -p$app_add("new_flow_log", f)
    +
    +# auto-check tool info and push new tools
    +p$app_add("new_flow_log", f)

    @@ -1422,16 +1479,17 @@

    Checking potential mapping is easy with function link_what, it will print matched input and outputs. Then the generic function link will allow you to connect two Tool objects

    If you don’t specify which input/ouput to expose at flow level for new Flow object, it will expose all availabl ones and print the message, otherwise, please provide parameters for flow_input and flow_output with full id.

    -
    t1 <- system.file("extdata/app", "tool_unpack_fastq.json",
    -  package = "sevenbridges"
    -)
    -t2 <- system.file("extdata/app", "tool_star.json",
    -  package = "sevenbridges"
    -)
    -t1 <- convert_app(t1)
    -t2 <- convert_app(t2)
    +
    +t1 <- system.file("extdata/app", "tool_unpack_fastq.json",
    +  package = "sevenbridges"
    +)
    +t2 <- system.file("extdata/app", "tool_star.json",
    +  package = "sevenbridges"
    +)
    +t1 <- convert_app(t1)
    +t2 <- convert_app(t2)
     # check possible link
    -link_what(t1, t2)
    +link_what(t1, t2)
    $File...
     $File...$from
                        id              label    type fileTypes          full.name
    @@ -1444,15 +1502,18 @@ 

    fileTypes full.name 1 FASTA, FASTQ, FA, FQ, FASTQ.GZ, FQ.GZ, FASTQ.BZ2, FQ.BZ2 #STAR 95 GTF, GFF, TXT #STAR

    -
    # link
    -f1 <- link(t1, t2, "output_fastq_files", "reads")
    +
    +# link
    +f1 <- link(t1, t2, "output_fastq_files", "reads")
    flow_input: #SBG_Unpack_FASTQs.input_archive_file / #STAR.sjdbGTFfile / #STAR.genome
    flow_output: #STAR.aligned_reads / #STAR.transcriptome_aligned_reads / #STAR.reads_per_gene / #STAR.log_files / #STAR.splice_junctions / #STAR.chimeric_junctions / #STAR.unmapped_reads / #STAR.intermediate_genome / #STAR.chimeric_alignments
    -
    # link
    -t1$output_id(TRUE)
    +
    +# link
    +t1$output_id(TRUE)
                                    File... 
     "#SBG_Unpack_FASTQs.output_fastq_files" 
    -
    t2$input_id(TRUE)
    +
    +t2$input_id(TRUE)
                                     File... 
                                "#STAR.reads" 
                                         enum 
    @@ -1663,24 +1724,27 @@ 

    "#STAR.quantTranscriptomeBan" int "#STAR.limitBAMsortRAM"

    -
    f2 <- link(t1, t2, "output_fastq_files", "reads",
    -  flow_input = "#SBG_Unpack_FASTQs.input_archive_file",
    -  flow_output = "#STAR.log_files"
    -)
    +
    +f2 <- link(t1, t2, "output_fastq_files", "reads",
    +  flow_input = "#SBG_Unpack_FASTQs.input_archive_file",
    +  flow_output = "#STAR.log_files"
    +)
    flow_input: #SBG_Unpack_FASTQs.input_archive_file / #STAR.genome
    flow_output: #STAR.log_files
    -
    # clipr::write_clip(jsonlite::toJSON(f2))
    +
    +# clipr::write_clip(jsonlite::toJSON(f2))

    Connecting tool with workflow by input and output id

    -
    tool.in <- system.file("extdata/app", "tool_unpack_fastq.json", package = "sevenbridges")
    -flow.in <- system.file("extdata/app", "flow_star.json", package = "sevenbridges")
    +
    +tool.in <- system.file("extdata/app", "tool_unpack_fastq.json", package = "sevenbridges")
    +flow.in <- system.file("extdata/app", "flow_star.json", package = "sevenbridges")
     
    -t1 <- convert_app(tool.in)
    -f2 <- convert_app(flow.in)
    +t1 <- convert_app(tool.in)
    +f2 <- convert_app(flow.in)
     # consulting link_what first
    -f2$link_map()
    +f2$link_map()
                                                         id
     1  #STAR_Genome_Generate.sjdbGTFtagExonParentTranscript
     2        #STAR_Genome_Generate.sjdbGTFtagExonParentGene
    @@ -1725,11 +1789,12 @@ 

    19 #STAR.chimeric_alignments output 20 #Picard_SortSam.sorted_bam output 21 #SBG_FASTQ_Quality_Detector.result output

    -
    # then link
    +
    +# then link
     
    -f3 <- link(t1, f2, c("output_fastq_files"), c("#SBG_FASTQ_Quality_Detector.fastq"))
    +f3 <- link(t1, f2, c("output_fastq_files"), c("#SBG_FASTQ_Quality_Detector.fastq"))
     
    -link_what(f2, t1)
    +link_what(f2, t1)
    $File
     $File$from
                                  id                       label type required
    @@ -1756,14 +1821,16 @@ 

    1 #input_archive_file Input archive file File TRUE --input_archive_file fileTypes 1 TAR, TAR.GZ, TGZ, TAR.BZ2, TBZ2, GZ, BZ2, ZIP

    -
    f4 <- link(f2, t1, c("#Picard_SortSam.sorted_bam", "#SBG_FASTQ_Quality_Detector.result"), c("#input_archive_file", "#input_archive_file"))
    +
    +f4 <- link(f2, t1, c("#Picard_SortSam.sorted_bam", "#SBG_FASTQ_Quality_Detector.result"), c("#input_archive_file", "#input_archive_file"))
    flow_input: #SBG_Unpack_FASTQs.input_archive_file
    flow_output: #SBG_Unpack_FASTQs.output_fastq_files
    -
    # # TODO
    -# # all outputs
    -# # flow + flow
    -# # print message when name wrong
    -# clipr::write_clip(jsonlite::toJSON(f4))
    +
    +# # TODO
    +# # all outputs
    +# # flow + flow
    +# # print message when name wrong
    +# clipr::write_clip(jsonlite::toJSON(f4))

    @@ -1779,17 +1846,18 @@

    Execute the tool and flow in the cloud

    With API function, you can directly load your Tool into the account. Run a task, for “how-to”, please check the complete guide for API client.

    Here is a quick demo:

    -
    a <- Auth(platform = "platform_name", token = "your_token")
    -p <- a$project("demo")
    -app.runif <- p$app_add("runif555", rbx)
    -aid <- app.runif$id
    -tsk <- p$task_add(
    -  name = "Draft runif simple",
    -  description = "Description for runif",
    -  app = aid,
    -  inputs = list(min = 1, max = 10)
    -)
    -tsk$run()
    +
    +a <- Auth(platform = "platform_name", token = "your_token")
    +p <- a$project("demo")
    +app.runif <- p$app_add("runif555", rbx)
    +aid <- app.runif$id
    +tsk <- p$task_add(
    +  name = "Draft runif simple",
    +  description = "Description for runif",
    +  app = aid,
    +  inputs = list(min = 1, max = 10)
    +)
    +tsk$run()

    @@ -1809,39 +1877,40 @@

    Note 2: inputs.json can also be inputs.yaml if you find it easier to declare inputs in YAML.

    2. From R

    -
    library("sevenbridges")
    +
    +library("sevenbridges")
     
    -in.df <- data.frame(
    -  id = c("number", "min", "max", "seed"),
    -  description = c(
    +in.df <- data.frame(
    +  id = c("number", "min", "max", "seed"),
    +  description = c(
         "number of observation",
         "lower limits of the distribution",
         "upper limits of the distribution",
         "seed with set.seed"
    -  ),
    -  type = c("integer", "float", "float", "float"),
    -  label = c("number", "min", "max", "seed"),
    -  prefix = c("--n", "--min", "--max", "--seed"),
    -  default = c(1, 0, 10, 123),
    -  required = c(TRUE, FALSE, FALSE, FALSE)
    -)
    -out.df <- data.frame(
    -  id = c("random", "report"),
    -  type = c("file", "file"),
    -  glob = c("*.txt", "*.html")
    -)
    -rbx <- Tool(
    -  id = "runif",
    -  label = "Random number generator",
    -  hints = requirements(docker(pull = "RFranklin/runif"), cpu(1), mem(2000)),
    -  baseCommand = "runif.R",
    -  inputs = in.df, # or ins.df
    -  outputs = out.df
    -)
    -params <- list(number = 3, max = 5)
    +  ),
    +  type = c("integer", "float", "float", "float"),
    +  label = c("number", "min", "max", "seed"),
    +  prefix = c("--n", "--min", "--max", "--seed"),
    +  default = c(1, 0, 10, 123),
    +  required = c(TRUE, FALSE, FALSE, FALSE)
    +)
    +out.df <- data.frame(
    +  id = c("random", "report"),
    +  type = c("file", "file"),
    +  glob = c("*.txt", "*.html")
    +)
    +rbx <- Tool(
    +  id = "runif",
    +  label = "Random number generator",
    +  hints = requirements(docker(pull = "RFranklin/runif"), cpu(1), mem(2000)),
    +  baseCommand = "runif.R",
    +  inputs = in.df, # or ins.df
    +  outputs = out.df
    +)
    +params <- list(number = 3, max = 5)
     
    -set_test_env("RFranklin/testenv", "mount_dir")
    -test_tool(rbx, params)
    +set_test_env("RFranklin/testenv", "mount_dir") +test_tool(rbx, params)

    @@ -1857,11 +1926,11 @@

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/articles/apps_files/header-attrs-2.4/header-attrs.js b/docs/articles/apps_files/header-attrs-2.4/header-attrs.js new file mode 100644 index 0000000..dd57d92 --- /dev/null +++ b/docs/articles/apps_files/header-attrs-2.4/header-attrs.js @@ -0,0 +1,12 @@ +// Pandoc 2.9 adds attributes on both header and div. We remove the former (to +// be compatible with the behavior of Pandoc < 2.8). +document.addEventListener('DOMContentLoaded', function(e) { + var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); + var i, h, a; + for (i = 0; i < hs.length; i++) { + h = hs[i]; + if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 + a = h.attributes; + while (a.length > 0) h.removeAttribute(a[0].name); + } +}); diff --git a/docs/articles/bioc-workflow.html b/docs/articles/bioc-workflow.html index 0afc600..10aa249 100644 --- a/docs/articles/bioc-workflow.html +++ b/docs/articles/bioc-workflow.html @@ -44,7 +44,7 @@ sevenbridges-r - 1.19.1 + 1.19.2

    @@ -107,12 +107,12 @@ -
    +

    @@ -214,7 +216,8 @@

    Now let’s do some simple steps, first thing to do is to create an Auth object, almost everything started from this object. Our API client follow a style like this Auth$properties$action. On the platform, Auth is your account, and it contains projects, billing groups, users, project contains tasks, apps, files etc, so it’s easy to imagine your API call.

    To create an Auth object, simply pass the token and platform name (or alternatively, API base URL) to the Auth function. The default platform is set to CGC. Good news you can use the sevenbridges package to access any Seven Bridges platform with API (v2).

    This is the main way to create an Auth object, just replace your_token with your own authentication token from the CGC:

    -
    a <- Auth(token = "your_token", platform = "cgc")
    +
    +a <- Auth(token = "your_token", platform = "cgc")

    Alternatively, you can save your authentication cross different platforms in a user configuration file named credentials under the directory $HOME/.sevenbridges/. This allows you to manage multiple user profiles registered on multiple Seven Bridges environments. An example user configuration file looks like this:

    [aws-us-tengfei]
     api_endpoint = https://api.sbgenomics.com/v2
    @@ -234,25 +237,31 @@ 

    api_endpoint = https://gcp-api.sbgenomics.com/v2 auth_token = token_for_this_user

    When you have this user configuration file ready at this default location, all you need to do is setting from = "file" and choose the profile_name to use. For example:

    -
    a <- Auth(from = "file", profile_name = "cgc")
    +
    +a <- Auth(from = "file", profile_name = "cgc")
     # # remove old project
    -# a$project(id = "tengfei/hackathon")$delete()
    +# a$project(id = "tengfei/hackathon")$delete()

    The third way to save authentication information is by setting system environment variables. To set the two environment variables (SB_API_ENDPOINT and SB_AUTH_TOKEN) in your system, you could use the function sbg_set_env(). For example:

    -
    sbg_set_env("https://cgc-api.sbgenomics.com/v2", "your_token")
    +
    +sbg_set_env("https://cgc-api.sbgenomics.com/v2", "your_token")

    To create an Auth object using credentials in the environment variables:

    -
    a <- Auth(from = "env")
    +
    +a <- Auth(from = "env")

    To create a new project, you need to know your billing group id, cost related to this project will be charged from this billing group, now play with your free credit.

    -
    (b <- a$billing())
    -# a single billing group is showing
    +
    +(b <- a$billing())
    +# a single billing group is showing

    Now let’s create a new project called “hackathon”, save it to an object named p for convenient usage for any call related to this project.

    -
    (p <- a$project_new("hackathon",
    -  billing_group_id = b$id,
    -  description = "This project is for CGC hackathon"
    -))
    +
    +(p <- a$project_new("hackathon",
    +  billing_group_id = b$id,
    +  description = "This project is for CGC hackathon"
    +))

    Now check it on CGC, you will see a fresh new project is created.

    cgc-projects

    To delete it, just call, but I will suggest you keep it for following tutorial : )

    -
    # p$delete()
    +
    +# p$delete()

    @@ -363,15 +372,16 @@

    For example, you know there is an runif function in the rocker/r-base container, you can just do something like this. Please read another tutorial called “Describe and Execute CWL Tools/Workflows in R”, it introduced a simpler example with random number generator.

    -
    rbx <- Tool(
    -  id = "runif",
    -  label = "runif",
    -  hints = requirements(docker(pull = "rocker/r-base"), cpu(1), mem(2000)),
    -  baseCommand = "Rscript -e 'runif(100)'",
    -  stdout = "output.txt",
    -  outputs = output(id = "random", glob = "*.txt")
    -)
    -rbx$toJSON(pretty = TRUE)
    +
    +rbx <- Tool(
    +  id = "runif",
    +  label = "runif",
    +  hints = requirements(docker(pull = "rocker/r-base"), cpu(1), mem(2000)),
    +  baseCommand = "Rscript -e 'runif(100)'",
    +  stdout = "output.txt",
    +  outputs = output(id = "random", glob = "*.txt")
    +)
    +rbx$toJSON(pretty = TRUE)
    {
       "sbg:id": "runif",
       "id": "#runif",
    @@ -416,35 +426,38 @@ 

    1. If you don’t want to make a new container with command line interface and you can simply insert script temporarily for existing container. You can do things as quick as this, by provide a script in the ‘content’ of ‘fileDef’.
    -
    # provide scripts
    +
    +# provide scripts
     # make a new script file
    -fd <- fileDef(
    -  name = "runif.R",
    -  content = "set.seed(1); runif(100)"
    -)
    -rbx <- Tool(
    -  id = "runif",
    -  label = "runif",
    -  hints = requirements(docker(pull = "rocker/r-base"), cpu(1), mem(2000)),
    -  requirements = requirements(fd),
    -  baseCommand = "Rscript runif.R", # run script you created.
    -  stdout = "output.txt",
    -  outputs = output(id = "random", glob = "*.txt")
    -)
    +fd <- fileDef( + name = "runif.R", + content = "set.seed(1); runif(100)" +) +rbx <- Tool( + id = "runif", + label = "runif", + hints = requirements(docker(pull = "rocker/r-base"), cpu(1), mem(2000)), + requirements = requirements(fd), + baseCommand = "Rscript runif.R", # run script you created. + stdout = "output.txt", + outputs = output(id = "random", glob = "*.txt") +)

    Note: in the above example, I made a mistake on purpose, so try to debug on the platform if the task fails : )

    I will introduce “Tool” function, in the later section, don’t worry.

    1. For advanced developer/users: if you think a cool command line interface is worth doing, and convenient in any case, then go ahead and make one and create our own container will always be a better idea. this allow you to provide much formal interface at both command line level or container level.

    Here is Dockerfile I used to generate the workflow I need

    -
    fl <- system.file("docker/rnaseqGene", "Dockerfile",
    -  package = "sevenbridges"
    -)
    +
    +fl <- system.file("docker/rnaseqGene", "Dockerfile",
    +  package = "sevenbridges"
    +)

    Here is the current content of the Dockerfile:

    -
    cat(readLines(fl), sep = "\n")
    +
    +cat(readLines(fl), sep = "\n")
    FROM rocker/tidyverse
     
    -LABEL maintainer="nan.xiao@sevenbridges.com"
    +LABEL maintainer="soner.koc@sevenbridges.com"
     
     RUN Rscript -e 'source("http://bioconductor.org/workflows.R"); workflowInstall("rnaseqGene")'
     
    @@ -473,11 +486,13 @@ 

  45. Test function inside container

Here is the command line I am using it’s called “performDE.R”

-
fl <- system.file("docker/rnaseqGene/src", "performDE.R",
-  package = "sevenbridges"
-)
+
+fl <- system.file("docker/rnaseqGene/src", "performDE.R",
+  package = "sevenbridges"
+)

Here is the current content of the Dockerfile:

-
cat(readLines(fl), sep = "\n")
+
+cat(readLines(fl), sep = "\n")
#!/usr/bin/Rscript
 "usage: performDE.R [options]
 
@@ -551,11 +566,13 @@ 

Step 4: Add default report template to your app

As a developer, if you always have a fixed report template provided for you tool, you can hard-code your template into your Docker container, like you noticed in the Dockerfile I created, I insert a report R Markdown template. And in the command line interface, in the end, I pass it to rmarkdown::render function as parameters ‘param’. In this way, you define your input in the header of R Markdown. Examples like this, this template I used here, is exactly the same report on Bioconductor’s RNA-Seq workflow website.

-
fl <- system.file("docker/rnaseqGene/report", "rnaseqGene.Rmd",
-  package = "sevenbridges"
-)
+
+fl <- system.file("docker/rnaseqGene/report", "rnaseqGene.Rmd",
+  package = "sevenbridges"
+)

Here is the current content (first 50 lines of the whole report) of the template:

-
cat(readLines(fl, n = 50), sep = "\n")
+
+cat(readLines(fl, n = 50), sep = "\n")
---
 title: "Uniform random number generator example"
 date: "`r Sys.Date()`"
@@ -631,64 +648,66 @@ 

  • Expression to specify the javascript expression (note:it’s convenient to do it with graphic user interface, because you can directly see the result of the expression)
  • Enum: call ‘enum’.
  • -
    rbx <- Tool(
    -  id = "rnaseqGene",
    -  label = "rnaseqgene",
    -  description = "A RNA-seq Differiencial Expression Flow and Report",
    -  hints = requirements(docker(pull = "tengfei/rnaseqgene"), cpu(1), mem(2000)),
    -  baseCommand = "performDE.R",
    -  inputs = list(
    -    input(
    -      id = "bamfiles", label = "bam files",
    -      description = "a list of bam files",
    -      type = "File...", ## or type = ItemArray("File")
    -      prefix = "--bamfiles",
    -      itemSeparator = ","
    -    ),
    -    input(
    -      id = "design", label = "design matrix",
    -      type = "File",
    -      prefix = "--design"
    -    ),
    -    input(
    -      id = "gtffile", label = "gene feature files",
    -      type = "File",
    -      prefix = "--gtffile"
    -    ),
    -    input(
    -      id = "format", label = "report foramt html or pdf",
    -      type = enum("format", c("pdf", "html")),
    -      prefix = "--format"
    -    )
    -  ),
    -  outputs = list(
    -    output(
    -      id = "report", label = "report",
    -      description = "A reproducible report created by Rmarkdown",
    -      glob = Expression(
    -        engine = "#cwl-js-engine",
    -        script = "x = $job[['inputs']][['format']]; if(x == 'undefined' || x == null){x = 'html';};'rnaseqGene.' +  x"
    -      )
    -    ),
    -    output(
    -      id = "heatmap", label = "heatmap",
    -      description = "A heatmap plot to show the Euclidean distance between samples",
    -      glob = "heatmap.pdf"
    -    ),
    -    output(
    -      id = "count", label = "count",
    -      description = "Reads counts matrix",
    -      glob = "count.csv"
    -    ),
    -    output(
    -      id = "de", label = "Differential expression table",
    -      description = "Differential expression table",
    -      glob = "de.csv"
    -    )
    -  )
    -)
    +
    +rbx <- Tool(
    +  id = "rnaseqGene",
    +  label = "rnaseqgene",
    +  description = "A RNA-seq Differiencial Expression Flow and Report",
    +  hints = requirements(docker(pull = "tengfei/rnaseqgene"), cpu(1), mem(2000)),
    +  baseCommand = "performDE.R",
    +  inputs = list(
    +    input(
    +      id = "bamfiles", label = "bam files",
    +      description = "a list of bam files",
    +      type = "File...", ## or type = ItemArray("File")
    +      prefix = "--bamfiles",
    +      itemSeparator = ","
    +    ),
    +    input(
    +      id = "design", label = "design matrix",
    +      type = "File",
    +      prefix = "--design"
    +    ),
    +    input(
    +      id = "gtffile", label = "gene feature files",
    +      type = "File",
    +      prefix = "--gtffile"
    +    ),
    +    input(
    +      id = "format", label = "report foramt html or pdf",
    +      type = enum("format", c("pdf", "html")),
    +      prefix = "--format"
    +    )
    +  ),
    +  outputs = list(
    +    output(
    +      id = "report", label = "report",
    +      description = "A reproducible report created by Rmarkdown",
    +      glob = Expression(
    +        engine = "#cwl-js-engine",
    +        script = "x = $job[['inputs']][['format']]; if(x == 'undefined' || x == null){x = 'html';};'rnaseqGene.' +  x"
    +      )
    +    ),
    +    output(
    +      id = "heatmap", label = "heatmap",
    +      description = "A heatmap plot to show the Euclidean distance between samples",
    +      glob = "heatmap.pdf"
    +    ),
    +    output(
    +      id = "count", label = "count",
    +      description = "Reads counts matrix",
    +      glob = "count.csv"
    +    ),
    +    output(
    +      id = "de", label = "Differential expression table",
    +      description = "Differential expression table",
    +      glob = "de.csv"
    +    )
    +  )
    +)

    By default it output YAML, but you can print it into JSON as well.

    -
    rbx
    +
    +rbx
    sbg:id: rnaseqGene
     id: '#rnaseqGene'
     inputs:
    @@ -825,7 +844,8 @@ 

    baseCommand: - performDE.R arguments: []

    -
    rbx$toJSON(pretty = TRUE)
    +
    +rbx$toJSON(pretty = TRUE)
    {
       "sbg:id": "rnaseqGene",
       "id": "#rnaseqGene",
    @@ -990,14 +1010,17 @@ 

    ], "arguments": [] }

    -
    rbx$toJSON()
    +
    +rbx$toJSON()
    {"sbg:id":"rnaseqGene","id":"#rnaseqGene","inputs":[{"type":["null",{"items":"File","type":"array"}],"label":"bam files","description":"a list of bam files","streamable":false,"default":"","id":"#bamfiles","inputBinding":{"position":0,"prefix":"--bamfiles","separate":true,"itemSeparator":",","shellQuote":false,"sbg:cmdInclude":true,"streamable":false,"separator":" "},"required":false},{"type":["null","File"],"label":"design matrix","description":"","streamable":false,"default":"","id":"#design","inputBinding":{"position":0,"prefix":"--design","separate":true,"shellQuote":false,"sbg:cmdInclude":true,"streamable":false,"separator":" "},"required":false},{"type":["null","File"],"label":"gene feature files","description":"","streamable":false,"default":"","id":"#gtffile","inputBinding":{"position":0,"prefix":"--gtffile","separate":true,"shellQuote":false,"sbg:cmdInclude":true,"streamable":false,"separator":" "},"required":false},{"type":["null",{"name":"format","symbols":["pdf","html"],"type":"enum"}],"label":"report foramt html or pdf","description":"","streamable":false,"default":"","id":"#format","inputBinding":{"position":0,"prefix":"--format","separate":true,"shellQuote":false,"sbg:cmdInclude":true,"streamable":false,"separator":" "},"required":false}],"outputs":[{"type":["null","File"],"label":"report","description":"A reproducible report created by Rmarkdown","streamable":false,"default":"","id":"#report","outputBinding":{"glob":{"engine":"#cwl-js-engine","script":"x = $job[['inputs']][['format']]; if(x == 'undefined' || x == null){x = 'html';};'rnaseqGene.' +  x","class":"Expression"}}},{"type":["null","File"],"label":"heatmap","description":"A heatmap plot to show the Euclidean distance between samples","streamable":false,"default":"","id":"#heatmap","outputBinding":{"glob":"heatmap.pdf"}},{"type":["null","File"],"label":"count","description":"Reads counts matrix","streamable":false,"default":"","id":"#count","outputBinding":{"glob":"count.csv"}},{"type":["null","File"],"label":"Differential expression table","description":"Differential expression table","streamable":false,"default":"","id":"#de","outputBinding":{"glob":"de.csv"}}],"requirements":[],"hints":[{"class":"DockerRequirement","dockerPull":"tengfei/rnaseqgene"},{"class":"sbg:CPURequirement","value":1},{"class":"sbg:MemRequirement","value":2000}],"label":"rnaseqgene","description":"A RNA-seq Differiencial Expression Flow and Report","class":"CommandLineTool","baseCommand":["performDE.R"],"arguments":[]} 
    -
    # # or write to an external file
    -# fl <- "~/Downloads/rnaseqGene.json"
    -# write(rbx$toJSON(pretty = TRUE), fl)
    +
    +# # or write to an external file
    +# fl <- "~/Downloads/rnaseqGene.json"
    +# write(rbx$toJSON(pretty = TRUE), fl)

    Now you want to add app to your project p, by calling app_add method, the first argument is name, the second is either a CWL JSON file, Tool object, or Workflow object.

    -
    # add App you just created
    -(rna.app <- p$app_add("rnaseqgene", rbx))
    +
    +# add App you just created
    +(rna.app <- p$app_add("rnaseqgene", rbx))

    Please go check your app in your project, check input output and how it maps to the UI.

    @@ -1015,30 +1038,32 @@

    metadata: a list of meta otherwise search for the same file name ended with “.meta”

    For example:

    -
    fl <- system.file("extdata", "sample1.fastq", package = "sevenbridges")
    -(p <- a$project(id = "tengfei/quickstart"))
    +
    +fl <- system.file("extdata", "sample1.fastq", package = "sevenbridges")
    +(p <- a$project(id = "tengfei/quickstart"))
     # by default load .meta for the file
    -p$upload(fl, overwrite = TRUE)
    +p$upload(fl, overwrite = TRUE)
     # pass metadata
    -p$upload(fl, overwrite = TRUE, metadata = list(library_id = "testid2", platform = "Illumina x11"))
    +p$upload(fl, overwrite = TRUE, metadata = list(library_id = "testid2", platform = "Illumina x11"))
     # rename
    -p$upload(fl,
    -  overwrite = TRUE, name = "sample_new_name.fastq",
    -  metadata = list(library_id = "new_id")
    -)
    +p$upload(fl,
    +  overwrite = TRUE, name = "sample_new_name.fastq",
    +  metadata = list(library_id = "new_id")
    +)
     
     # upload folder
    -dir.ext <- system.file("extdata", package = "sevenbridges")
    -p$upload(dir.ext, overwrite = TRUE)
    +dir.ext <- system.file("extdata", package = "sevenbridges")
    +p$upload(dir.ext, overwrite = TRUE)
     
     # upload file list
    -fls <- list.files(dir.ext, recursive = TRUE, full.names = TRUE)
    -p$upload(fls, overwrite = TRUE)
    +fls <- list.files(dir.ext, recursive = TRUE, full.names = TRUE) +p$upload(fls, overwrite = TRUE)

    For now try using our graphic user interface to import all files listed here:

    -
    download.fl <- system.file("extdata/download.txt", package = "sevenbridges")
    -cat(readLines(download.fl), sep = "\n")
    -
    Warning in readLines(download.fl): incomplete final line found on '/Users/nanx/
    -rpkgs/sevenbridges/extdata/download.txt'
    +
    +download.fl <- system.file("extdata/download.txt", package = "sevenbridges")
    +cat(readLines(download.fl), sep = "\n")
    +
    Warning in readLines(download.fl): incomplete final line found on '/Users/
    +c02sn03cfvh6/rpkgs/sevenbridges/extdata/download.txt'
    https://raw.githubusercontent.com/tengfei/resource/master/2016/04-01-hackathon/data/example_report.Rmd
     https://raw.githubusercontent.com/tengfei/resource/master/2016/04-01-hackathon/data/hello-markdown.Rmd
     https://raw.githubusercontent.com/tengfei/resource/master/2016/04-01-hackathon/data/hello.tar
    @@ -1054,79 +1079,87 @@ 

    https://raw.githubusercontent.com/tengfei/resource/master/2016/04-01-hackathon/data/SRR1039520_subset.bam https://raw.githubusercontent.com/tengfei/resource/master/2016/04-01-hackathon/data/SRR1039521_subset.bam

    To use the API to uplaod, let’s download it to a folder and upload via API.

    -
    td <- tempfile()
    -dir.create(td)
    -for (f in readLines(download.fl)) {
    -  download.file(f, file.path(td, basename(f)))
    -}
    +
    +td <- tempfile()
    +dir.create(td)
    +for (f in readLines(download.fl)) {
    +  download.file(f, file.path(td, basename(f)))
    +}
     # double check
    -list.files(td)
    +list.files(td)
     # upload to the project you created
    -p$upload(td)
    +p$upload(td)

    Copy this list, and then in your project, click “add files”, and choose “import from ftp” (tutorial).

    When it’s finished, refresh your file page, you will be able to see all of them. The cool thing is that you can search file by ‘name’ not by id, it support fuzzy pattern match.

    -
    # get file id you need as inout
    -(bamfiles.in <- p$file(".bam"))
    -(design.in <- p$file("sample_table.csv"))
    -(gtf.in <- p$file("Homo_sapiens.GRCh37.75_subset.gtf"))
    +
    +# get file id you need as inout
    +(bamfiles.in <- p$file(".bam"))
    +(design.in <- p$file("sample_table.csv"))
    +(gtf.in <- p$file("Homo_sapiens.GRCh37.75_subset.gtf"))

    Note: you can also passed a list of files like this, to give exact file names

    -
    bam1 <- p$file("SRR1039516_subset.bam")
    -bam2 <- p$file("SRR1039512_subset.bam")
    -bamfiles.in2 <- list(bam1, bam2)
    +
    +bam1 <- p$file("SRR1039516_subset.bam")
    +bam2 <- p$file("SRR1039512_subset.bam")
    +bamfiles.in2 <- list(bam1, bam2)

    Now create a new draft task in your project, don’t forget to pass input.

    -
    # add a new Task
    -(tsk <- p$task_add(
    -  name = "RNA DE report new",
    -  description = "RNA DE analysis report",
    -  app = rna.app$id,
    -  inputs = list(
    -    bamfiles = bamfiles.in,
    -    design = design.in,
    -    gtffile = gtf.in
    -  )
    -))
    +
    +# add a new Task
    +(tsk <- p$task_add(
    +  name = "RNA DE report new",
    +  description = "RNA DE analysis report",
    +  app = rna.app$id,
    +  inputs = list(
    +    bamfiles = bamfiles.in,
    +    design = design.in,
    +    gtffile = gtf.in
    +  )
    +))
     
     # don't forget to run a draft task
    -tsk$run()
    +tsk$run()

    To monitor the task, run following command, it will tell you when it’s finished, but this is not running in the background now.

    -
    # # monitor the task
    -# tsk$monitor()
    +
    +# # monitor the task
    +# tsk$monitor()

    A better way is to use the Task hook function, it’s flexible, you can hook any function to a task status. For example, when it’s complete download the files. Now try to send your self a text message : )

    -
    setTaskHook("completed", function() {
    -  tsk$download("~/Downloads")
    -})
    -tsk$monitor()
    +
    +setTaskHook("completed", function() {
    +  tsk$download("~/Downloads")
    +})
    +tsk$monitor()

    To download all files from a completed tasks

    -
    tsk$download("~/Downloads")
    +
    +tsk$download("~/Downloads")

    To run task in batch mode, check ?batch for more details. Here is an mock running:

    -
    # batch by items
    -(tsk <- p$task_add(
    -  name = "RNA DE report new batch 2",
    -  description = "RNA DE analysis report",
    -  app = rna.app$id,
    -  batch = batch(input = "bamfiles"),
    -  inputs = list(
    -    bamfiles = bamfiles.in,
    -    design = design.in,
    -    gtffile = gtf.in
    -  )
    -))
    +
    +# batch by items
    +(tsk <- p$task_add(
    +  name = "RNA DE report new batch 2",
    +  description = "RNA DE analysis report",
    +  app = rna.app$id,
    +  batch = batch(input = "bamfiles"),
    +  inputs = list(
    +    bamfiles = bamfiles.in,
    +    design = design.in,
    +    gtffile = gtf.in
    +  )
    +))
     
     # batch by metadata, input files has to have metadata fields specified
    -(tsk <- p$task_add(
    -  name = "RNA DE report new batch 3",
    -  description = "RNA DE analysis report",
    -  app = rna.app$id,
    -  batch = batch(
    -    input = "fastq",
    -    c("metadata.sample_id", "metadata.library_id")
    -  ),
    -  inputs = list(
    -    bamfiles = bamfiles.in,
    -    design = design.in,
    -    gtffile = gtf.in
    -  )
    -))
    +(tsk <- p$task_add( + name = "RNA DE report new batch 3", + description = "RNA DE analysis report", + app = rna.app$id, + batch = batch( + input = "fastq", + c("metadata.sample_id", "metadata.library_id") + ), + inputs = list( + bamfiles = bamfiles.in, + design = design.in, + gtffile = gtf.in + ) +))

    For more details, check R API tutorial.

    @@ -1165,10 +1198,11 @@

    If you are interested, you can still read my Dockerfile, command line, tool generator and JSON.

    I will suggest you directly copy the json into your project. Just to try add an app in a different way.

    -
    fl <- system.file("docker/reporttool/rabix/reporttool.json",
    -  package = "sevenbridges"
    -)
    -cat(readLines(fl), sep = "\n")
    +
    +fl <- system.file("docker/reporttool/rabix/reporttool.json",
    +  package = "sevenbridges"
    +)
    +cat(readLines(fl), sep = "\n")
    {
       "sbg:id": "reporttool",
       "id": "#reporttool",
    @@ -1492,17 +1526,19 @@ 

    "context": "" }

    Or just use API to add the raw JSON file

    -
    # directly add json file
    -p <- a$project(id = "tengfei/hackathon")
    -(report.app <- p$app_add("report-tool", fl))
    +
    +# directly add json file
    +p <- a$project(id = "tengfei/hackathon")
    +(report.app <- p$app_add("report-tool", fl))

    Checkout the Dockerfile

    -
    fl <- system.file("docker/reporttool/Dockerfile",
    -  package = "sevenbridges"
    -)
    -cat(readLines(fl), sep = "\n")
    +
    +fl <- system.file("docker/reporttool/Dockerfile",
    +  package = "sevenbridges"
    +)
    +cat(readLines(fl), sep = "\n")
    FROM rocker/tidyverse
     
    -LABEL maintainer="nan.xiao@sevenbridges.com"
    +LABEL maintainer="soner.koc@sevenbridges.com"
     
     RUN rm -f /var/lib/dpkg/available \
         && rm -rf  /var/cache/apt/* \
    @@ -1515,21 +1551,23 @@ 

    RUN chmod a+x /usr/local/bin/report.R

    Checkout the command line

    -
    fl <- system.file("docker/reporttool/src/report.R",
    -  package = "sevenbriges"
    -)
    -cat(readLines(fl), sep = "\n")
    +
    +fl <- system.file("docker/reporttool/src/report.R",
    +  package = "sevenbriges"
    +)
    +cat(readLines(fl), sep = "\n")

    Checkout the tool generator

    -
    fl <- system.file("docker/reporttool/rabix/generator.R",
    -  package = "sevenbriges"
    -)
    -cat(readLines(fl), sep = "\n")
    +
    +fl <- system.file("docker/reporttool/rabix/generator.R",
    +  package = "sevenbriges"
    +)
    +cat(readLines(fl), sep = "\n")

    Compose a full workflow

    -

    Even though in R with sevenbridges package you can use %>>% to connect two Tool object, but this only works for linear simple flow. For a complicated flow, we recommend you to use graphic user interface, it’s a lot of fun.

    +

    Even though in R with sevenbridges package you can use %>>% to connect two Tool object, but this only works for linear simple flow. For a complicated flow, we recommend you to use graphic user interface, it’s a lot of fun.

    Now connect your RNA-seq tool with the report tool you just add it to your project, follow the tutorial here, then make a workflow like this:

    cgc-workflow

    And next run a task on the platform via UI like this:

    @@ -1545,7 +1583,8 @@

    More tutorials

    After you installed the package

    -
    browseVignettes("sevenbridges")
    +
    +browseVignettes("sevenbridges")

    or on the vignettes page.

    @@ -1561,11 +1600,11 @@

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/articles/bioc-workflow_files/header-attrs-2.4/header-attrs.js b/docs/articles/bioc-workflow_files/header-attrs-2.4/header-attrs.js new file mode 100644 index 0000000..dd57d92 --- /dev/null +++ b/docs/articles/bioc-workflow_files/header-attrs-2.4/header-attrs.js @@ -0,0 +1,12 @@ +// Pandoc 2.9 adds attributes on both header and div. We remove the former (to +// be compatible with the behavior of Pandoc < 2.8). +document.addEventListener('DOMContentLoaded', function(e) { + var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); + var i, h, a; + for (i = 0; i < hs.length; i++) { + h = hs[i]; + if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 + a = h.attributes; + while (a.length > 0) h.removeAttribute(a[0].name); + } +}); diff --git a/docs/articles/cgc-datasets.html b/docs/articles/cgc-datasets.html index 902c807..ba638ca 100644 --- a/docs/articles/cgc-datasets.html +++ b/docs/articles/cgc-datasets.html @@ -44,7 +44,7 @@ sevenbridges-r - 1.19.1 + 1.19.2 @@ -107,12 +107,12 @@ -
    +

    Return list of all TCGA entities

    You can issue another GET request to the href of the tcga object, if you want to access TCGA data.

    -
    a <- Auth(
    -  url = "https://cgc-datasets-api.sbgenomics.com/datasets/tcga/v0",
    -  token = "your_cgc_token"
    -)
    -(res <- a$api()) # default method is GET
    +
    +a <- Auth(
    +  url = "https://cgc-datasets-api.sbgenomics.com/datasets/tcga/v0",
    +  token = "your_cgc_token"
    +)
    +(res <- a$api()) # default method is GET
     # list all resources/entities
    -names(res$"_links")
    +names(res$"_links")

    Interpreting the list of all entities

    For example, to see a list of all TCGA files, send the request:

    -
    (res <- a$api(path = "files"))
    +
    +(res <- a$api(path = "files"))

    For example, to see the metadata schema for files send the request:

    -
    a$api(path = "files/schema")
    +
    +a$api(path = "files/schema")

    Copy files to you project

    Get file id from Datasets API, then use public API to copy files. Make sure your project is “TCGA” compatible, otherwise if you are trying to copy controlled access data to your non-TCGA project, you will get

    "HTTP Status 403: Insufficient privileges to access the requested file."
    -
    (res <- a$api(path = "files"))
    +
    +(res <- a$api(path = "files"))
     
    -get_id <- function(obj) sapply(obj$"_embedded"$files, function(x) x$id)
    -ids <- get_id(res)
    +get_id <- function(obj) sapply(obj$"_embedded"$files, function(x) x$id)
    +ids <- get_id(res)
     
     # create CGC auth
    -a_cgc <- Auth(platform = "cgc", token = a$token)
    -a_cgc$copyFile(id = ids, project = "RFranklin/tcga-demo")
    +a_cgc <- Auth(platform = "cgc", token = a$token) +a_cgc$copyFile(id = ids, project = "RFranklin/tcga-demo")
    @@ -202,106 +207,114 @@

    Find samples connected to a case

    -
    body <- list(
    -  entity = "samples",
    -  hasCase = "0004D251-3F70-4395-B175-C94C2F5B1B81"
    -)
    -a$api(path = "query", body = body, method = "POST")
    +
    +body <- list(
    +  entity = "samples",
    +  hasCase = "0004D251-3F70-4395-B175-C94C2F5B1B81"
    +)
    +a$api(path = "query", body = body, method = "POST")

    Count samples connected to a case

    -
    a$api(path = "query/total", body = body, method = "POST")
    +
    +a$api(path = "query/total", body = body, method = "POST")

    Issuing a GET request to the href path will return the following data:

    Note: api function is a light layer of httr package, it’s different from Auth$api call.

    -
    httr::content(
    -  api(
    -    token = a$token,
    -    base_url = "https://cgc-datasets-api.sbgenomics.com/datasets/tcga/v0/samples/9259E9EE-7279-4B62-8512-509CB705029C"
    -  )
    -)
    +
    +httr::content(
    +  api(
    +    token = a$token,
    +    base_url = "https://cgc-datasets-api.sbgenomics.com/datasets/tcga/v0/samples/9259E9EE-7279-4B62-8512-509CB705029C"
    +  )
    +)

    Find cases with given age at diagnosis

    Suppose you want to see all cases for which the age at diagnosis is between 10 and 50. Then, you use the following query.

    Note that the value of the metadata field hasAgeAtDiagnosis is a dictionary containing the keyfilter, whose value is a further dictionary with keysgt(greater than) and lt (less than) for the upper and lower bounds to filter by.

    -
    body <- list(
    -  "entity" = "cases",
    -  "hasAgeAtDiagnosis" = list(
    -    "filter" = list(
    -      "gt" = 10,
    -      "lt" = 50
    -    )
    -  )
    -)
    -a$api(path = "query", body = body, method = "POST")
    +
    +body <- list(
    +  "entity" = "cases",
    +  "hasAgeAtDiagnosis" = list(
    +    "filter" = list(
    +      "gt" = 10,
    +      "lt" = 50
    +    )
    +  )
    +)
    +a$api(path = "query", body = body, method = "POST")

    Find cases with a given age at diagnosis and disease

    Suppose you want to see all cases that, as in the example, (Find cases with given age at diagnosis)(doc:find-all-cases-with-a-given-age-at-diagnosis), have an age at diagnosis of between 10 and 50, but that also have the disease “Kidney Chromophobe”. Then, use the following query:

    -
    body <- list(
    -  "entity" = "cases",
    -  "hasAgeAtDiagnosis" = list(
    -    "filter" = list(
    -      "gt" = 10,
    -      "lt" = 50
    -    )
    -  ),
    -  "hasDiseaseType" = "Kidney Chromophobe"
    -)
    -a$api(path = "query", body = body, method = "POST")
    +
    +body <- list(
    +  "entity" = "cases",
    +  "hasAgeAtDiagnosis" = list(
    +    "filter" = list(
    +      "gt" = 10,
    +      "lt" = 50
    +    )
    +  ),
    +  "hasDiseaseType" = "Kidney Chromophobe"
    +)
    +a$api(path = "query", body = body, method = "POST")

    Complex example for filtering TCGA data

    -
    body <- list(
    -  "entity" = "cases",
    -  "hasSample" = list(
    -    "hasSampleType" = "Primary Tumor",
    -    "hasPortion" = list(
    -      "hasPortionNumber" = 11
    -    )
    -  ),
    -  "hasNewTumorEvent" = list(
    -    "hasNewTumorAnatomicSite" = c("Liver", "Pancreas"),
    -    "hasNewTumorEventType" = list(
    -      "filter" = list(
    -        "contains" = "Recurrence"
    -      )
    -    )
    -  )
    -)
    -a$api(path = "query", body = body, method = "POST")
    +
    +body <- list(
    +  "entity" = "cases",
    +  "hasSample" = list(
    +    "hasSampleType" = "Primary Tumor",
    +    "hasPortion" = list(
    +      "hasPortionNumber" = 11
    +    )
    +  ),
    +  "hasNewTumorEvent" = list(
    +    "hasNewTumorAnatomicSite" = c("Liver", "Pancreas"),
    +    "hasNewTumorEventType" = list(
    +      "filter" = list(
    +        "contains" = "Recurrence"
    +      )
    +    )
    +  )
    +)
    +a$api(path = "query", body = body, method = "POST")

    Issuing a GET request to the href path

    -
    httr::content(
    -  api(
    -    token = a$token,
    -    base_url = "https://cgc-datasets-api.sbgenomics.com/datasets/tcga/v0/cases/0004D251-3F70-4395-B175-C94C2F5B1B81"
    -  )
    -)
    +
    +httr::content(
    +  api(
    +    token = a$token,
    +    base_url = "https://cgc-datasets-api.sbgenomics.com/datasets/tcga/v0/cases/0004D251-3F70-4395-B175-C94C2F5B1B81"
    +  )
    +)

    Query with multiple filters on a case

    -
    get_id <- function(obj) sapply(obj$"_embedded"$files, function(x) x$id)
    -names(res)
    +
    +get_id <- function(obj) sapply(obj$"_embedded"$files, function(x) x$id)
    +names(res)
     
    -body <- list(
    -  "entity" = "cases",
    -  "hasSample" = list(
    -    "hasSampleType" = "Primary Tumor",
    -    "hasPortion" = list(
    -      "hasPortionNumber" = 11,
    -      "hasID" = "TCGA-DD-AAVP-01A-11"
    -    )
    -  ),
    -  "hasNewTumorEvent" = list(
    -    "hasNewTumorAnatomicSite" = "Liver",
    -    "hasNewTumorEventType" = "Intrahepatic Recurrence"
    -  )
    -)
    +body <- list(
    +  "entity" = "cases",
    +  "hasSample" = list(
    +    "hasSampleType" = "Primary Tumor",
    +    "hasPortion" = list(
    +      "hasPortionNumber" = 11,
    +      "hasID" = "TCGA-DD-AAVP-01A-11"
    +    )
    +  ),
    +  "hasNewTumorEvent" = list(
    +    "hasNewTumorAnatomicSite" = "Liver",
    +    "hasNewTumorEventType" = "Intrahepatic Recurrence"
    +  )
    +)
     
    -(res <- a$api(path = "files", body = body))
    -get_id(res)
    +(res <- a$api(path = "files", body = body)) +get_id(res)

    @@ -318,11 +331,11 @@

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/articles/cgc-datasets_files/header-attrs-2.4/header-attrs.js b/docs/articles/cgc-datasets_files/header-attrs-2.4/header-attrs.js new file mode 100644 index 0000000..dd57d92 --- /dev/null +++ b/docs/articles/cgc-datasets_files/header-attrs-2.4/header-attrs.js @@ -0,0 +1,12 @@ +// Pandoc 2.9 adds attributes on both header and div. We remove the former (to +// be compatible with the behavior of Pandoc < 2.8). +document.addEventListener('DOMContentLoaded', function(e) { + var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); + var i, h, a; + for (i = 0; i < hs.length; i++) { + h = hs[i]; + if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 + a = h.attributes; + while (a.length > 0) h.removeAttribute(a[0].name); + } +}); diff --git a/docs/articles/docker.html b/docs/articles/docker.html index 9080a0f..76e0b9b 100644 --- a/docs/articles/docker.html +++ b/docs/articles/docker.html @@ -44,7 +44,7 @@ sevenbridges-r - 1.19.1 + 1.19.2

    @@ -107,12 +107,12 @@ -
    +
    @@ -107,12 +107,12 @@ -
    +
    @@ -321,11 +323,11 @@

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/articles/rstudio_files/header-attrs-2.4/header-attrs.js b/docs/articles/rstudio_files/header-attrs-2.4/header-attrs.js new file mode 100644 index 0000000..dd57d92 --- /dev/null +++ b/docs/articles/rstudio_files/header-attrs-2.4/header-attrs.js @@ -0,0 +1,12 @@ +// Pandoc 2.9 adds attributes on both header and div. We remove the former (to +// be compatible with the behavior of Pandoc < 2.8). +document.addEventListener('DOMContentLoaded', function(e) { + var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); + var i, h, a; + for (i = 0; i < hs.length; i++) { + h = hs[i]; + if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 + a = h.attributes; + while (a.length > 0) h.removeAttribute(a[0].name); + } +}); diff --git a/docs/authors.html b/docs/authors.html index 8d983ac..9d7d856 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -90,7 +90,7 @@ sevenbridges-r - 1.19.1 + 1.19.2

    @@ -161,21 +161,25 @@

    Authors

    • -

      Nan Xiao. Author, maintainer. +

      Soner Koc. Author, maintainer.

    • -

      Tengfei Yin. Author. +

      Nan Xiao. Author.

    • -

      Emile Young. Contributor. +

      Tengfei Yin. Author.

    • Dusan Randjelovic. Contributor.

    • +
    • +

      Emile Young. Contributor. +

      +
    • Seven Bridges Genomics. Copyright holder, funder.

      @@ -190,11 +194,11 @@

      Authors

      -

      Site built with pkgdown 1.5.1.

      +

      Site built with pkgdown 1.6.1.

      diff --git a/docs/index.html b/docs/index.html index 5d1a085..75990a5 100644 --- a/docs/index.html +++ b/docs/index.html @@ -47,7 +47,7 @@ sevenbridges-r - 1.19.1 + 1.19.2
    @@ -168,7 +168,8 @@

    Check R version

    First, check the version of R you are using with the following command (in R):

    -
    R.version.string
    +
    +R.version.string

    If you are not running the latest release version of R, install or upgrade with these instructions. If you are using RStudio, restart RStudio after installing R. RStudio will detect the new installation.

    @@ -176,34 +177,38 @@

    Bioconductor - Release Branch

    This is recommended for most users as it is the most stable version.

    You can install the package from the release branch on Bioconductor using BiocManager:

    -
    install.packages("BiocManager")
    -BiocManager::install("sevenbridges")
    +
    +install.packages("BiocManager")
    +BiocManager::install("sevenbridges")

    Bioconductor - Development Branch

    If you are developing tools under the devel branch or use the development version of R and Bioconductor, install the package from the Bioconductor devel branch. You probably also want to install R-devel first by following the directions in “Using the ‘Devel’ Version of Bioconductor”.

    To install the sevenbridges package from the devel branch, use

    -
    install.packages("BiocManager")
    -BiocManager::install("sevenbridges", version = "devel")
    +
    +install.packages("BiocManager")
    +BiocManager::install("sevenbridges", version = "devel")

    Latest Development Version

    To try the latest features, please install the package directly from GitHub. We push to the Bioconductor branch (release and devel) regularly.

    Installing the sevenbridges package from GitHub requires you have the devtools package. If you do not have devtools, install it from CRAN first.

    -
    install.packages("devtools")
    +
    +install.packages("devtools")

    You may get an error for missing system dependecies such as curl and ssl. You probably need to do the following first in order to install devtools and to build vignettes since you need pandoc under Ubuntu.

    apt-get update
     apt-get install libcurl4-gnutls-dev libssl-dev pandoc pandoc-citeproc

    After devtools is installed, install the latest version of sevenbridges from GitHub:

    -
    install.packages("BiocManager")
    +
    +install.packages("BiocManager")
     
    -devtools::install_github(
    +devtools::install_github(
       "sbg/sevenbridges-r",
    -  repos = BiocManager::repositories(),
    -  build_vignettes = TRUE, dependencies = TRUE
    -)
    + repos = BiocManager::repositories(), + build_vignettes = TRUE, dependencies = TRUE +)

    If you have trouble with pandoc and do not want to install it, set build_vignettes = FALSE to avoid building the vignettes.

    @@ -218,80 +223,86 @@

    • Direct authentication:
    -
    # Direct authentication
    -a <- Auth(token = "your_token", platform = "cgc")
    +
    +# Direct authentication
    +a <- Auth(token = "your_token", platform = "cgc")
     
     # or use base url
    -a <- Auth(token = "your_token", url = "https://cgc-api.sbgenomics.com/v2")
    +a <- Auth(token = "your_token", url = "https://cgc-api.sbgenomics.com/v2")
    • Authentication via system environment variables:
    -
    sbg_set_env(token = "your_token", url = "https://cgc-api.sbgenomics.com/v2")
    -a <- Auth(from = "env")
    +
    +sbg_set_env(token = "your_token", url = "https://cgc-api.sbgenomics.com/v2")
    +a <- Auth(from = "env")
    • Authentication via a user configuration file, collect and manage your credentials for multiple accounts across various Seven Bridges environments:
    -
    a <- Auth(from = "file", profile_name = "aws-us-username")
    +
    +a <- Auth(from = "file", profile_name = "aws-us-username")

    Please check vignette("api", package = "sevenbridges") for technical details about all available authentication methods.

    Complete API R Client

    A complete API R client with a user-friendly, object-oriented API with printing and support operations for API requests relating to users, billing, projects, files, apps, and tasks. Short examples are also included, as shown below:

    -
    # Get a project by pattern-matching its name
    -p <- a$project("demo")
    +
    +# Get a project by pattern-matching its name
    +p <- a$project("demo")
     
     # Get a project by its id
    -p <- a$project(id = "username/demo")
    +p <- a$project(id = "username/demo")
     
     # Delete files from a project
    -p$file("sample.tz")$delete()
    +p$file("sample.tz")$delete()
     
     # Upload fies from a folder to a project and include file metadata
    -p$upload("folder_path", metadata = list(platform = "Illumina"))
    +p$upload("folder_path", metadata = list(platform = "Illumina"))

    Task Monitoring

    A task monitoring hook which allows you to add a hook function to specific task statuses as you monitor a task. For example, you can opt to receive an email when the task is completed or specify to download all files produced by the task, as shown below:

    -
    setTaskHook("completed", function() {
    -  tsk$download("~/Downloads")
    -})
    -tsk$monitor()
    +
    +setTaskHook("completed", function() {
    +  tsk$download("~/Downloads")
    +})
    +tsk$monitor()

    Batch Tasks Support

    Batch tasks by metadata and by item.

    -
    # Batch by item
    -(tsk <- p$task_add(
    -  name = "RNA DE report new batch 2",
    -  description = "RNA DE analysis report",
    -  app = rna.app$id,
    -  batch = batch(input = "bamfiles"),
    -  inputs = list(
    -    bamfiles = bamfiles.in,
    -    design = design.in,
    -    gtffile = gtf.in
    -  )
    -))
    +
    +# Batch by item
    +(tsk <- p$task_add(
    +  name = "RNA DE report new batch 2",
    +  description = "RNA DE analysis report",
    +  app = rna.app$id,
    +  batch = batch(input = "bamfiles"),
    +  inputs = list(
    +    bamfiles = bamfiles.in,
    +    design = design.in,
    +    gtffile = gtf.in
    +  )
    +))
     
     # Batch by metadata. Note that input files must
     # have relevant metadata fields specified.
    -(tsk <- p$task_add(
    -  name = "RNA DE report new batch 3",
    -  description = "RNA DE analysis report",
    -  app = rna.app$id,
    -  batch = batch(
    -    input = "fastq",
    -    c("metadata.sample_id", "metadata.library_id")
    -  ),
    -  inputs = list(
    -    bamfiles = bamfiles.in,
    -    design = design.in,
    -    gtffile = gtf.in
    -  )
    -))
    +(tsk <- p$task_add( + name = "RNA DE report new batch 3", + description = "RNA DE analysis report", + app = rna.app$id, + batch = batch( + input = "fastq", + c("metadata.sample_id", "metadata.library_id") + ), + inputs = list( + bamfiles = bamfiles.in, + design = design.in, + gtffile = gtf.in + ) +))

    @@ -302,46 +313,48 @@

    Common Workflow Language Tool Interface

    A Common Workflow Language (CWL) Tool interface to directly describe your tool in R, export it to JSON or YAML, or add it to your online project. This package defines a complete set of CWL object, so you can describe tools as follows:

    -
    fd <- fileDef(name = "runif.R", content = readr::read_file(fl))
    +
    +fd <- fileDef(name = "runif.R", content = readr::read_file(fl))
     
    -rbx <- Tool(
    -  id = "runif",
    -  label = "runif",
    -  hints = requirements(
    -    docker(pull = "rocker/r-base"),
    -    cpu(1), mem(2000)
    -  ),
    -  requirements = requirements(fd),
    -  baseCommand = "Rscript runif.R",
    -  stdout = "output.txt",
    -  inputs = list(
    -    input(id = "number", type = "integer", position = 1),
    -    input(id = "min", type = "float", position = 2),
    -    input(id = "max", type = "float", position = 3)
    -  ),
    -  outputs = output(id = "random", glob = "output.txt")
    -)
    +rbx <- Tool(
    +  id = "runif",
    +  label = "runif",
    +  hints = requirements(
    +    docker(pull = "rocker/r-base"),
    +    cpu(1), mem(2000)
    +  ),
    +  requirements = requirements(fd),
    +  baseCommand = "Rscript runif.R",
    +  stdout = "output.txt",
    +  inputs = list(
    +    input(id = "number", type = "integer", position = 1),
    +    input(id = "min", type = "float", position = 2),
    +    input(id = "max", type = "float", position = 3)
    +  ),
    +  outputs = output(id = "random", glob = "output.txt")
    +)
     
     # Print CWL JSON
    -rbx$toJSON(pretty = TRUE)
    +rbx$toJSON(pretty = TRUE)
     
     # Print CWL YAML
    -rbx$toYAML()
    +rbx$toYAML()

    Utilities for Tool and Flow

    Utilities for Tool and Flow, for example

    -
    library("sevenbridges")
    +
    +library("sevenbridges")
     
     # convert a SBG CWL JSON file
    -t1 <- system.file("extdata/app", "tool_star.json", package = "sevenbridges")
    +t1 <- system.file("extdata/app", "tool_star.json", package = "sevenbridges")
     
     # convert json file into a Tool object
    -t1 <- convert_app(t1)
    +t1 <- convert_app(t1)
     
     # shows all input matrix
    -t1$input_matrix()
    +t1$input_matrix()
    @@ -406,12 +419,13 @@

    In your browser, you can see where the RStudio server is located from the path http://<url>:8787/. For example, if 192.168.99.100 is returned, visit http://192.168.99.100:8787/ for Rstudio.

    For the Shiny server, each app__ is hosted at http://<url>:3838/users/<username of rstudio>/<app_dir> for the Shiny server. For example, an app called 01_hello owned by user rstudio (a default user) has the path http://<url>:3838/users/rstudio/01_hello/. To develop your Shiny apps as an Rstudio user, you can login your RStudio server and create a folder in your home folder called ~/ShinyApps. There, you can develop shiny apps in that folder. For example, you can create an app called 02_text at ~/ShinyApps/02_text/.

    Log into your RStudio at http://<url>:8787. Then, try to copy an app to your home folder, as follows:

    -
    dir.create("~/ShinyApps")
    -file.copy(
    +
    +dir.create("~/ShinyApps")
    +file.copy(
       "/usr/local/lib/R/site-library/shiny/examples/01_hello/",
       "~/ShinyApps/",
    -  recursive = TRUE
    -)
    + recursive = TRUE +)

    If you are logged in as user rstudio, visit http://192.168.99.100:3838/rstudio/01_hello. You should be able to see the “hello” example.

    Note: Generic Shiny apps can also be hosted at http://<url>:3838/ or, for a particular app, at http://<url>:3838/<app_dir>. Inside the Docker container, it’s hosted under /srv/shiny-server/.

    @@ -420,7 +434,6 @@

    FAQ

    The best place to ask questions about the sevenbridges package is the mailing list.

      -
    • Q: Does this package support Seven Bridges’ API v1 which was not CWL compatible?
      A: No. This package only supports API v2 +. For API v1, please check out the sbgr package. Note that API v1 and associated legacy project types will be deprecated eventually.

    • Q: Which version of the Common Workflow Language (CWL) is supported?
      A: We support draft 2 and are making progress on supporting draft 3.

    • Q: Is there a Python binding for the API?
      A: Yes, the official Python client is here. Recipes and tutorials using the Python bindings are here.

    • Q: Why do I get warning messages when I use the API R client?
      A: The warning only exists in Rstudio and is potentially a bug in Rstudio. To ignore, it use options(warn = -1)

    • @@ -518,7 +531,8 @@

      License

      Developers

        -
      • Nan Xiao
        Author, maintainer
      • +
      • Soner Koc
        Author, maintainer
      • +
      • Nan Xiao
        Author
      • Tengfei Yin
        Author
      • Seven Bridges Genomics
        Copyright holder, funder
      • All authors...
      • @@ -529,7 +543,6 @@

        Developers

        Dev status

        • Build Status
        • -
        • AppVeyor Build Status
        • BioC
        • Downloads
        • Docker Pulls
        • @@ -540,11 +553,11 @@

          Dev status

          -

          Site built with pkgdown 1.5.1.

          +

          Site built with pkgdown 1.6.1.

          diff --git a/docs/news/index.html b/docs/news/index.html index b8de384..ba9fbda 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -90,7 +90,7 @@ sevenbridges-r - 1.19.1 + 1.19.2
      @@ -160,6 +160,17 @@

      Changelog

      Source: NEWS.md +
      +

      +sevenbridges 1.19.2

      +
      +

      +Improvements

      +
        +
      • Transfer package maintainership.
      • +
      +
      +

      sevenbridges 1.19.1

      @@ -171,9 +182,9 @@

    • Fixed a subtle column class mismatch issue when binding data frames since R 4.0.0.
    -
    +

    -Improvements

    +Improvements

    @@ -193,9 +204,9 @@

    sevenbridges 1.15.2

    -
    +

    -Improvements

    +Improvements

    • Added a new argument authorization in Auth and api() to allow specifying the token as the access token from Seven Bridges single sign-on (SSO).
    @@ -204,9 +215,9 @@

    sevenbridges 1.15.1

    -
    +

    -Improvements

    +Improvements

    • Added new fields created_by, created_on, and modified_on to the Project class following the recent API improvements. This enables better project filtering when querying projects. See the vignette for details.
    @@ -215,9 +226,9 @@

    sevenbridges 1.13.5

    -
    +

    -Improvements

    +Improvements

    • Added new platform options for the recently introduced environments. Now we can choose from "aws-us", "aws-eu", "ali-cn", "cgc", "cavatica", and "f4c" in Auth() calls.
    @@ -234,9 +245,9 @@

  • Added support for Actions API. See the Actions API section in the vignette for details.
  • -
    +

    -Improvements

    +Improvements

    • Added a new field description to the Files class following the recent API improvements.
    • Updated the API vignette to reflect the platform default setting update for spot instances (spot is now enabled by default).
    • @@ -253,9 +264,9 @@

    • Added support for Enterprise API. See the Enterprise API section in the vignette for details.
    -
    +

    -Improvements

    +Improvements
    • Removed unnecessary package dependencies to optimize the time needed for package installation and loading.
    • New look for the documentation website with improved text readability.
    • @@ -272,9 +283,9 @@

    • Added support for Folder API. See the Folders API section in the vignette for details.
    -
    +

    -Improvements

    +Improvements
    • Added floating TOC and changed the vignette theme for the HTML vignettes available on Bioconductor, to improve the browsing experience for long vignettes.
    @@ -323,9 +334,9 @@

    sevenbridges 1.11.3

    -
    +

    -Improvements

    +Improvements

    • Added better support for the spot instance feature, by introducing the new argument use_interruptible for project_new() and use_interruptible_instances for task_add(). This will allow users to enable/disable the spot instance feature on both the project level and individual task level. See the new section “Run tasks using spot instances” in the API vignette for details.
    @@ -334,9 +345,9 @@

    sevenbridges 1.11.2

    -
    +

    -Improvements

    +Improvements

    • Further remove all words related to the previous installation method per Bioconductor’s request.
    @@ -345,9 +356,9 @@

    sevenbridges 1.11.1

    -
    +

    -Improvements

    +Improvements

    • Use the new Bioconductor package manager BiocManager for installation instructions.
    @@ -367,9 +378,9 @@

    sevenbridges 1.7.5

    -
    +

    -Improvements

    +Improvements

    • Update rabix-cli (Bunny) to 1.0.2 for the Docker container.
    @@ -389,9 +400,9 @@

    sevenbridges 1.7.3

    -
    +

    -Improvements

    +Improvements

    • Use system font stack instead of Google Fonts in vignettes to avoid pandoc SSL issue.
    @@ -444,13 +455,13 @@

  • Fixed IDE Docker image build issues; removed the libssl-dev dependency; updated Dockerfile (#50).
  • -
    +

    -Improvements

    +Improvements @@ -471,15 +482,15 @@

    sevenbridges 1.5.6

    -
    +

    -Improvements

    +Improvements

    API Client

    • Added fields as query default in API calls, the same with limit, offset; now requests on file details will use fields = "_all" directly so that only one request is issued. The same applies to updating a upload logic for folder/multiple files (54488bc). Thanks: Raunaq Malhotra.

    • -
    • Added functions input_matrix() and output_matrix() (2ec7c84) to extract input/output matrix from CWL JSON files directly, without converting CWL JSON to Tool or Flow objects. This is a faster implementation compared to the old method, and more stable to custom fields.

    • +
    • Added functions input_matrix() and output_matrix() (2ec7c84) to extract input/output matrix from CWL JSON files directly, without converting CWL JSON to Tool or Flow objects. This is a faster implementation compared to the old method, and more stable to custom fields.

    @@ -505,9 +516,9 @@

    sevenbridges 1.5.5

    -
    +

    -Improvements

    +Improvements

    API Client (Authentication)

    @@ -561,9 +572,9 @@

  • Bug fix in IDE Dockerfile (838856b)
  • -
    +

    -Improvements

    +Improvements
    • Decoupled Files class and (CWL) File class; updated Files class to support the latest API
    • Updated error status code to the latest version
    • @@ -583,9 +594,9 @@

    • Fixed batch mode input checking. Thanks: Fabian Zimmer
    -
    +

    -Improvements

    +Improvements
    • New website for function references and vignettes: https://sbg.github.io/sevenbridges-r/
    • @@ -639,11 +650,11 @@

      Contents

      -

      Site built with pkgdown 1.5.1.

      +

      Site built with pkgdown 1.6.1.

      diff --git a/docs/pkgdown.css b/docs/pkgdown.css index c01e592..1273238 100644 --- a/docs/pkgdown.css +++ b/docs/pkgdown.css @@ -244,14 +244,14 @@ nav[data-toggle='toc'] .nav .nav > .active:focus > a { .ref-index th {font-weight: normal;} -.ref-index td {vertical-align: top;} +.ref-index td {vertical-align: top; min-width: 100px} .ref-index .icon {width: 40px;} .ref-index .alias {width: 40%;} .ref-index-icons .alias {width: calc(40% - 40px);} .ref-index .title {width: 60%;} .ref-arguments th {text-align: right; padding-right: 10px;} -.ref-arguments th, .ref-arguments td {vertical-align: top;} +.ref-arguments th, .ref-arguments td {vertical-align: top; min-width: 100px} .ref-arguments .name {width: 20%;} .ref-arguments .desc {width: 80%;} diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index 851f5a4..56f87a9 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -1,5 +1,5 @@ pandoc: 2.10.1 -pkgdown: 1.5.1 +pkgdown: 1.6.1 pkgdown_sha: ~ articles: api: api.html @@ -8,5 +8,5 @@ articles: cgc-datasets: cgc-datasets.html docker: docker.html rstudio: rstudio.html -last_built: 2020-08-11T17:46Z +last_built: 2020-10-15T03:36Z diff --git a/docs/reference/App-class.html b/docs/reference/App-class.html index d91f6d3..91b30a4 100644 --- a/docs/reference/App-class.html +++ b/docs/reference/App-class.html @@ -91,7 +91,7 @@ sevenbridges-r - 1.19.1 + 1.19.2
    @@ -175,7 +175,7 @@

    Fields +
    id

    app id

    project

    project id

    @@ -189,16 +189,17 @@

    Fields

    Examples

    -
    if (FALSE) { -a <- Auth(url = "https://api.sbgenomics.com/v2/", token = "your_token") +
    if (FALSE) { +a <- Auth(url = "https://api.sbgenomics.com/v2/", token = "your_token") # get a public app -app <- a$public_app(id = "admin/sbg-public-data/rna-seq-alignment-star") -app$input_matrix() -app$output_matrix() +app <- a$public_app(id = "admin/sbg-public-data/rna-seq-alignment-star") +app$input_matrix() +app$output_matrix() # get a public app -app <- a$public_app(id = "admin/sbg-public-data/star") -app$input_matrix() -app$output_matrix()}
    +app <- a$public_app(id = "admin/sbg-public-data/star") +app$input_matrix() +app$output_matrix()} +

    @@ -177,7 +177,7 @@

    Fields +
    from

    [character] Authentication method. Could be "direct" (pass the credential information to the arguments directly), "env" (read from pre-set system environment variables), @@ -223,7 +223,7 @@

    Methods - +
    api( ..., limit = getOption("sevenbridges")$limit, @@ -322,18 +322,20 @@

    Methods

    Examples

    # Direct authentication (default) # replace with your auth token -token <- "your_token" -a <- Auth(platform = "cgc", token = token)
    #> Using platform: cgc
    if (FALSE) { +token <- "your_token" +a <- Auth(platform = "cgc", token = token) +
    #> Using platform: cgc
    if (FALSE) { # Authentication with environment variables # This will read system environments variables # `SB_API_ENDPOINT` and `SB_AUTH_TOKEN` by default -a <- Auth(from = "env") +a <- Auth(from = "env") # Authentication with user configuration file # This will load profile `default` from config # file `~/.sevenbridges/credentials` by default -a <- Auth(from = "file") -}
    +a <- Auth(from = "file") +} +

    @@ -172,7 +172,7 @@

    Fields +
    loadContents

    [logical] Only applies when type is File. Read up to the first 64 KiB of text from the file and place it in the "contents" field of the file object for manipulation by @@ -192,7 +192,8 @@

    Fields

    Examples

    -
    Binding(loadContents = TRUE, secondaryFiles = "./test.txt")
    #> loadContents: yes +
    Binding(loadContents = TRUE, secondaryFiles = "./test.txt") +
    #> loadContents: yes #> secondaryFiles: ./test.txt #>
    @@ -206,11 +207,11 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/CCBList.html b/docs/reference/CCBList.html index 6ce57dc..3821edf 100644 --- a/docs/reference/CCBList.html +++ b/docs/reference/CCBList.html @@ -91,7 +91,7 @@ sevenbridges-r - 1.19.1 + 1.19.2

    @@ -166,7 +166,7 @@

    characterORCommandLineBindingList Class

    characterORCommandLineBindingList Class

    -
    CCBList(...)
    +
    CCBList(...)

    Arguments

    @@ -182,7 +182,8 @@

    Value

    CCBList

    Examples

    -
    CCBList("-o output.bam")
    #> [[1]] +
    CCBList("-o output.bam") +
    #> [[1]] #> [1] "-o output.bam"
    @@ -172,7 +172,7 @@

    Methods - +
    getFields(values)

    Return fields as a list, used for following conversion, does not assume the value is a primitive type.

    toJSON(...)

    Covert object to JSON

    @@ -185,7 +185,8 @@

    Methods

    Examples

    # no fields, only to provide methods to be extended -x <- CWL()
    +x <- CWL() +

    @@ -170,25 +170,26 @@

    CommandInputParameter Class

    Examples

    -
    ipl <- InputParameterList( - CommandInputParameter( - id = "BAM", type = "File", - label = "input bam", - description = "input bam", - inputBinding = CommandLineBinding( - position = 1L - ) - ), - CommandInputParameter( - id = "level", type = "Integer", - label = "Compression level", - description = "Compression level", - inputBinding = CommandLineBinding( - position = 2L, - prefix = "-l" - ) - ) -)
    +
    ipl <- InputParameterList( + CommandInputParameter( + id = "BAM", type = "File", + label = "input bam", + description = "input bam", + inputBinding = CommandLineBinding( + position = 1L + ) + ), + CommandInputParameter( + id = "level", type = "Integer", + label = "Compression level", + description = "Compression level", + inputBinding = CommandLineBinding( + position = 2L, + prefix = "-l" + ) + ) +) +
    @@ -170,7 +170,8 @@

    CommandInputSchema Class

    Examples

    -
    CommandInputSchema()
    #> type: +
    CommandInputSchema() +
    #> type: #> - '' #> fields: [] #> items: @@ -192,11 +193,11 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/CommandLineBinding-class.html b/docs/reference/CommandLineBinding-class.html index 03c2fda..ad8f90c 100644 --- a/docs/reference/CommandLineBinding-class.html +++ b/docs/reference/CommandLineBinding-class.html @@ -95,7 +95,7 @@ sevenbridges-r - 1.19.1 + 1.19.2
    @@ -200,7 +200,7 @@

    Fields +
    position

    [integer] The sorting key. Default position is 0.

    prefix

    [character] Command line prefix to add before the value.

    @@ -225,7 +225,8 @@

    Fields

    Examples

    -
    CommandLineBinding(position = 1L, prefix = "-l")
    #> position: 1 +
    CommandLineBinding(position = 1L, prefix = "-l") +
    #> position: 1 #> prefix: -l #> separate: yes #>
    @@ -240,11 +241,11 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/CommandLineTool.html b/docs/reference/CommandLineTool.html index d0fa1fb..e19a929 100644 --- a/docs/reference/CommandLineTool.html +++ b/docs/reference/CommandLineTool.html @@ -98,7 +98,7 @@ sevenbridges-r - 1.19.1 + 1.19.2
    @@ -186,7 +186,7 @@

    Fields +
    baseCommand

    (character) Specifies the program to execute. If the value is an array, the first element is the program to execute, and subsequent elements are placed at the beginning of the command @@ -331,27 +331,28 @@

    Examples

    -
    ipl <- InputParameterList( - InputParameter( - id = "BAM", type = "File", - label = "input bam", - description = "input bam", - inputBinding = CommandLineBinding( - position = 1L - ) - ), - InputParameter( - id = "level", type = "Integer", - label = "Compression level", - description = "Compression level", - inputBinding = CommandLineBinding( - position = 2L, - prefix = "-l" - ) - ) -) - -clt <- CommandLineTool(inputs = ipl, baseCommand = "samtools sort")
    +
    ipl <- InputParameterList( + InputParameter( + id = "BAM", type = "File", + label = "input bam", + description = "input bam", + inputBinding = CommandLineBinding( + position = 1L + ) + ), + InputParameter( + id = "level", type = "Integer", + label = "Compression level", + description = "Compression level", + inputBinding = CommandLineBinding( + position = 2L, + prefix = "-l" + ) + ) +) + +clt <- CommandLineTool(inputs = ipl, baseCommand = "samtools sort") +

    @@ -178,7 +178,7 @@

    Fields +
    glob

    [characterORExpression] Find files relative to the output directory, using POSIX glob(3) pathname matching. If provided an array, match all patterns in the array. If provided an @@ -195,7 +195,8 @@

    Fields

    Examples

    -
    CommandOutputBinding(glob = "*.bam")
    #> glob: '*.bam' +
    CommandOutputBinding(glob = "*.bam") +
    #> glob: '*.bam' #>
    @@ -172,7 +172,7 @@

    Fields +
    outputBinding

    [CommandOutputBinding] Describes how to handle the concrete outputs of a process step (such as files created by a program) and describe them in the process output parameter.

    @@ -180,7 +180,8 @@

    Fields

    Examples

    -
    CommandOutputParameter(outputBinding = CommandOutputBinding(glob = "*.bam"))
    #> type: +
    CommandOutputParameter(outputBinding = CommandOutputBinding(glob = "*.bam")) +
    #> type: #> - '' #> streamable: no #> id: '#' @@ -198,11 +199,11 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/CommandOutputSchema-class.html b/docs/reference/CommandOutputSchema-class.html index 3bd486d..fc2c105 100644 --- a/docs/reference/CommandOutputSchema-class.html +++ b/docs/reference/CommandOutputSchema-class.html @@ -91,7 +91,7 @@ sevenbridges-r - 1.19.1 + 1.19.2
    @@ -172,7 +172,7 @@

    Fields +
    outputBinding

    [CommandOutputBinding] Describes how to handle the concrete outputs of a process step (such as files created by a program) and describe them in the process output parameter.

    @@ -180,7 +180,8 @@

    Fields

    Examples

    -
    CommandOutputSchema()
    #> type: +
    CommandOutputSchema() +
    #> type: #> - '' #> fields: [] #> items: @@ -202,11 +203,11 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/DSCList.html b/docs/reference/DSCList.html index 9577a54..672af07 100644 --- a/docs/reference/DSCList.html +++ b/docs/reference/DSCList.html @@ -91,7 +91,7 @@ sevenbridges-r - 1.19.1 + 1.19.2
    @@ -166,7 +166,7 @@

    DSC list

    Contains DataypeSingleEnum, Schema, character

    -
    DSCList(...)
    +
    DSCList(...)

    Arguments

    @@ -182,7 +182,8 @@

    Value

    a DSCList

    Examples

    -
    DSCList("test", DatatypeEnum(), Schema())
    #> [[1]] +
    DSCList("test", DatatypeEnum(), Schema()) +
    #> [[1]] #> [1] "test" #> [[2]] #> An object of class "DatatypeSingleEnum" @@ -213,11 +214,11 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/Enum.html b/docs/reference/Enum.html index 1289a8b..ec7d837 100644 --- a/docs/reference/Enum.html +++ b/docs/reference/Enum.html @@ -91,7 +91,7 @@ sevenbridges-r - 1.19.1 + 1.19.2
    @@ -170,21 +170,25 @@

    Pre-defiend enums

    Examples

    -
    PrimitiveEnum()
    #> An object of class "PrimitiveSingleEnum" +
    PrimitiveEnum() +
    #> An object of class "PrimitiveSingleEnum" #> [1] "null" #> Slot "levels": #> [1] "null" "boolean" "int" "long" "float" "double" "bytes" #> [8] "string" -#>
    PrimitiveEnum("boolean")
    #> An object of class "PrimitiveSingleEnum" +#>
    PrimitiveEnum("boolean") +
    #> An object of class "PrimitiveSingleEnum" #> [1] "boolean" #> Slot "levels": #> [1] "null" "boolean" "int" "long" "float" "double" "bytes" #> [8] "string" -#>
    ComplexEnum("record")
    #> An object of class "ComplexSingleEnum" +#>
    ComplexEnum("record") +
    #> An object of class "ComplexSingleEnum" #> [1] "record" #> Slot "levels": #> [1] "record" "enum" "array" "map" -#>
    DatatypeEnum("map")
    #> An object of class "DatatypeSingleEnum" +#>
    DatatypeEnum("map") +
    #> An object of class "DatatypeSingleEnum" #> [1] "map" #> Slot "levels": #> [1] "null" "boolean" "int" "long" "float" "double" "bytes" @@ -201,11 +205,11 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/Expression-class.html b/docs/reference/Expression-class.html index 553a11a..d5ce1cf 100644 --- a/docs/reference/Expression-class.html +++ b/docs/reference/Expression-class.html @@ -94,7 +94,7 @@ sevenbridges-r - 1.19.1 + 1.19.2
    @@ -178,7 +178,7 @@

    Fields +
    engine

    (JsonPointerORcharacter) Either cwl:JsonPointer or a reference to an ExpressionEngineRequirement defining which engine to use.

    @@ -189,7 +189,8 @@

    Fields

    Examples

    -
    Expression(engine = "#cwl-js-engine", script = "$job.inputs['threads']")
    #> engine: '#cwl-js-engine' +
    Expression(engine = "#cwl-js-engine", script = "$job.inputs['threads']") +
    #> engine: '#cwl-js-engine' #> script: $job.inputs['threads'] #> class: Expression #>
    @@ -204,11 +205,11 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/ExpressionTool-class.html b/docs/reference/ExpressionTool-class.html index 55f6eeb..807b394 100644 --- a/docs/reference/ExpressionTool-class.html +++ b/docs/reference/ExpressionTool-class.html @@ -91,7 +91,7 @@ sevenbridges-r - 1.19.1 + 1.19.2
    @@ -172,7 +172,7 @@

    Fields +
    expression

    (Expression) The expression to execute. The expression must return a JSON object which matches the output parameters of the ExpressionTool.

    @@ -180,13 +180,14 @@

    Fields

    Examples

    -
    ExpressionTool( - expression = - Expression( - engine = "cwl:JsonPointer", - script = "$job.inputs['threads']" - ) -)
    #> id: '#' +
    ExpressionTool( + expression = + Expression( + engine = "cwl:JsonPointer", + script = "$job.inputs['threads']" + ) +) +
    #> id: '#' #> inputs: [] #> outputs: [] #> requirements: [] @@ -208,11 +209,11 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/FS-class.html b/docs/reference/FS-class.html index 77f72e9..4cf1225 100644 --- a/docs/reference/FS-class.html +++ b/docs/reference/FS-class.html @@ -91,7 +91,7 @@ sevenbridges-r - 1.19.1 + 1.19.2
    @@ -200,7 +200,7 @@

    Methods - +
    file(id = NULL)

    given project id, show all files in it

    mount( @@ -228,11 +228,11 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/File-class.html b/docs/reference/File-class.html index 578095f..793ed10 100644 --- a/docs/reference/File-class.html +++ b/docs/reference/File-class.html @@ -92,7 +92,7 @@ sevenbridges-r - 1.19.1 + 1.19.2

    @@ -168,7 +168,7 @@

    FileList Class

    File Class

    -
    FileList(...)
    +
    FileList(...)

    Arguments

    @@ -186,7 +186,7 @@

    Fields +
    class

    (character) Must be File to indicate this object describes a file.

    @@ -208,13 +208,14 @@

    Fields

    Examples

    -
    library(jsonlite) -library(yaml) -f1 <- File() -f2 <- File(path = "./out.bam", checksum = "test", - size = 3L, secondaryFile = FileList(File(path = "./out.bai"))) -fl <- FileList(f1, f2) -asList(fl)
    #> [[1]] +
    library(jsonlite) +library(yaml) +f1 <- File() +f2 <- File(path = "./out.bam", checksum = "test", + size = 3L, secondaryFile = FileList(File(path = "./out.bai"))) +fl <- FileList(f1, f2) +asList(fl) +
    #> [[1]] #> [[1]]$class #> [x] "File" #> @@ -248,9 +249,11 @@

    Examp #> #> #> -#>

    f1
    #> class: File +#>
    f1 +
    #> class: File #> secondaryFile: [] -#>
    f2
    #> class: File +#>
    f2 +
    #> class: File #> path: ./out.bam #> checksum: test #> size: 3 @@ -258,7 +261,8 @@

    Examp #> - class: File #> path: ./out.bai #> secondaryFile: [] -#>

    fl
    #> [[1]] +#>
    fl +
    #> [[1]] #> class: File #> secondaryFile: [] #> @@ -283,11 +287,11 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/Files-class.html b/docs/reference/Files-class.html index 1e56f5c..3807be2 100644 --- a/docs/reference/Files-class.html +++ b/docs/reference/Files-class.html @@ -91,7 +91,7 @@ sevenbridges-r - 1.19.1 + 1.19.2
    @@ -166,7 +166,7 @@

    Class Files

    Class Files

    -
    FilesList(...)
    +
    FilesList(...)

    Arguments

    @@ -190,7 +190,7 @@

    Fields +
    id

    character used as file id

    name

    string used as file name

    @@ -225,8 +225,8 @@

    Methods - -
    add_tag(x, ...)

    add new tags while keeping old tags

    +
    +
    add_tag(x, ...)

    add new tags while keeping old tags

    copy_to(project = NULL, name = NULL)

    copy a file to a project (id) with new name

    @@ -243,7 +243,7 @@

    Methods ... )

    Create a marker.

    -
    download(destfile, ..., method = "curl")

    see `help(download.file)` for more options

    +
    download(destfile, ..., method = "curl")

    see `help(download.file)` for more options

    get_parent_folder()

    Get the parent folder object of the current file/folder.

    @@ -261,7 +261,7 @@

    Methods
    set_meta(..., overwrite = FALSE)

    Set metadata with provided list, when overwrite is set to TRUE, it overwrites the metadata.

    -
    set_tag(x = NULL, overwrite = TRUE, ...)

    set a tag for a file, your tag need to be a list or vector

    +
    set_tag(x = NULL, overwrite = TRUE, ...)

    set a tag for a file, your tag need to be a list or vector

    tag()

    get tag from a file

    @@ -278,7 +278,8 @@

    Note

    coupled anymore.

    Examples

    -
    Files(id = "test_id", name = "test.bam")
    #> == Files == +
    Files(id = "test_id", name = "test.bam") +
    #> == Files == #> id : test_id #> name : test.bam
    @@ -292,11 +293,11 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/Flow.html b/docs/reference/Flow.html index db2c377..56f1e09 100644 --- a/docs/reference/Flow.html +++ b/docs/reference/Flow.html @@ -91,7 +91,7 @@ sevenbridges-r - 1.19.1 + 1.19.2 @@ -267,7 +267,7 @@

    Methods - +
    copy_obj()

    this is a hack to make copy of reference cwl object

    get_input(ids, force = FALSE)

    get input by pure input id from all steps

    @@ -290,7 +290,7 @@

    Methods
    input_id()

    show input id

    -
    input_matrix( +
    input_matrix( new.order = c("id", "label", "type", "required", "prefix", "fileTypes"), required = NULL )

    This return a matrix of input parameters, by default, following the order id, label, type, required, prefix, fileTypes. new.order accept names of column you want to print, but it has to be a field of inputs. When its set to NULL, it prints all fields. When required = TRUE, only print required field.

    @@ -307,7 +307,7 @@

    Methods
    output_id()

    show output id

    -
    output_matrix(new.order = c("id", "label", "type", "fileTypes"))

    This return a matrix of output parameters, by default, following the order id, label, type, fileTypes. new.order accept names of column you want to print, but it has to be a field of outputs. When its set to NULL, it prints all fields. When required = TRUE, only print required field.

    +
    output_matrix(new.order = c("id", "label", "type", "fileTypes"))

    This return a matrix of output parameters, by default, following the order id, label, type, fileTypes. new.order accept names of column you want to print, but it has to be a field of outputs. When its set to NULL, it prints all fields. When required = TRUE, only print required field.

    output_type()

    Show a vector of flow output type, names of them are output id.

    @@ -330,10 +330,11 @@

    Methods

    Examples

    -
    f1 <- system.file("extdata/app", "flow_star.json", package = "sevenbridges") -f1 <- convert_app(f1) +
    f1 <- system.file("extdata/app", "flow_star.json", package = "sevenbridges") +f1 <- convert_app(f1) # input matrix -f1$input_matrix()
    #> id label type required +f1$input_matrix() +
    #> id label type required #> 1 #sjdbGTFfile sjdbGTFfile File... FALSE #> 2 #fastq fastq File... TRUE #> 3 #genomeFastaFiles genomeFastaFiles File TRUE @@ -349,7 +350,8 @@

    Examp #> 5 null #> 6 null #> 7 null

    # by name -f1$input_matrix(c("id", "type", "required", "link_to"))
    #> id type required +f1$input_matrix(c("id", "type", "required", "link_to")) +
    #> id type required #> 1 #sjdbGTFfile File... FALSE #> 2 #fastq File... TRUE #> 3 #genomeFastaFiles File TRUE @@ -365,10 +367,12 @@

    Examp #> 5 #STAR_Genome_Generate.sjdbGTFtagExonParentGene #> 6 #STAR.winAnchorMultimapNmax #> 7 #STAR.winAnchorDistNbins

    # return only required -f1$input_matrix(required = TRUE)
    #> id label type required fileTypes +f1$input_matrix(required = TRUE) +
    #> id label type required fileTypes #> 2 #fastq fastq File... TRUE null #> 3 #genomeFastaFiles genomeFastaFiles File TRUE null
    # return everything -f1$input_matrix(NULL)
    #> id type required fileTypes +f1$input_matrix(NULL) +
    #> id type required fileTypes #> 1 #sjdbGTFfile File... FALSE null #> 2 #fastq File... TRUE null #> 3 #genomeFastaFiles File TRUE null @@ -408,7 +412,8 @@

    Examp #> 5 gene_id #STAR_Genome_Generate.sjdbGTFtagExonParentGene #> 6 50 #STAR.winAnchorMultimapNmax #> 7 9 #STAR.winAnchorDistNbins

    # return a output matrix with more informtion -f1$output_matrix()
    #> id label type fileTypes +f1$output_matrix() +
    #> id label type fileTypes #> 1 #unmapped_reads unmapped_reads File... null #> 2 #transcriptome_aligned_reads transcriptome_aligned_reads File null #> 3 #splice_junctions splice_junctions File null @@ -419,7 +424,8 @@

    Examp #> 8 #chimeric_alignments chimeric_alignments File null #> 9 #sorted_bam sorted_bam File null #> 10 #result result File null

    # return only a few fields -f1$output_matrix(c("id", "type"))
    #> id type +f1$output_matrix(c("id", "type")) +
    #> id type #> 1 #unmapped_reads File... #> 2 #transcriptome_aligned_reads File #> 3 #splice_junctions File @@ -430,7 +436,8 @@

    Examp #> 8 #chimeric_alignments File #> 9 #sorted_bam File #> 10 #result File

    # return everything -f1$output_matrix(NULL)
    #> id label type fileTypes +f1$output_matrix(NULL) +
    #> id label type fileTypes #> 1 #unmapped_reads unmapped_reads File... null #> 2 #transcriptome_aligned_reads transcriptome_aligned_reads File null #> 3 #splice_junctions splice_junctions File null @@ -463,7 +470,8 @@

    Examp #> 8 1147.5831 503.24993 #STAR.chimeric_alignments #> 9 934.2498 557.24984 #Picard_SortSam.sorted_bam #> 10 1431.6667 644.99999 #SBG_FASTQ_Quality_Detector.result

    # flow inputs -f1$input_type()
    #> sjdbGTFfile fastq +f1$input_type() +
    #> sjdbGTFfile fastq #> "File..." "File..." #> genomeFastaFiles sjdbGTFtagExonParentTranscript #> "File" "string" @@ -471,7 +479,8 @@

    Examp #> "string" "int" #> winAnchorDistNbins #> "int"

    # flow outouts -f1$output_type()
    #> unmapped_reads transcriptome_aligned_reads +f1$output_type() +
    #> unmapped_reads transcriptome_aligned_reads #> "File..." "File" #> splice_junctions reads_per_gene #> "File" "File" @@ -481,11 +490,13 @@

    Examp #> "File" "File" #> sorted_bam result #> "File" "File"

    # flow input id -f1$input_id()
    #> [1] "#sjdbGTFfile" "#fastq" +f1$input_id() +
    #> [1] "#sjdbGTFfile" "#fastq" #> [3] "#genomeFastaFiles" "#sjdbGTFtagExonParentTranscript" #> [5] "#sjdbGTFtagExonParentGene" "#winAnchorMultimapNmax" #> [7] "#winAnchorDistNbins"
    # linked input id -f1$linked_input_id()
    #> [1] "#STAR_Genome_Generate.sjdbGTFtagExonParentTranscript" +f1$linked_input_id() +
    #> [1] "#STAR_Genome_Generate.sjdbGTFtagExonParentTranscript" #> [2] "#STAR_Genome_Generate.sjdbGTFtagExonParentGene" #> [3] "#STAR_Genome_Generate.sjdbGTFfile" #> [4] "#STAR_Genome_Generate.genomeFastaFiles" @@ -496,14 +507,17 @@

    Examp #> [9] "#STAR.sjdbGTFfile" #> [10] "#STAR.reads" #> [11] "#STAR.genome"

    # flow output id -f1$output_id()
    #> [1] "#unmapped_reads" "#transcriptome_aligned_reads" +f1$output_id() +
    #> [1] "#unmapped_reads" "#transcriptome_aligned_reads" #> [3] "#splice_junctions" "#reads_per_gene" #> [5] "#log_files" "#chimeric_junctions" #> [7] "#intermediate_genome" "#chimeric_alignments" #> [9] "#sorted_bam" "#result"
    # linked output id -f1$linked_output_id()
    #> [1] "#STAR.aligned_reads" "#SBG_FASTQ_Quality_Detector.result" +f1$linked_output_id() +
    #> [1] "#STAR.aligned_reads" "#SBG_FASTQ_Quality_Detector.result" #> [3] "#STAR_Genome_Generate.genome"
    # link_map -f1$link_map()
    #> id +f1$link_map() +
    #> id #> 1 #STAR_Genome_Generate.sjdbGTFtagExonParentTranscript #> 2 #STAR_Genome_Generate.sjdbGTFtagExonParentGene #> 3 #STAR_Genome_Generate.sjdbGTFfile @@ -547,7 +561,8 @@

    Examp #> 19 #STAR.chimeric_alignments output #> 20 #Picard_SortSam.sorted_bam output #> 21 #SBG_FASTQ_Quality_Detector.result output

    # all step input id -f1$step_input_id()
    #> #STAR_Genome_Generate #STAR_Genome_Generate +f1$step_input_id() +
    #> #STAR_Genome_Generate #STAR_Genome_Generate #> "#sjdbScore" "#sjdbOverhang" #> #STAR_Genome_Generate #STAR_Genome_Generate #> "#sjdbGTFtagExonParentTranscript" "#sjdbGTFtagExonParentGene" @@ -673,7 +688,8 @@

    Examp #> "#alignMatesGapMax" "#alignIntronMin" #> #STAR #STAR #> "#alignIntronMax" "#alignEndsType"

    # all step input full id with type -f1$step_input_id(TRUE)
    #> int +f1$step_input_id(TRUE) +
    #> int #> "#STAR_Genome_Generate.sjdbScore" #> int #> "#STAR_Genome_Generate.sjdbOverhang" @@ -925,7 +941,8 @@

    Examp #> "#STAR.alignIntronMax" #> enum #> "#STAR.alignEndsType"

    # all step output id -f1$step_output_id()
    #> #STAR_Genome_Generate #SBG_FASTQ_Quality_Detector +f1$step_output_id() +
    #> #STAR_Genome_Generate #SBG_FASTQ_Quality_Detector #> "#genome" "#result" #> #Picard_SortSam #STAR #> "#sorted_bam" "#unmapped_reads" @@ -937,7 +954,8 @@

    Examp #> "#intermediate_genome" "#chimeric_junctions" #> #STAR #STAR #> "#chimeric_alignments" "#aligned_reads"

    # all step output full id with type -f1$step_output_id(TRUE)
    #> File File +f1$step_output_id(TRUE) +
    #> File File #> "#STAR_Genome_Generate.genome" "#SBG_FASTQ_Quality_Detector.result" #> File File... #> "#Picard_SortSam.sorted_bam" "#STAR.unmapped_reads" @@ -949,7 +967,8 @@

    Examp #> "#STAR.intermediate_genome" "#STAR.chimeric_junctions" #> File File #> "#STAR.chimeric_alignments" "#STAR.aligned_reads"

    # get inputs objects -f1$get_input("#clip3pNbases")
    #> type: +f1$get_input("#clip3pNbases") +
    #> type: #> - 'null' #> - items: int #> type: array @@ -970,7 +989,8 @@

    Examp #> sbg:category: Read parameters #> sbg:toolDefaultValue: '0' #> required: no -#>

    f1$get_input(c("#clip3pNbases", "#chimScoreMin"))
    #> [[1]] +#>
    f1$get_input(c("#clip3pNbases", "#chimScoreMin")) +
    #> [[1]] #> type: #> - 'null' #> - items: int @@ -1012,7 +1032,8 @@

    Examp #> sbg:category: Chimeric Alignments #> sbg:toolDefaultValue: '0' #> required: no -#>

    f1$get_input(c("#clip3pNbases", "#chimScoreMin", "#STAR.outFilterMismatchNoverLmax"))
    #> [[1]] +#>
    f1$get_input(c("#clip3pNbases", "#chimScoreMin", "#STAR.outFilterMismatchNoverLmax")) +
    #> [[1]] #> type: #> - 'null' #> - float @@ -1076,7 +1097,8 @@

    Examp #> sbg:toolDefaultValue: '0' #> required: no #>

    # get outputs objects -f1$get_output("#log_files")
    #> type: +f1$get_output("#log_files") +
    #> type: #> - 'null' #> - items: File #> type: array @@ -1087,7 +1109,8 @@

    Examp #> outputBinding: #> glob: '*Log*.out' #> sbg:fileTypes: OUT -#>

    f1$get_output(c("#log_files", "intermediate_genome"))
    #> [[1]] +#>
    f1$get_output(c("#log_files", "intermediate_genome")) +
    #> [[1]] #> type: #> - 'null' #> - items: File @@ -1112,7 +1135,8 @@

    Examp #> outputBinding: #> glob: '*_STARgenome.tar' #> sbg:fileTypes: TAR -#>

    f1$get_output(c("#log_files", "intermediate_genome", "#STAR.unmapped_reads"))
    #> [[1]] +#>
    f1$get_output(c("#log_files", "intermediate_genome", "#STAR.unmapped_reads")) +
    #> [[1]] #> type: #> - 'null' #> - items: File @@ -1150,7 +1174,8 @@

    Examp #> outputBinding: #> glob: '*_STARgenome.tar' #> sbg:fileTypes: TAR -#>

    f1$get_output("#log_files")
    #> type: +#>
    f1$get_output("#log_files") +
    #> type: #> - 'null' #> - items: File #> type: array @@ -1162,7 +1187,8 @@

    Examp #> glob: '*Log*.out' #> sbg:fileTypes: OUT #>

    # set flow input -f1$set_flow_input("#SBG_FASTQ_Quality_Detector.fastq")
    #> sbg:validationErrors: [] +f1$set_flow_input("#SBG_FASTQ_Quality_Detector.fastq") +
    #> sbg:validationErrors: [] #> sbg:sbgMaintained: no #> sbg:latestRevision: 2 #> sbg:toolAuthor: Seven Bridges Genomics @@ -4885,7 +4911,8 @@

    Examp #> sbg:canvas_zoom: 0.6 #> sbg:canvas_y: -16 #> sbg:canvas_x: -41 -#>

    f1$set_flow_output(c("#log_files", "intermediate_genome"))
    #> sbg:validationErrors: [] +#>
    f1$set_flow_output(c("#log_files", "intermediate_genome")) +
    #> sbg:validationErrors: [] #> sbg:sbgMaintained: no #> sbg:latestRevision: 2 #> sbg:toolAuthor: Seven Bridges Genomics @@ -8641,12 +8668,18 @@

    Examp #> sbg:canvas_y: -16 #> sbg:canvas_x: -41 #>

    # get required node -f1$get_required()
    #> fastq genomeFastaFiles +f1$get_required() +
    #> fastq genomeFastaFiles #> "File..." "File"
    # set required node -f1$steps[[1]]$run$set_required("genomeChrBinNbits")
    #> not implemented yet!
    f1$get_required()
    #> fastq genomeFastaFiles -#> "File..." "File"
    f1$steps[[1]]$run$set_required("genomeChrBinNbits", FALSE)
    #> not implemented yet!
    f1$get_required()
    #> fastq genomeFastaFiles +f1$steps[[1]]$run$set_required("genomeChrBinNbits") +
    #> not implemented yet!
    f1$get_required() +
    #> fastq genomeFastaFiles +#> "File..." "File"
    f1$steps[[1]]$run$set_required("genomeChrBinNbits", FALSE) +
    #> not implemented yet!
    f1$get_required() +
    #> fastq genomeFastaFiles #> "File..." "File"
    # get Tool object from Flow by id and name -f1$list_tool()
    #> label +f1$list_tool() +
    #> label #> 1 STAR Genome Generate #> 2 SBG FASTQ Quality Detector #> 3 Picard SortSam @@ -8661,7 +8694,8 @@

    Examp #> 2 #SBG_FASTQ_Quality_Detector #> 3 #Picard_SortSam #> 4 #STAR

    # return two -f1$get_tool("STAR")
    #> [[1]] +f1$get_tool("STAR") +
    #> [[1]] #> sbg:validationErrors: [] #> sbg:sbgMaintained: no #> sbg:latestRevision: 1 @@ -11502,7 +11536,8 @@

    Examp #> 'y': 323 #> #>

    # return one -f1$get_tool("^STAR$")
    #> sbg:validationErrors: [] +f1$get_tool("^STAR$") +
    #> sbg:validationErrors: [] #> sbg:sbgMaintained: no #> sbg:latestRevision: 4 #> sbg:job: @@ -13988,20 +14023,25 @@

    Examp #> x: 624.0 #> 'y': 323 #>

    # get included input ports -f1$get_input_port()
    #> #STAR_Genome_Generate #STAR_Genome_Generate #STAR +f1$get_input_port() +
    #> #STAR_Genome_Generate #STAR_Genome_Generate #STAR #> "#sjdbScore" "#sjdbOverhang" "#winFlankNbins" #> #STAR #> "#winBinNbits"
    # set included input ports -f1$set_input_port(c("#STAR.alignSJDBoverhangMin", "chimScoreSeparation")) -f1$get_input_port()
    #> #STAR_Genome_Generate #STAR_Genome_Generate #STAR +f1$set_input_port(c("#STAR.alignSJDBoverhangMin", "chimScoreSeparation")) +f1$get_input_port() +
    #> #STAR_Genome_Generate #STAR_Genome_Generate #STAR #> "#sjdbScore" "#sjdbOverhang" "#winFlankNbins" #> #STAR #STAR #STAR -#> "#winBinNbits" "#chimScoreSeparation" "#alignSJDBoverhangMin"
    f1$set_input_port(c("#STAR.alignSJDBoverhangMin", "chimScoreSeparation"), FALSE) -f1$get_input_port()
    #> #STAR_Genome_Generate #STAR_Genome_Generate #STAR +#> "#winBinNbits" "#chimScoreSeparation" "#alignSJDBoverhangMin"
    f1$set_input_port(c("#STAR.alignSJDBoverhangMin", "chimScoreSeparation"), FALSE) +f1$get_input_port() +
    #> #STAR_Genome_Generate #STAR_Genome_Generate #STAR #> "#sjdbScore" "#sjdbOverhang" "#winFlankNbins" #> #STAR -#> "#winBinNbits"
    f1$get_input_node()
    #> sjdbGTFfile fastq genomeFastaFiles -#> "#sjdbGTFfile" "#fastq" "#genomeFastaFiles"
    f1$get_output_node()
    #> unmapped_reads transcriptome_aligned_reads +#> "#winBinNbits"
    f1$get_input_node() +
    #> sjdbGTFfile fastq genomeFastaFiles +#> "#sjdbGTFfile" "#fastq" "#genomeFastaFiles"
    f1$get_output_node() +
    #> unmapped_reads transcriptome_aligned_reads #> "#unmapped_reads" "#transcriptome_aligned_reads" #> splice_junctions reads_per_gene #> "#splice_junctions" "#reads_per_gene" @@ -14012,10 +14052,12 @@

    Examp #> sorted_bam result #> "#sorted_bam" "#result" #> intermediate_genome -#> "#intermediate_genome"

    f1$get_input_exposed()
    #> sjdbGTFtagExonParentTranscript sjdbGTFtagExonParentGene +#> "#intermediate_genome"
    f1$get_input_exposed() +
    #> sjdbGTFtagExonParentTranscript sjdbGTFtagExonParentGene #> "#sjdbGTFtagExonParentTranscript" "#sjdbGTFtagExonParentGene" #> winAnchorMultimapNmax winAnchorDistNbins -#> "#winAnchorMultimapNmax" "#winAnchorDistNbins"
    f1$step_input_id(TRUE)
    #> int +#> "#winAnchorMultimapNmax" "#winAnchorDistNbins"
    f1$step_input_id(TRUE) +
    #> int #> "#STAR_Genome_Generate.sjdbScore" #> int #> "#STAR_Genome_Generate.sjdbOverhang" @@ -14266,10 +14308,12 @@

    Examp #> int #> "#STAR.alignIntronMax" #> enum -#> "#STAR.alignEndsType"

    f1$input_id()
    #> [1] "#sjdbGTFfile" "#fastq" +#> "#STAR.alignEndsType"
    f1$input_id() +
    #> [1] "#sjdbGTFfile" "#fastq" #> [3] "#genomeFastaFiles" "#sjdbGTFtagExonParentTranscript" #> [5] "#sjdbGTFtagExonParentGene" "#winAnchorMultimapNmax" -#> [7] "#winAnchorDistNbins"
    f1$set_flow_input("#STAR.reads")
    #> sbg:validationErrors: [] +#> [7] "#winAnchorDistNbins"
    f1$set_flow_input("#STAR.reads") +
    #> sbg:validationErrors: [] #> sbg:sbgMaintained: no #> sbg:latestRevision: 2 #> sbg:toolAuthor: Seven Bridges Genomics @@ -18070,11 +18114,13 @@

    Examp #> sbg:canvas_zoom: 0.6 #> sbg:canvas_y: -16 #> sbg:canvas_x: -41 -#>

    f1$input_id()
    #> [1] "#reads" "#sjdbGTFfile" +#>
    f1$input_id() +
    #> [1] "#reads" "#sjdbGTFfile" #> [3] "#fastq" "#genomeFastaFiles" #> [5] "#sjdbGTFtagExonParentTranscript" "#sjdbGTFtagExonParentGene" #> [7] "#winAnchorMultimapNmax" "#winAnchorDistNbins"
    # batch -f1$set_batch("sjdbGTFfile", c("metadata.sample_id", "metadata.library_id"))
    #> criteria provided, convert type from ITEM to CRITERIA
    #> sbg:validationErrors: [] +f1$set_batch("sjdbGTFfile", c("metadata.sample_id", "metadata.library_id")) +
    #> criteria provided, convert type from ITEM to CRITERIA
    #> sbg:validationErrors: [] #> sbg:sbgMaintained: no #> sbg:latestRevision: 2 #> sbg:toolAuthor: Seven Bridges Genomics @@ -21882,7 +21928,8 @@

    Examp #> criteria: #> - metadata.sample_id #> - metadata.library_id -#>

    f1$set_batch("sjdbGTFfile", type = "ITEM")
    #> sbg:validationErrors: [] +#>
    f1$set_batch("sjdbGTFfile", type = "ITEM") +
    #> sbg:validationErrors: [] #> sbg:sbgMaintained: no #> sbg:latestRevision: 2 #> sbg:toolAuthor: Seven Bridges Genomics @@ -25687,7 +25734,8 @@

    Examp #> sbg:batchBy: #> type: item #>

    # add source to id -f1$link_map()
    #> id +f1$link_map() +
    #> id #> 1 #STAR_Genome_Generate.sjdbGTFtagExonParentTranscript #> 2 #STAR_Genome_Generate.sjdbGTFtagExonParentGene #> 3 #STAR_Genome_Generate.sjdbGTFfile @@ -25736,7 +25784,8 @@

    Examp #> 21 #sorted_bam output #> 22 #result output #> 23 #intermediate_genome output -#> 24 intermediate_genome output

    f1$add_source_to_id(c("test1", "test2"), c("#STAR.genome", "#STAR.reads"))
    #> sbg:validationErrors: [] +#> 24 intermediate_genome output
    f1$add_source_to_id(c("test1", "test2"), c("#STAR.genome", "#STAR.reads")) +
    #> sbg:validationErrors: [] #> sbg:sbgMaintained: no #> sbg:latestRevision: 2 #> sbg:toolAuthor: Seven Bridges Genomics @@ -29544,7 +29593,8 @@

    Examp #> sbg:batchInput: '#sjdbGTFfile' #> sbg:batchBy: #> type: item -#>

    f1$link_map()
    #> id +#>
    f1$link_map() +
    #> id #> 1 #STAR_Genome_Generate.sjdbGTFtagExonParentTranscript #> 2 #STAR_Genome_Generate.sjdbGTFtagExonParentGene #> 3 #STAR_Genome_Generate.sjdbGTFfile @@ -29609,11 +29659,11 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/Handler-class.html b/docs/reference/Handler-class.html index 01aa2d4..94084b9 100644 --- a/docs/reference/Handler-class.html +++ b/docs/reference/Handler-class.html @@ -91,7 +91,7 @@ sevenbridges-r - 1.19.1 + 1.19.2
    @@ -179,7 +179,7 @@

    Fields +
    dockerfileHandler

    a function or NULL, how you handle Dockefile, for example, push it to GitHub.

    @@ -202,11 +202,11 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/Item-class.html b/docs/reference/Item-class.html index 80d4ee6..08b7f2e 100644 --- a/docs/reference/Item-class.html +++ b/docs/reference/Item-class.html @@ -91,7 +91,7 @@ sevenbridges-r - 1.19.1 + 1.19.2

    @@ -176,7 +176,7 @@

    Fields +
    response

    save the raw response from a request.

    auth_token

    propagate the auth_token from parent.

    @@ -196,11 +196,11 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/Metadata.html b/docs/reference/Metadata.html index ea5a233..b684e72 100644 --- a/docs/reference/Metadata.html +++ b/docs/reference/Metadata.html @@ -91,7 +91,7 @@ sevenbridges-r - 1.19.1 + 1.19.2 @@ -166,7 +166,7 @@

    Meta schema

    Meta schema

    -
    misc_make_metadata()
    +
    misc_make_metadata()

    Value

    @@ -179,9 +179,10 @@

    Details

    Examples

    # show schema (you can still provide customized one) # empty beause they are all NULL -Metadata() +Metadata() # show schema -Metadata()$show(TRUE)
    #> experimental_strategy : +Metadata()$show(TRUE) +
    #> experimental_strategy : #> library_id : #> platform : #> platform_unit_id : @@ -212,7 +213,8 @@

    Examp #> sample_type : #> aliquot_id : #> aliquot_uuid :

    # or -names(Metadata()$asList(TRUE))
    #> [1] "experimental_strategy" "library_id" "platform" +names(Metadata()$asList(TRUE)) +
    #> [1] "experimental_strategy" "library_id" "platform" #> [4] "platform_unit_id" "file_segment_number" "quality_scale" #> [7] "paired_end" "data_format" "file_extension" #> [10] "reference_genome" "data_type" "data_subtype" @@ -224,7 +226,8 @@

    Examp #> [28] "sample_uuid" "sample_type" "aliquot_id" #> [31] "aliquot_uuid"

    # returned meta field is actually define as function too, direclty # call them will give you details -platform()
    #> -- Platform -- +platform() +
    #> -- Platform -- #> data : NA #> name : Platform #> description : The version (manufacturer, model, etc.) of the @@ -235,7 +238,8 @@

    Examp #> type : #> suggested_values : Affymetrix SNP Array 6.0 / Illumina HiSeq / Illumina Human Methylation 450 / Illumina GA / MDA_RPPA_Core / BCR Record / Hospital Record / Illumina Human Methylation 27 / ABI capillary sequencer / AgilentG4502A_07_3 / HG-CGH-244A / HG-CGH-415K_G4124A / CGH-1x1M_G4447A / Illumina MiSeq / HT_HG-U133A / Illumina Human 1M Duo / H-miRNA_8x15Kv2 / Illumina HumanHap550 / H-miRNA_8x15K / AgilentG4502A_07_2 / HuEx-1_0-st-v2 / ABI SOLiD / Complete Genomics / HG-U133_Plus_2 / Illumina DNA Methylation OMA003 CPI / Illumina DNA Methylation OMA002 CPI / AgilentG4502A_07_1 / Ion Torrent PGM / Affymetrix U133 Plus 2 / LS 454 / HiSeq X Ten / Mixed platforms / Illumina / Helicos / PacBio #> regex : ^.{0,128}$ -#> regexErrMsg : The Platform can contain maximum 128 characters

    paired_end()
    #> -- Paired-end -- +#> regexErrMsg : The Platform can contain maximum 128 characters
    paired_end() +
    #> -- Paired-end -- #> data : NA #> name : Paired-end #> description : For paired-end sequencing, this value determines the @@ -246,7 +250,8 @@

    Examp #> type : #> suggested_values : NA / 1 / 2 #> regex : -#> regexErrMsg :

    quality_scale()
    #> -- Quality scale -- +#> regexErrMsg :
    quality_scale() +
    #> -- Quality scale -- #> data : NA #> name : Quality scale #> description : For raw reads, this value denotes the sequencing" @@ -258,7 +263,8 @@

    Examp #> suggested_values : NA / sanger / illumina13 / illumina15 / illumina18 / solexa #> regex : #> regexErrMsg :

    # check their suggested value and construct your metadata -Metadata(platform = "Affymetrix SNP Array 6.0", paired_end = 1, quality_scale = "sanger")
    #> platform : Affymetrix SNP Array 6.0 +Metadata(platform = "Affymetrix SNP Array 6.0", paired_end = 1, quality_scale = "sanger") +
    #> platform : Affymetrix SNP Array 6.0 #> quality_scale : sanger #> paired_end : 1
    @@ -272,11 +278,11 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/Parameter.html b/docs/reference/Parameter.html index 5a21705..a29ad2f 100644 --- a/docs/reference/Parameter.html +++ b/docs/reference/Parameter.html @@ -91,7 +91,7 @@ sevenbridges-r - 1.19.1 + 1.19.2 @@ -166,9 +166,9 @@

    Paramter class (reference class)

    Define an input or output parameter to a process.

    -
    InputParameterList(...)
    +    
    InputParameterList(...)
     
    -OutputParameterList(...)
    +OutputParameterList(...)

    Arguments

    @@ -186,7 +186,7 @@

    Fields +
    type

    [ANY] Specify valid types of data that may be assigned to this parameter.

    @@ -216,37 +216,39 @@

    Fields

    Examples

    -
    Parameter( - type = "integer", label = "thread", - description = "Specify the thread #", - default = 0 -)
    #> type: +
    Parameter( + type = "integer", label = "thread", + description = "Specify the thread #", + default = 0 +) +
    #> type: #> - integer #> label: thread #> description: 'Specify the thread #' #> streamable: no #> default: 0.0 #>
    -ipl <- InputParameterList( - InputParameter( - id = "BAM", type = "File", - label = "input bam", - description = "input bam", - inputBinding = CommandLineBinding( - position = 1L - ) - ), - InputParameter( - id = "level", type = "Integer", - label = "Compression level", - description = "Compression level", - inputBinding = CommandLineBinding( - position = 2L, - prefix = "-l" - ) - ) -) -ipl
    #> [[1]] +ipl <- InputParameterList( + InputParameter( + id = "BAM", type = "File", + label = "input bam", + description = "input bam", + inputBinding = CommandLineBinding( + position = 1L + ) + ), + InputParameter( + id = "level", type = "Integer", + label = "Compression level", + description = "Compression level", + inputBinding = CommandLineBinding( + position = 2L, + prefix = "-l" + ) + ) +) +ipl +
    #> [[1]] #> type: #> - File #> label: input bam @@ -280,11 +282,11 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/Process.html b/docs/reference/Process.html index c8f69b5..3075544 100644 --- a/docs/reference/Process.html +++ b/docs/reference/Process.html @@ -93,7 +93,7 @@ sevenbridges-r - 1.19.1 + 1.19.2
    @@ -176,7 +176,7 @@

    Fields +
    id

    [character] The unique identifier for this process object.

    @@ -213,26 +213,27 @@

    Fields

    Examples

    -
    ipl <- InputParameterList( - InputParameter( - id = "BAM", type = "File", - label = "input bam", - description = "input bam", - inputBinding = CommandLineBinding( - position = 1L - ) - ), - InputParameter( - id = "level", type = "Integer", - label = "Compression level", - description = "Compression level", - inputBinding = CommandLineBinding( - position = 2L, - prefix = "-l" - ) - ) -) -ipl
    #> [[1]] +
    ipl <- InputParameterList( + InputParameter( + id = "BAM", type = "File", + label = "input bam", + description = "input bam", + inputBinding = CommandLineBinding( + position = 1L + ) + ), + InputParameter( + id = "level", type = "Integer", + label = "Compression level", + description = "Compression level", + inputBinding = CommandLineBinding( + position = 2L, + prefix = "-l" + ) + ) +) +ipl +
    #> [[1]] #> type: #> - File #> label: input bam @@ -254,8 +255,9 @@

    Examp #> position: 2 #> prefix: -l #> separate: yes -#>

    p <- Process(id = "process", inputs = ipl) -p
    #> id: '#process' +#>
    p <- Process(id = "process", inputs = ipl) +p +
    #> id: '#process' #> inputs: #> - type: #> - File @@ -291,11 +293,11 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/ProcessRequirement.html b/docs/reference/ProcessRequirement.html index 28d870e..26a4fee 100644 --- a/docs/reference/ProcessRequirement.html +++ b/docs/reference/ProcessRequirement.html @@ -93,7 +93,7 @@ sevenbridges-r - 1.19.1 + 1.19.2
    @@ -170,11 +170,11 @@

    ProcessRequirement Class

    ProcessRequirementList

    -
    FileDefList(...)
    +    
    FileDefList(...)
     
    -EnvironmentDefList(...)
    +EnvironmentDefList(...)
     
    -ProcessRequirementList(...)
    +ProcessRequirementList(...)

    Arguments

    @@ -193,7 +193,7 @@

    +
    Define a file that must be placed by in the designated output directory prior to executing the command line tool. May be the @@ -288,7 +288,7 @@

    +
    Define an expression engine, as described in Expressions. @@ -369,15 +369,16 @@

    Examples

    -
    dkr <- DockerRequirement(dockerImageId = "testid") -cfr <- CreateFileRequirement(fileDef = FileDefList(FileDef(filename = "hello.txt"))) -sfr <- SubworkflowFeatureRequirement() -evr <- EnvVarRequirement(envDef = EnvironmentDefList( - EnvironmentDef(envName = "path", envValue = "testpath") -)) -safr <- ScatterFeatureRequirement() -eer <- ExpressionEngineRequirement(id = "hello") -ProcessRequirementList(dkr, cfr, sfr, evr, safr, eer)
    #> [[1]] +
    dkr <- DockerRequirement(dockerImageId = "testid") +cfr <- CreateFileRequirement(fileDef = FileDefList(FileDef(filename = "hello.txt"))) +sfr <- SubworkflowFeatureRequirement() +evr <- EnvVarRequirement(envDef = EnvironmentDefList( + EnvironmentDef(envName = "path", envValue = "testpath") +)) +safr <- ScatterFeatureRequirement() +eer <- ExpressionEngineRequirement(id = "hello") +ProcessRequirementList(dkr, cfr, sfr, evr, safr, eer) +
    #> [[1]] #> class: DockerRequirement #> dockerImageId: testid #> @@ -415,11 +416,11 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/Rplot001.png b/docs/reference/Rplot001.png new file mode 100644 index 0000000..17a3580 Binary files /dev/null and b/docs/reference/Rplot001.png differ diff --git a/docs/reference/Schema.html b/docs/reference/Schema.html index 18dc2db..7a4c599 100644 --- a/docs/reference/Schema.html +++ b/docs/reference/Schema.html @@ -91,7 +91,7 @@ sevenbridges-r - 1.19.1 + 1.19.2
    @@ -166,9 +166,9 @@

    SchemaList

    A schema defines a parameter type.

    -
    SchemaList(...)
    +    
    SchemaList(...)
     
    -SchemaDefList(...)
    +SchemaDefList(...)

    Arguments

    @@ -186,7 +186,7 @@

    Fields +
    type

    (ANY) The data type of this parameter.

    fields

    [SchemaList] When type is record, defines the fields of the @@ -207,7 +207,8 @@

    Fields

    Examples

    -
    Schema(fields = SchemaList(SchemaDef(name = "schema")))
    #> type: +
    Schema(fields = SchemaList(SchemaDef(name = "schema"))) +
    #> type: #> - '' #> fields: #> - type: @@ -238,11 +239,11 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/TaskHook.html b/docs/reference/TaskHook.html index 8a80414..5ca4fec 100644 --- a/docs/reference/TaskHook.html +++ b/docs/reference/TaskHook.html @@ -91,7 +91,7 @@ sevenbridges-r - 1.19.1 + 1.19.2
    @@ -166,14 +166,14 @@

    set task function hook

    set task function hook according to

    -
    setTaskHook(
    -  status = c("queued", "draft", "running", "completed", "aborted", "failed"),
    -  fun
    -)
    +    
    setTaskHook(
    +  status = c("queued", "draft", "running", "completed", "aborted", "failed"),
    +  fun
    +)
     
    -getTaskHook(
    -  status = c("queued", "draft", "running", "completed", "aborted", "failed")
    -)
    +getTaskHook( + status = c("queued", "draft", "running", "completed", "aborted", "failed") +)

    Arguments

    @@ -197,14 +197,16 @@

    Value

    object from setHook and getHook.

    Examples

    -
    getTaskHook("completed")
    #> function(...) { +
    getTaskHook("completed") +
    #> function(...) { #> cat("\r", "completed") #> return(TRUE) #> } -#> <environment: 0x7fcd4d1d2f98>
    setTaskHook("completed", function() { - message("completed") - return(TRUE) -})
    +#> <environment: 0x7fe5de588080>
    setTaskHook("completed", function() { + message("completed") + return(TRUE) +}) +
    @@ -183,7 +183,7 @@

    Fields +
    context

    [character] by default: http://www.commonwl.org/draft-2/

    @@ -196,7 +196,7 @@

    Methods - +
    copy_obj()

    this is a hack to make copy of reference cwl object

    get_input(name = NULL, id = NULL)

    get input objects by names or id

    @@ -209,7 +209,7 @@

    Methods
    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, return required field only.

    -
    input_matrix( +
    input_matrix( new.order = c("id", "label", "type", "required", "prefix", "fileTypes"), required = NULL )

    This return a matrix of input parameters, by default, following the order id, label, type, required, prefix, fileTypes. new.order accept names of column you want to print, but it has to be a field of inputs. When its set to NULL, it prints all fields. When required = TRUE, only print required field.

    @@ -218,7 +218,7 @@

    Methods
    output_id(full = FALSE)

    Get output id from a Tool, when full = TRUE, connect tool id with input id.

    -
    output_matrix(new.order = c("id", "label", "type", "fileTypes"))

    This return a matrix of output parameters, by default, following the order id, label, type, fileTypes. new.order accept names of column you want to print, but it has to be a field of outputs. When its set to NULL, it prints all fields. when required = TRUE, only print required field.

    +
    output_matrix(new.order = c("id", "label", "type", "fileTypes"))

    This return a matrix of output parameters, by default, following the order id, label, type, fileTypes. new.order accept names of column you want to print, but it has to be a field of outputs. When its set to NULL, it prints all fields. when required = TRUE, only print required field.

    output_type()

    this return a vector of types, names of them are output id

    @@ -243,11 +243,11 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/Workflow.html b/docs/reference/Workflow.html index 20f14e1..096e12b 100644 --- a/docs/reference/Workflow.html +++ b/docs/reference/Workflow.html @@ -93,7 +93,7 @@ sevenbridges-r - 1.19.1 + 1.19.2 @@ -170,7 +170,7 @@

    Workflow

    fields. A workflow executes as described in execution model.

    -
    WorkflowOutputParameterList(...)
    +
    WorkflowOutputParameterList(...)

    Arguments

    @@ -188,7 +188,7 @@

    Fields +
    outputs

    (WorkflowOutputParameterList) Defines the parameters representing the output of the process. May be used to generate and/or validate the output object. Inherited from Process

    @@ -204,7 +204,7 @@

    +
    Describe an output parameter of a workflow. The parameter must be connected to one or more parameters defined in the workflow that will provide the value of the output parameter. @@ -241,17 +241,18 @@

    E

    Examples

    # need better examples here -ws <- WorkflowStepList( - WorkflowStep( - id = "step1", label = "align-and-sort", - description = "align and sort", - inputs = WorkflowStepInputList( - WorkflowStepInput(id = "id1"), - WorkflowStepInput(id = "id2") - ) - ) -) -Workflow(steps = ws)
    #> id: '#' +ws <- WorkflowStepList( + WorkflowStep( + id = "step1", label = "align-and-sort", + description = "align and sort", + inputs = WorkflowStepInputList( + WorkflowStepInput(id = "id1"), + WorkflowStepInput(id = "id2") + ) + ) +) +Workflow(steps = ws) +
    #> id: '#' #> inputs: [] #> outputs: [] #> requirements: [] @@ -278,11 +279,11 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/WorkflowStep.html b/docs/reference/WorkflowStep.html index 9b9cda2..5cb8c23 100644 --- a/docs/reference/WorkflowStep.html +++ b/docs/reference/WorkflowStep.html @@ -94,7 +94,7 @@ sevenbridges-r - 1.19.1 + 1.19.2
    @@ -172,11 +172,11 @@

    WorkflowStepInputList

    parameters of the underlying process to workflow parameters.

    -
    WorkflowStepInputList(...)
    +    
    WorkflowStepInputList(...)
     
    -WorkflowStepOutputList(...)
    +WorkflowStepOutputList(...)
     
    -WorkflowStepList(...)
    +WorkflowStepList(...)

    Arguments

    @@ -194,7 +194,7 @@

    Fields +
    id

    [character] The unique identifier for this workflow step.

    inputs

    (WorkflowStepInputList) Defines the input parameters @@ -240,7 +240,7 @@

    < workflow step requirements.

    Examples

    -
    ws <- WorkflowStepList(WorkflowStep( - id = "step1", label = "align-and-sort", - description = "align and sort", - inputs = WorkflowStepInputList( - WorkflowStepInput(id = "id1"), - WorkflowStepInput(id = "id2") - ) -))
    +
    ws <- WorkflowStepList(WorkflowStep( + id = "step1", label = "align-and-sort", + description = "align and sort", + inputs = WorkflowStepInputList( + WorkflowStepInput(id = "id1"), + WorkflowStepInput(id = "id2") + ) +)) +
    @@ -166,7 +166,7 @@

    add # prefix to id

    add # prefix to id

    -
    addIdNum(x)
    +
    addIdNum(x)

    Arguments

    @@ -182,7 +182,8 @@

    Value

    a character with # prefix.

    Examples

    -
    addIdNum(c("bam", "#fastq"))
    #> bam #fastq +
    addIdNum(c("bam", "#fastq")) +
    #> bam #fastq #> "#bam" "#fastq"
    @@ -166,22 +166,22 @@

    Core HTTP logic for Seven Bridges API

    Core HTTP logic for Seven Bridges API

    -
    api(
    -  token = NULL,
    -  version = "v2",
    -  path = NULL,
    -  method = c("GET", "POST", "PUT", "DELETE", "PATCH"),
    -  query = NULL,
    -  body = list(),
    -  encode = c("json", "form", "multipart"),
    -  limit = getOption("sevenbridges")$limit,
    -  offset = getOption("sevenbridges")$offset,
    -  advance_access = getOption("sevenbridges")$advance_access,
    -  authorization = FALSE,
    -  fields = NULL,
    -  base_url = paste0("https://api.sbgenomics.com/", version, "/"),
    -  ...
    -)
    +
    api(
    +  token = NULL,
    +  version = "v2",
    +  path = NULL,
    +  method = c("GET", "POST", "PUT", "DELETE", "PATCH"),
    +  query = NULL,
    +  body = list(),
    +  encode = c("json", "form", "multipart"),
    +  limit = getOption("sevenbridges")$limit,
    +  offset = getOption("sevenbridges")$offset,
    +  advance_access = getOption("sevenbridges")$advance_access,
    +  authorization = FALSE,
    +  fields = NULL,
    +  base_url = paste0("https://api.sbgenomics.com/", version, "/"),
    +  ...
    +)

    Arguments

    @@ -278,10 +278,11 @@

    R

    https://docs.sevenbridges.com/v1.0/page/api

    Examples

    -
    token <- "your_token" +
    token <- "your_token" # list projects -if (FALSE) { -api(token = token, path = "projects", method = "GET")}
    +if (FALSE) { +api(token = token, path = "projects", method = "GET")} +
    @@ -168,22 +168,22 @@

    Convert a object slots/fields to a list, json, or yaml file

    prepare a object to be conveted to YAML/JSON.

    -
    asList(object, ...)
    +    
    asList(object, ...)
     
     # S4 method for ANY
    -asList(object, ...)
    +asList(object, ...)
     
     # S4 method for CWL
    -asList(object, ...)
    +asList(object, ...)
     
     # S4 method for SingleEnum
    -asList(object, ...)
    +asList(object, ...)
     
     # S4 method for SimpleList
    -asList(object, ...)
    +asList(object, ...)
     
     # S4 method for DSCList
    -asList(object, ...)
    +asList(object, ...)

    Arguments

    @@ -205,37 +205,42 @@

    Value

    Examples

    # define a S4 object -A <- setClass("A", slots = list(a = "character", b = "numeric")) +A <- setClass("A", slots = list(a = "character", b = "numeric")) # define a reference object which extends 'CWL' class -B <- setRefClass("B", fields = list(x = "character", y = "A"), contains = "CWL") +B <- setRefClass("B", fields = list(x = "character", y = "A"), contains = "CWL") # new instances -a <- A(a = "hello", b = 123) -b <- B(x = "world", y = a) +a <- A(a = "hello", b = 123) +b <- B(x = "world", y = a) # show -b
    #> x: world +b +
    #> x: world #> 'y': #> a: hello #> b: 123.0 -#>
    b$show("JSON")
    #> { +#>
    b$show("JSON") +
    #> { #> "x": "world", #> "y": { #> "a": "hello", #> "b": 123 #> } #> } -#>
    b$show("YAML")
    #> x: world +#>
    b$show("YAML") +
    #> x: world #> 'y': #> a: hello #> b: 123.0 #>
    # You can convert slots/fields into a list -asList(a)
    #> $a +asList(a) +
    #> $a #> [1] "hello" #> #> $b #> [1] 123 -#>
    asList(b)
    #> $x +#>
    asList(b) +
    #> $x #> [x] "world" #> #> $y @@ -245,7 +250,8 @@

    Examp #> $y$b #> [x] 123 #> -#>

    b$toList()
    #> $x +#>
    b$toList() +
    #> $x #> [x] "world" #> #> $y @@ -255,7 +261,9 @@

    Examp #> $y$b #> [x] 123 #> -#>

    b$toYAML()
    #> [1] "x: world\n'y':\n a: hello\n b: 123.0\n"
    b$toJSON()
    #> {"x":"world","y":{"a":"hello","b":123}}
    +#>
    b$toYAML() +
    #> [1] "x: world\n'y':\n a: hello\n b: 123.0\n"
    b$toJSON() +
    #> {"x":"world","y":{"a":"hello","b":123}}
    @@ -166,7 +166,7 @@

    batch function for task batch execution

    batch function for task batch execution

    -
    batch(input = NULL, criteria = NULL, type = c("ITEM", "CRITERIA"))
    +
    batch(input = NULL, criteria = NULL, type = c("ITEM", "CRITERIA"))

    Arguments

    @@ -198,14 +198,16 @@

    Value

    a list of 'batch_input' and 'batch_by' used for task batch

    Examples

    -
    batch(input = "fastq") # by ITEM
    #> $batch_input +
    batch(input = "fastq") # by ITEM +
    #> $batch_input #> [1] "fastq" #> #> $batch_by #> $batch_by$type #> [1] "ITEM" #> -#>
    batch(input = "fastq", c("metadata.sample_id", "metadata.library_id"))
    #> criteria provided, convert type from ITEM to CRITERIA
    #> $batch_input +#>
    batch(input = "fastq", c("metadata.sample_id", "metadata.library_id")) +
    #> criteria provided, convert type from ITEM to CRITERIA
    #> $batch_input #> [1] "fastq" #> #> $batch_by @@ -216,7 +218,8 @@

    Examp #> [1] "metadata.sample_id" "metadata.library_id" #> #>

    # shorthand for this -batch(input = "fastq", c("metadata.sample_id", "metadata.library_id"), type = "CRITERIA")
    #> $batch_input +batch(input = "fastq", c("metadata.sample_id", "metadata.library_id"), type = "CRITERIA") +
    #> $batch_input #> [1] "fastq" #> #> $batch_by @@ -238,11 +241,11 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/cli_list_projects.html b/docs/reference/cli_list_projects.html index 122b56f..95d7025 100644 --- a/docs/reference/cli_list_projects.html +++ b/docs/reference/cli_list_projects.html @@ -92,7 +92,7 @@ sevenbridges-r - 1.19.1 + 1.19.2
    @@ -168,7 +168,7 @@

    List projects using Seven Bridges command line uploader

    command line uploader.

    -
    cli_list_projects(token = NULL, uploader = NULL, proxy = NULL)
    +
    cli_list_projects(token = NULL, uploader = NULL, proxy = NULL)

    Arguments

    @@ -203,12 +203,13 @@

    See a all tags in a project.

    Examples

    -
    token <- "your_token" -if (FALSE) { -cli_list_projects( - token = token, - uploader = "~/Downloads/sbg-uploader/" -)}
    +
    token <- "your_token" +if (FALSE) { +cli_list_projects( + token = token, + uploader = "~/Downloads/sbg-uploader/" +)} +
    @@ -168,7 +168,7 @@

    List all the tags in project using Seven Bridges command line uploader

    command line uploader.

    -
    cli_list_tags(token = NULL, uploader = NULL, project = NULL, proxy = NULL)
    +
    cli_list_tags(token = NULL, uploader = NULL, project = NULL, proxy = NULL)

    Arguments

    @@ -208,13 +208,14 @@

    See a available projects.

    Examples

    -
    token <- "your_token" -if (FALSE) { -cli_list_tags( - token = token, - uploader = "~/Downloads/sbg-uploader/", - project = "username/project-name" -)}
    +
    token <- "your_token" +if (FALSE) { +cli_list_tags( + token = token, + uploader = "~/Downloads/sbg-uploader/", + project = "username/project-name" +)} +
    @@ -166,21 +166,21 @@

    Upload files using Seven Bridges command line uploader

    Upload files using Seven Bridges command line uploader.

    -
    cli_upload(
    -  token = NULL,
    -  uploader = NULL,
    -  file = NULL,
    -  project = NULL,
    -  proxy = NULL,
    -  tag = NULL,
    -  manifest_file = NULL,
    -  manifest_metadata = c("all", "none", "partial"),
    -  metadata_fields = NULL,
    -  dry_run = FALSE,
    -  dry_run_fields = NULL
    -)
    -
    -misc_upload_cli()
    +
    cli_upload(
    +  token = NULL,
    +  uploader = NULL,
    +  file = NULL,
    +  project = NULL,
    +  proxy = NULL,
    +  tag = NULL,
    +  manifest_file = NULL,
    +  manifest_metadata = c("all", "none", "partial"),
    +  metadata_fields = NULL,
    +  dry_run = FALSE,
    +  dry_run_fields = NULL
    +)
    +
    +misc_upload_cli()

    Arguments

    @@ -267,13 +267,14 @@

    See a for listing available projects or tags with the command line uploader.

    Examples

    -
    token <- "your_token" -if (FALSE) { -cli_upload( - token = token, - uploader = "~/Downloads/cgc-uploader/", - file = "~/example.fastq", project = "username/project-name" -)}
    +
    token <- "your_token" +if (FALSE) { +cli_upload( + token = token, + uploader = "~/Downloads/cgc-uploader/", + file = "~/example.fastq", project = "username/project-name" +)} +
    @@ -166,9 +166,9 @@

    Convert App or a CWL JSON file to Tool or Flow object

    Convert App or a CWL JSON file to Tool or Flow object

    -
    convert_app(from)
    +    
    convert_app(from)
     
    -appType(x)
    +appType(x)

    Arguments

    @@ -194,16 +194,17 @@

    appType - +
    this function return class of a App object.

    Examples

    -
    tool.in <- system.file("extdata/app", "tool_star.json", package = "sevenbridges") -flow.in <- system.file("extdata/app", "flow_star.json", package = "sevenbridges") +
    tool.in <- system.file("extdata/app", "tool_star.json", package = "sevenbridges") +flow.in <- system.file("extdata/app", "flow_star.json", package = "sevenbridges") # convert to Tool object -convert_app(tool.in)
    #> sbg:validationErrors: [] +convert_app(tool.in) +
    #> sbg:validationErrors: [] #> sbg:sbgMaintained: no #> sbg:latestRevision: 4 #> sbg:job: @@ -2683,7 +2684,8 @@

    Examp #> successCodes: [] #> temporaryFailCodes: [] #>

    # convert to Flow object -convert_app(flow.in)
    #> sbg:validationErrors: [] +convert_app(flow.in) +
    #> sbg:validationErrors: [] #> sbg:sbgMaintained: no #> sbg:latestRevision: 2 #> sbg:toolAuthor: Seven Bridges Genomics @@ -6412,11 +6414,11 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/cwl-utils.html b/docs/reference/cwl-utils.html index 6f1308d..8baa8a3 100644 --- a/docs/reference/cwl-utils.html +++ b/docs/reference/cwl-utils.html @@ -91,7 +91,7 @@ sevenbridges-r - 1.19.1 + 1.19.2
    @@ -166,7 +166,7 @@

    Get class from CWL JSON file

    Get class from CWL JSON file

    -
    get_cwl_class(input)
    +
    get_cwl_class(input)

    Arguments

    @@ -182,9 +182,15 @@

    Value

    character for cwl class "Workflow" or "CommandLineTool"

    Examples

    -
    tool.in <- system.file("extdata/app", "tool_unpack_fastq.json", package = "sevenbridges") -flow.in <- system.file("extdata/app", "flow_star.json", package = "sevenbridges") -get_cwl_class(tool.in)
    #> [1] "CommandLineTool"
    is_commandlinetool(tool.in)
    #> [1] TRUE
    is_workflow(tool.in)
    #> [1] FALSE
    get_cwl_class(flow.in)
    #> [1] "Workflow"
    is_commandlinetool(flow.in)
    #> [1] FALSE
    is_workflow(flow.in)
    #> [1] TRUE
    +
    tool.in <- system.file("extdata/app", "tool_unpack_fastq.json", package = "sevenbridges") +flow.in <- system.file("extdata/app", "flow_star.json", package = "sevenbridges") +get_cwl_class(tool.in) +
    #> [1] "CommandLineTool"
    is_commandlinetool(tool.in) +
    #> [1] TRUE
    is_workflow(tool.in) +
    #> [1] FALSE
    get_cwl_class(flow.in) +
    #> [1] "Workflow"
    is_commandlinetool(flow.in) +
    #> [1] FALSE
    is_workflow(flow.in) +
    #> [1] TRUE
    @@ -166,16 +166,16 @@

    Delete files or folders

    Delete files or folders

    -
    delete(obj)
    +    
    delete(obj)
     
     # S4 method for SimpleList
    -delete(obj)
    +delete(obj)
     
     # S4 method for Files
    -delete(obj)
    +delete(obj)
     
     # S4 method for Task
    -delete(obj)
    +delete(obj)

    Arguments

    @@ -191,10 +191,11 @@

    Value

    system message

    Examples

    -
    if (FALSE) { -a$project("demo")$file("omni")$delete() +
    if (FALSE) { +a$project("demo")$file("omni")$delete() # or -delete(a$project("demo")$file("omni"))}
    +delete(a$project("demo")$file("omni"))} +
    @@ -166,13 +166,13 @@

    Download files

    Download files

    -
    download(obj, ...)
    +    
    download(obj, ...)
     
     # S4 method for FilesList
    -download(obj, ...)
    +download(obj, ...)
     
     # S4 method for Files
    -download(obj, ...)
    +download(obj, ...)

    Arguments

    @@ -192,10 +192,11 @@

    Value

    system message

    Examples

    -
    if (FALSE) { -a$project("demo")$file("omni")$download() +
    if (FALSE) { +a$project("demo")$file("omni")$download() # or -download(a$project("demo")$file("omni"))}
    +download(a$project("demo")$file("omni"))} +
    @@ -170,9 +170,9 @@

    Opens web browser to copy the auth token

    The function will return the token string.

    -
    get_token(platform = c("cgc", "aws-us", "aws-eu", "gcp", "cavatica"))
    +    
    get_token(platform = c("cgc", "aws-us", "aws-eu", "gcp", "cavatica"))
     
    -misc_get_token()
    +misc_get_token()

    Arguments

    @@ -188,9 +188,10 @@

    Value

    auth token

    Examples

    -
    token <- NULL +
    token <- NULL # Will be prompted to enter the auth token -if (FALSE) token = get_token(platform = "cgc")
    +if (FALSE) token = get_token(platform = "cgc") +
    @@ -171,13 +171,13 @@

    Download Seven Bridges command line uploader and extract to extract the .tgz archive to a specified directory.

    -
    get_uploader(
    -  platform = c("cgc", "aws-us", "aws-eu", "gcp"),
    -  destdir = NULL,
    -  quiet = FALSE
    -)
    +    
    get_uploader(
    +  platform = c("cgc", "aws-us", "aws-eu", "gcp"),
    +  destdir = NULL,
    +  quiet = FALSE
    +)
     
    -misc_get_uploader()
    +misc_get_uploader()

    Arguments

    @@ -214,9 +214,10 @@

    R

    Examples

    # Download CGC CLI uploader to `~/Downloads` -dir <- "~/Downloads/" -if (FALSE) { -get_uploader("cgc", dir)}
    +dir <- "~/Downloads/" +if (FALSE) { +get_uploader("cgc", dir)} + @@ -701,11 +701,11 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/input_output_matrix.html b/docs/reference/input_output_matrix.html index 748f368..b218af2 100644 --- a/docs/reference/input_output_matrix.html +++ b/docs/reference/input_output_matrix.html @@ -93,7 +93,7 @@ sevenbridges-r - 1.19.1 + 1.19.2 @@ -170,13 +170,13 @@

    Get input/output matrix out of JSON CWL file directly

    list parsed from JSON file. Compare to convert_app, it is much faster.

    -
    input_matrix(
    -  from,
    -  new.order = c("id", "label", "type", "required", "prefix", "fileTypes"),
    -  required = NULL
    -)
    +    
    input_matrix(
    +  from,
    +  new.order = c("id", "label", "type", "required", "prefix", "fileTypes"),
    +  required = NULL
    +)
     
    -output_matrix(from, new.order = c("id", "label", "type", "fileTypes"))
    +output_matrix(from, new.order = c("id", "label", "type", "fileTypes"))

    Arguments

    @@ -203,15 +203,18 @@

    Value

    A data frame of input/output information.

    Examples

    -
    tool.in <- system.file("extdata/app", "tool_unpack_fastq.json", package = "sevenbridges") -flow.in <- system.file("extdata/app", "flow_star.json", package = "sevenbridges") -input_matrix(tool.in)
    #> id label type required prefix +
    tool.in <- system.file("extdata/app", "tool_unpack_fastq.json", package = "sevenbridges") +flow.in <- system.file("extdata/app", "flow_star.json", package = "sevenbridges") +input_matrix(tool.in) +
    #> id label type required prefix #> 1 #input_archive_file Input archive file File TRUE --input_archive_file #> fileTypes -#> 1 TAR, TAR.GZ, TGZ, TAR.BZ2, TBZ2, GZ, BZ2, ZIP
    input_matrix(tool.in, required = TRUE)
    #> id label type required prefix +#> 1 TAR, TAR.GZ, TGZ, TAR.BZ2, TBZ2, GZ, BZ2, ZIP
    input_matrix(tool.in, required = TRUE) +
    #> id label type required prefix #> 1 #input_archive_file Input archive file File TRUE --input_archive_file #> fileTypes -#> 1 TAR, TAR.GZ, TGZ, TAR.BZ2, TBZ2, GZ, BZ2, ZIP
    input_matrix(flow.in)
    #> id label type required +#> 1 TAR, TAR.GZ, TGZ, TAR.BZ2, TBZ2, GZ, BZ2, ZIP
    input_matrix(flow.in) +
    #> id label type required #> 1 #sjdbGTFfile sjdbGTFfile File... FALSE #> 2 #fastq fastq File... TRUE #> 3 #genomeFastaFiles genomeFastaFiles File TRUE @@ -226,19 +229,23 @@

    Examp #> 4 null #> 5 null #> 6 null -#> 7 null

    input_matrix(flow.in, c("id", "type"))
    #> id type +#> 7 null
    input_matrix(flow.in, c("id", "type")) +
    #> id type #> 1 #sjdbGTFfile File... #> 2 #fastq File... #> 3 #genomeFastaFiles File #> 4 #sjdbGTFtagExonParentTranscript string #> 5 #sjdbGTFtagExonParentGene string #> 6 #winAnchorMultimapNmax int -#> 7 #winAnchorDistNbins int
    input_matrix(flow.in, required = TRUE)
    #> id label type required fileTypes +#> 7 #winAnchorDistNbins int
    input_matrix(flow.in, required = TRUE) +
    #> id label type required fileTypes #> 2 #fastq fastq File... TRUE null -#> 3 #genomeFastaFiles genomeFastaFiles File TRUE null
    tool.in <- system.file("extdata/app", "tool_unpack_fastq.json", package = "sevenbridges") -flow.in <- system.file("extdata/app", "flow_star.json", package = "sevenbridges") -output_matrix(tool.in)
    #> id label type fileTypes -#> 1 #output_fastq_files Output FASTQ files File... FASTQ
    output_matrix(flow.in)
    #> id label type fileTypes +#> 3 #genomeFastaFiles genomeFastaFiles File TRUE null
    tool.in <- system.file("extdata/app", "tool_unpack_fastq.json", package = "sevenbridges") +flow.in <- system.file("extdata/app", "flow_star.json", package = "sevenbridges") +output_matrix(tool.in) +
    #> id label type fileTypes +#> 1 #output_fastq_files Output FASTQ files File... FASTQ
    output_matrix(flow.in) +
    #> id label type fileTypes #> 1 #unmapped_reads unmapped_reads File... null #> 2 #transcriptome_aligned_reads transcriptome_aligned_reads File null #> 3 #splice_junctions splice_junctions File null @@ -260,11 +267,11 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/link.html b/docs/reference/link.html index 350da03..609ec7c 100644 --- a/docs/reference/link.html +++ b/docs/reference/link.html @@ -91,7 +91,7 @@ sevenbridges-r - 1.19.1 + 1.19.2
    @@ -166,52 +166,52 @@

    link two nodes to form a new Workflow

    link two nodes to form a new Workflow

    -
    link(from, to, ...)
    +    
    link(from, to, ...)
     
     # S4 method for Tool,Tool
    -link(
    -  from,
    -  to,
    -  id1,
    -  id2,
    -  flow_id = NULL,
    -  flow_label = NULL,
    -  flow_input = NULL,
    -  flow_output = NULL
    -)
    +link(
    +  from,
    +  to,
    +  id1,
    +  id2,
    +  flow_id = NULL,
    +  flow_label = NULL,
    +  flow_input = NULL,
    +  flow_output = NULL
    +)
     
     # S4 method for Tool,Workflow
    -link(
    -  from,
    -  to,
    -  id1,
    -  id2,
    -  flow_id = NULL,
    -  flow_label = NULL,
    -  flow_input = NULL,
    -  flow_output = NULL
    -)
    +link(
    +  from,
    +  to,
    +  id1,
    +  id2,
    +  flow_id = NULL,
    +  flow_label = NULL,
    +  flow_input = NULL,
    +  flow_output = NULL
    +)
     
     # S4 method for Workflow,Tool
    -link(
    -  from,
    -  to,
    -  id1,
    -  id2,
    -  flow_id = NULL,
    -  flow_label = NULL,
    -  flow_input = NULL,
    -  flow_output = NULL
    -)
    +link(
    +  from,
    +  to,
    +  id1,
    +  id2,
    +  flow_id = NULL,
    +  flow_label = NULL,
    +  flow_input = NULL,
    +  flow_output = NULL
    +)
     
     # S4 method for Workflow,Workflow
    -link(from, to, id1, id2)
    +link(from, to, id1, id2)
     
     # S4 method for App,ToolORWorkflow
    -link(from, to, id1, id2)
    +link(from, to, id1, id2)
     
     # S4 method for ToolORWorkflow,App
    -link(from, to, id1, id2)
    +link(from, to, id1, id2)

    Arguments

    @@ -262,12 +262,13 @@

    Details

    Flexible enought to allow users to connect two objects by ids

    Examples

    -
    t1 <- system.file("extdata/app", "tool_unpack_fastq.json", package = "sevenbridges") -t2 <- system.file("extdata/app", "tool_star.json", package = "sevenbridges") -t1 <- convert_app(t1) -t2 <- convert_app(t2) +
    t1 <- system.file("extdata/app", "tool_unpack_fastq.json", package = "sevenbridges") +t2 <- system.file("extdata/app", "tool_star.json", package = "sevenbridges") +t1 <- convert_app(t1) +t2 <- convert_app(t2) # check possible link -link_what(t1, t2)
    #> $File... +link_what(t1, t2) +
    #> $File... #> $File...$from #> id label type fileTypes full.name #> 1 #output_fastq_files Output FASTQ files File... FASTQ #SBG_Unpack_FASTQs @@ -281,12 +282,14 @@

    Examp #> 95 GTF, GFF, TXT #STAR #> #>

    # link -f1 <- link(t1, t2, "output_fastq_files", "reads")
    #> flow_input: #SBG_Unpack_FASTQs.input_archive_file / #STAR.sjdbGTFfile / #STAR.genome
    #> flow_output: #STAR.aligned_reads / #STAR.transcriptome_aligned_reads / #STAR.reads_per_gene / #STAR.log_files / #STAR.splice_junctions / #STAR.chimeric_junctions / #STAR.unmapped_reads / #STAR.intermediate_genome / #STAR.chimeric_alignments
    # link -f2 <- link( - t1, t2, "output_fastq_files", "reads", - flow_input = "#SBG_Unpack_FASTQs.input_archive_file", - flow_output = "#STAR.log_files" -)
    #> flow_input: #SBG_Unpack_FASTQs.input_archive_file / #STAR.genome
    #> flow_output: #STAR.log_files
    +f1 <- link(t1, t2, "output_fastq_files", "reads") +
    #> flow_input: #SBG_Unpack_FASTQs.input_archive_file / #STAR.sjdbGTFfile / #STAR.genome
    #> flow_output: #STAR.aligned_reads / #STAR.transcriptome_aligned_reads / #STAR.reads_per_gene / #STAR.log_files / #STAR.splice_junctions / #STAR.chimeric_junctions / #STAR.unmapped_reads / #STAR.intermediate_genome / #STAR.chimeric_alignments
    # link +f2 <- link( + t1, t2, "output_fastq_files", "reads", + flow_input = "#SBG_Unpack_FASTQs.input_archive_file", + flow_output = "#STAR.log_files" +) +
    #> flow_input: #SBG_Unpack_FASTQs.input_archive_file / #STAR.genome
    #> flow_output: #STAR.log_files
    @@ -166,19 +166,19 @@

    List possible linking methods

    List possible linking methods

    -
    link_what(from, to, ...)
    +    
    link_what(from, to, ...)
     
     # S4 method for Tool,Tool
    -link_what(from, to)
    +link_what(from, to)
     
     # S4 method for Tool,SBGWorkflow
    -link_what(from, to)
    +link_what(from, to)
     
     # S4 method for SBGWorkflow,Tool
    -link_what(from, to)
    +link_what(from, to)
     
     # S4 method for SBGWorkflow,SBGWorkflow
    -link_what(from, to)
    +link_what(from, to)

    Arguments

    @@ -205,12 +205,13 @@

    Details

    Given two object of Tool, Flow or App, list all possible input/output match.

    Examples

    -
    t1 <- system.file("extdata/app", "tool_unpack_fastq.json", package = "sevenbridges") -t2 <- system.file("extdata/app", "tool_star.json", package = "sevenbridges") -t1 <- convert_app(t1) -t2 <- convert_app(t2) +
    t1 <- system.file("extdata/app", "tool_unpack_fastq.json", package = "sevenbridges") +t2 <- system.file("extdata/app", "tool_star.json", package = "sevenbridges") +t1 <- convert_app(t1) +t2 <- convert_app(t2) # check possible link -link_what(t1, t2)
    #> $File... +link_what(t1, t2) +
    #> $File... #> $File...$from #> id label type fileTypes full.name #> 1 #output_fastq_files Output FASTQ files File... FASTQ #SBG_Unpack_FASTQs @@ -223,11 +224,12 @@

    Examp #> 1 FASTA, FASTQ, FA, FQ, FASTQ.GZ, FQ.GZ, FASTQ.BZ2, FQ.BZ2 #STAR #> 95 GTF, GFF, TXT #STAR #> -#>

    tool.in <- system.file("extdata/app", "tool_unpack_fastq.json", package = "sevenbridges") -flow.in <- system.file("extdata/app", "flow_star.json", package = "sevenbridges") -t1 <- convert_app(tool.in) -f2 <- convert_app(flow.in) -link_what(t1, f2)
    #> $File... +#>
    tool.in <- system.file("extdata/app", "tool_unpack_fastq.json", package = "sevenbridges") +flow.in <- system.file("extdata/app", "flow_star.json", package = "sevenbridges") +t1 <- convert_app(tool.in) +f2 <- convert_app(flow.in) +link_what(t1, f2) +
    #> $File... #> $File...$from #> id label type fileTypes #> 1 #output_fastq_files Output FASTQ files File... FASTQ @@ -240,11 +242,12 @@

    Examp #> 1 #STAR_Genome_Generate.sjdbGTFfile | #STAR.sjdbGTFfile #> 2 #SBG_FASTQ_Quality_Detector.fastq #> -#>

    tool.in <- system.file("extdata/app", "tool_unpack_fastq.json", package = "sevenbridges") -flow.in <- system.file("extdata/app", "flow_star.json", package = "sevenbridges") -t1 <- convert_app(tool.in) -f2 <- convert_app(flow.in) -link_what(f2, t1)
    #> $File +#>
    tool.in <- system.file("extdata/app", "tool_unpack_fastq.json", package = "sevenbridges") +flow.in <- system.file("extdata/app", "flow_star.json", package = "sevenbridges") +t1 <- convert_app(tool.in) +f2 <- convert_app(flow.in) +link_what(f2, t1) +
    #> $File #> $File$from #> id label type required #> 2 #transcriptome_aligned_reads transcriptome_aligned_reads File FALSE @@ -283,11 +286,11 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/project_details.html b/docs/reference/project_details.html index a2168de..e72da83 100644 --- a/docs/reference/project_details.html +++ b/docs/reference/project_details.html @@ -91,7 +91,7 @@ sevenbridges-r - 1.19.1 + 1.19.2
    @@ -166,7 +166,7 @@

    Returns the details of the project

    Returns the details of the project.

    -
    project_details(token = NULL, project_id = NULL, ...)
    +
    project_details(token = NULL, project_id = NULL, ...)

    Arguments

    @@ -190,9 +190,10 @@

    Value

    parsed list of the returned json

    Examples

    -
    token <- "your_token" -if (FALSE) { -req <- project_details(token, project_id = "your_project_id")}
    +
    token <- "your_token" +if (FALSE) { +req <- project_details(token, project_id = "your_project_id")} +
    @@ -170,7 +170,7 @@

    Returns a list of all users invited to the project and their privileges

    of the user with privileges.

    -
    project_members(token = NULL, project_id = NULL, ...)
    +
    project_members(token = NULL, project_id = NULL, ...)

    Arguments

    @@ -194,9 +194,10 @@

    Value

    parsed list of the returned json

    Examples

    -
    token <- "your_token" -if (FALSE) { -req <- project_members(token, project_id = "your_project_id")}
    +
    token <- "your_token" +if (FALSE) { +req <- project_members(token, project_id = "your_project_id")} +
    @@ -170,23 +170,23 @@

    Rabix specifc Requirements

    requirements and hints

    -
    docker(
    -  pull = NULL,
    -  imageId = NULL,
    -  load = NULL,
    -  file = NULL,
    -  output = NULL,
    -  dockerPull = pull,
    -  dockerImageId = imageId,
    -  dockerLoad = load,
    -  dockerFile = file,
    -  dockerOutputDirectory = output,
    -  ...
    -)
    +    
    docker(
    +  pull = NULL,
    +  imageId = NULL,
    +  load = NULL,
    +  file = NULL,
    +  output = NULL,
    +  dockerPull = pull,
    +  dockerImageId = imageId,
    +  dockerLoad = load,
    +  dockerFile = file,
    +  dockerOutputDirectory = output,
    +  ...
    +)
     
    -requirements(...)
    +requirements(...)
     
    -fileDef(name = NULL, content = NULL)
    +fileDef(name = NULL, content = NULL)

    Arguments

    @@ -263,7 +263,7 @@

    Fields +
    value

    [Integer] for CPU default is 1L, if 0L, use all CPU. For mem, default is 1000L. Note: for CPU, 0L means multi-tread, and non-zero value will be converted to 1L, which @@ -272,13 +272,17 @@

    Fields

    Examples

    -
    cpu(1)
    #> class: sbg:CPURequirement +
    cpu(1) +
    #> class: sbg:CPURequirement #> value: 1 -#>
    CPURequirement(value = 1L)
    #> class: sbg:CPURequirement +#>
    CPURequirement(value = 1L) +
    #> class: sbg:CPURequirement #> value: 1 -#>
    docker("rocker/r-base")
    #> class: DockerRequirement +#>
    docker("rocker/r-base") +
    #> class: DockerRequirement #> dockerPull: rocker/r-base -#>
    requirements(docker("rocker/r-base"), cpu(1), mem(1024))
    #> [[1]] +#>
    requirements(docker("rocker/r-base"), cpu(1), mem(1024)) +
    #> [[1]] #> class: DockerRequirement #> dockerPull: rocker/r-base #> @@ -289,13 +293,17 @@

    Examp #> [[3]] #> class: sbg:MemRequirement #> value: 1024 -#>

    mem(2000)
    #> class: sbg:MemRequirement +#>
    mem(2000) +
    #> class: sbg:MemRequirement #> value: 2000 -#>
    MemRequirement(value = 2000L)
    #> class: sbg:MemRequirement +#>
    MemRequirement(value = 2000L) +
    #> class: sbg:MemRequirement #> value: 2000 -#>
    aws("c3.8xlarge")
    #> class: sbg:AWSInstanceType +#>
    aws("c3.8xlarge") +
    #> class: sbg:AWSInstanceType #> value: c3.8xlarge -#>
    anyReq("any")
    #> class: '' +#>
    anyReq("any") +
    #> class: '' #> value: any #>
    @@ -309,11 +317,11 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/response-methods.html b/docs/reference/response-methods.html index e9ee043..512cabf 100644 --- a/docs/reference/response-methods.html +++ b/docs/reference/response-methods.html @@ -91,7 +91,7 @@ sevenbridges-r - 1.19.1 + 1.19.2 @@ -166,27 +166,27 @@

    Get raw response from an Item object

    Get raw response from an Item object

    -
    response(x)
    +    
    response(x)
     
    -response(x) <- value
    +response(x) <- value
     
     # S4 method for ANY
    -response(x)
    +response(x)
     
     # S4 method for ANY
    -response(x) <- value
    +response(x) <- value
     
     # S4 method for Item
    -response(x)
    +response(x)
     
     # S4 method for Item
    -response(x) <- value
    +response(x) <- value
     
     # S4 method for SimpleList
    -response(x)
    +response(x)
     
     # S4 method for SimpleList
    -response(x) <- value
    +response(x) <- value

    Arguments

    @@ -206,8 +206,9 @@

    Value

    a raw response from httr

    Examples

    -
    if (FALSE) { -response(x)}
    +
    if (FALSE) { +response(x)} +
    @@ -166,7 +166,7 @@

    Set authentication environment variables for Seven Bridges API

    Set authentication environment variables for Seven Bridges API

    -
    sbg_get_env(x)
    +
    sbg_get_env(x)

    Arguments

    @@ -183,11 +183,12 @@

    Value

    Examples

    # set and get two environment variables for CGC -token <- "your_token" -if (FALSE) { -sbg_set_env("https://cgc-api.sbgenomics.com/v2", token) -sbg_get_env("SB_API_ENDPOINT") -sbg_get_env("SB_AUTH_TOKEN")}
    +token <- "your_token" +if (FALSE) { +sbg_set_env("https://cgc-api.sbgenomics.com/v2", token) +sbg_get_env("SB_API_ENDPOINT") +sbg_get_env("SB_AUTH_TOKEN")} + @@ -166,7 +166,7 @@

    Set authentication environment variables for Seven Bridges API

    Set authentication environment variables for Seven Bridges API

    -
    sbg_set_env(url = NULL, token = NULL)
    +
    sbg_set_env(url = NULL, token = NULL)

    Arguments

    @@ -187,11 +187,12 @@

    Value

    Examples

    # set and get environment variables for CGC -token <- "your_token" -if (FALSE) { -sbg_set_env("https://cgc-api.sbgenomics.com/v2", token) -sbg_get_env("SB_API_ENDPOINT") -sbg_get_env("SB_AUTH_TOKEN")}
    +token <- "your_token" +if (FALSE) { +sbg_set_env("https://cgc-api.sbgenomics.com/v2", token) +sbg_get_env("SB_API_ENDPOINT") +sbg_get_env("SB_AUTH_TOKEN")} + @@ -166,12 +166,12 @@

    List Class generator.

    Extends IRanges SimpleList class and return constructor.

    -
    setListClass(
    -  elementType = NULL,
    -  suffix = "List",
    -  contains = NULL,
    -  where = topenv(parent.frame())
    -)
    +
    setListClass(
    +  elementType = NULL,
    +  suffix = "List",
    +  contains = NULL,
    +  where = topenv(parent.frame())
    +)

    Arguments

    @@ -209,11 +209,11 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/set_test_env.html b/docs/reference/set_test_env.html index 9b47fd8..7a4371a 100644 --- a/docs/reference/set_test_env.html +++ b/docs/reference/set_test_env.html @@ -92,7 +92,7 @@ sevenbridges-r - 1.19.1 + 1.19.2 @@ -168,11 +168,11 @@

    Set testing env

    required images downloaded and if do creates container

    -
    set_test_env(
    -  type = "host",
    -  docker_image = "tengfei/testenv",
    -  data_dir = getwd()
    -)
    +
    set_test_env(
    +  type = "host",
    +  docker_image = "tengfei/testenv",
    +  data_dir = getwd()
    +)

    Arguments

    @@ -198,8 +198,9 @@

    Value

    docker stdout

    Examples

    -
    if (FALSE) { -set_test_env("dind", "tengfei/testenv", "/Users/<user>/tools")}
    +
    if (FALSE) { +set_test_env("dind", "tengfei/testenv", "/Users/<user>/tools")} +
    @@ -180,6 +180,13 @@

    Details

    +

    Author

    + +

    Soner Koc <soner.koc@sevenbridges.com> +Nan Xiao +Tengfei Yin +Dusan Randjelovic +Emile Young

    @@ -226,7 +226,7 @@

    Examples

    -
    ipl <- IPList( - input( - id = "bam", - type = "File", - label = "Bam file", - description = "Input bam file", - position = 1L, - separate = TRUE - ), - input( - id = "level", - type = "Integer", - label = "Compression Level", - description = "Set compression level, from 0 (uncompressed) to 9 (best)", - position = 2L - ), - input( - id = "prefix", - type = "String", - label = "Prefix", - description = "Write temporary files to PREFIX.nnnn.bam", - position = 3L - ) -)
    +
    ipl <- IPList( + input( + id = "bam", + type = "File", + label = "Bam file", + description = "Input bam file", + position = 1L, + separate = TRUE + ), + input( + id = "level", + type = "Integer", + label = "Compression Level", + description = "Set compression level, from 0 (uncompressed) to 9 (best)", + position = 2L + ), + input( + id = "prefix", + type = "String", + label = "Prefix", + description = "Write temporary files to PREFIX.nnnn.bam", + position = 3L + ) +) +
    @@ -166,7 +166,7 @@

    Check request status

    Check request status

    -
    status_check(req, as = "parsed", ...)
    +
    status_check(req, as = "parsed", ...)

    Value

    @@ -184,11 +184,11 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/tag-methods.html b/docs/reference/tag-methods.html index 3e6bb9e..efa0d95 100644 --- a/docs/reference/tag-methods.html +++ b/docs/reference/tag-methods.html @@ -92,7 +92,7 @@ sevenbridges-r - 1.19.1 + 1.19.2 @@ -168,21 +168,21 @@

    Set file tags

    Add new file tags and keep the old tags

    -
    set_tag(obj, ...)
    +    
    set_tag(obj, ...)
     
     # S4 method for FilesList
    -set_tag(obj, ...)
    +set_tag(obj, ...)
     
     # S4 method for Files
    -set_tag(obj, ...)
    +set_tag(obj, ...)
     
    -add_tag(obj, ...)
    +add_tag(obj, ...)
     
     # S4 method for FilesList
    -add_tag(obj, ...)
    +add_tag(obj, ...)
     
     # S4 method for Files
    -add_tag(obj, ...)
    +add_tag(obj, ...)

    Arguments

    @@ -203,14 +203,15 @@

    Value

    tag list

    Examples

    -
    if (FALSE) { -fl <- a$project("demo")$file("omni") -set_tag(fl, "new tag") -set_tag(fl, list("new tag", "new tag 2"))} -if (FALSE) { -fl <- a$project("demo")$file("omni") -add_tag(fl, "new tag") -add_tag(fl, list("new tag", "new tag 2"))}
    +
    if (FALSE) { +fl <- a$project("demo")$file("omni") +set_tag(fl, "new tag") +set_tag(fl, list("new tag", "new tag 2"))} +if (FALSE) { +fl <- a$project("demo")$file("omni") +add_tag(fl, "new tag") +add_tag(fl, list("new tag", "new tag 2"))} +
    @@ -166,7 +166,7 @@

    Test tools in rabix/bunny

    Test tools locally in rabix/bunny inside docker container

    -
    test_tool_bunny(rabix_tool, inputs)
    +
    test_tool_bunny(rabix_tool, inputs)

    Arguments

    @@ -198,11 +198,11 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/test_tool_cwlrun.html b/docs/reference/test_tool_cwlrun.html index 7a810c7..b01865b 100644 --- a/docs/reference/test_tool_cwlrun.html +++ b/docs/reference/test_tool_cwlrun.html @@ -92,7 +92,7 @@ sevenbridges-r - 1.19.1 + 1.19.2 @@ -168,7 +168,7 @@

    Test tools with cwl-runner

    (https://github.com/common-workflow-language/cwltool)

    -
    test_tool_cwlrun(rabix_tool, inputs = list())
    +
    test_tool_cwlrun(rabix_tool, inputs = list())

    Arguments

    @@ -200,11 +200,11 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/test_tool_rabix.html b/docs/reference/test_tool_rabix.html index a963248..9ceb0a4 100644 --- a/docs/reference/test_tool_rabix.html +++ b/docs/reference/test_tool_rabix.html @@ -91,7 +91,7 @@ sevenbridges-r - 1.19.1 + 1.19.2 @@ -166,7 +166,7 @@

    Test tools in rabix/rabix-devel (DEPRECATED)

    Test tools locally in rabix/rabix-devel python executor (DEPRECATED)

    -
    test_tool_rabix(rabix_tool, inputs = list())
    +
    test_tool_rabix(rabix_tool, inputs = list())

    Arguments

    @@ -198,11 +198,11 @@

    Contents

    -

    Site built with pkgdown 1.5.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/upload_complete_all.html b/docs/reference/upload_complete_all.html index ed8ce80..0f4e7ae 100644 --- a/docs/reference/upload_complete_all.html +++ b/docs/reference/upload_complete_all.html @@ -92,7 +92,7 @@ sevenbridges-r - 1.19.1 + 1.19.2 @@ -168,7 +168,7 @@

    Reports the complete file upload

    then the file is assembled and made available on the SBG platform.

    -
    upload_complete_all(token = NULL, upload_id = NULL, ...)
    +
    upload_complete_all(token = NULL, upload_id = NULL, ...)

    Arguments

    @@ -192,9 +192,10 @@

    Value

    parsed list of the returned json

    Examples

    -
    token <- "your_token" -if (FALSE) { -req <- upload_complete_all(token, upload_id = "your_upload_id")}
    +
    token <- "your_token" +if (FALSE) { +req <- upload_complete_all(token, upload_id = "your_upload_id")} +
    @@ -170,13 +170,13 @@

    Reports the completion of the part upload

    uploading the file in the ETag header.

    -
    upload_complete_part(
    -  token = NULL,
    -  upload_id = NULL,
    -  part_number = NULL,
    -  e_tag = NULL,
    -  ...
    -)
    +
    upload_complete_part(
    +  token = NULL,
    +  upload_id = NULL,
    +  part_number = NULL,
    +  e_tag = NULL,
    +  ...
    +)

    Arguments

    @@ -209,12 +209,13 @@

    Value

    parsed list of the returned json

    Examples

    -
    token <- "your_token" -if (FALSE) { -req <- upload_complete_part( - token, upload_id = "your_upload_id", - part_number = "1", e_tag = "your_e_tag" -)}
    +
    token <- "your_token" +if (FALSE) { +req <- upload_complete_part( + token, upload_id = "your_upload_id", + part_number = "1", e_tag = "your_e_tag" +)} +
    @@ -166,7 +166,7 @@

    Abort the upload

    Abort the upload; all upload records and the file are deleted.

    -
    upload_delete(token = NULL, upload_id = NULL, ...)
    +
    upload_delete(token = NULL, upload_id = NULL, ...)

    Arguments

    @@ -190,9 +190,10 @@

    Value

    parsed list of the returned json

    Examples

    -
    token <- "your_token" -if (FALSE) { -req <- upload_delete(token, upload_id = "your_upload_id")}
    +
    token <- "your_token" +if (FALSE) { +req <- upload_delete(token, upload_id = "your_upload_id")} +
    @@ -166,7 +166,7 @@

    Returns upload information for the ongoing upload

    Returns the upload information for the ongoing upload.

    -
    upload_info(token = NULL, upload_id = NULL, ...)
    +
    upload_info(token = NULL, upload_id = NULL, ...)

    Arguments

    @@ -190,8 +190,9 @@

    Value

    parsed list of the returned json

    Examples

    -
    token <- "your_token" -if (FALSE) req <- upload_info(token, upload_id = "your_upload_id")
    +
    token <- "your_token" +if (FALSE) req <- upload_info(token, upload_id = "your_upload_id") +
    @@ -170,7 +170,7 @@

    Returns AWS S3 signed URL for a part of the file upload

    upload to the signed URL in this time frame.

    -
    upload_info_part(token = NULL, upload_id = NULL, part_number = NULL, ...)
    +
    upload_info_part(token = NULL, upload_id = NULL, part_number = NULL, ...)

    Arguments

    @@ -198,9 +198,10 @@

    Value

    parsed list of the returned json

    Examples

    -
    token <- "your_token" -if (FALSE) { -req <- upload_info_part(token, upload_id = "your_upload_id", part_number = 1)}
    +
    token <- "your_token" +if (FALSE) { +req <- upload_info_part(token, upload_id = "your_upload_id", part_number = 1)} +
    @@ -178,14 +178,14 @@

    Initializes the upload of the specified file

    most users.

    -
    upload_init(
    -  token = NULL,
    -  project_id = NULL,
    -  name = NULL,
    -  size = NULL,
    -  part_size = NULL,
    -  ...
    -)
    +
    upload_init(
    +  token = NULL,
    +  project_id = NULL,
    +  name = NULL,
    +  size = NULL,
    +  part_size = NULL,
    +  ...
    +)

    Arguments

    @@ -231,13 +231,14 @@

    Details

    Examples

    -
    token <- "your_token" -if (FALSE) { -req <- upload_init( - token, - project_id = "your_project_id", - name = "Sample1_RNASeq_chr20.pe_1.fastq", size = 5242880 -)}
    +
    token <- "your_token" +if (FALSE) { +req <- upload_init( + token, + project_id = "your_project_id", + name = "Sample1_RNASeq_chr20.pe_1.fastq", size = 5242880 +)} +