library(rcromwell)
library(dplyr)

Set your Cromwell URL

cromwell_config("http://localhost:8000")
#> $rcromwell_settings
#> $rcromwell_settings$url
#> [1] "http://localhost:8000"
#> 
#> $rcromwell_settings$verbose
#> [1] TRUE

Send a workflow to Crowmell

Get your file paths

file_hello <- system.file("examples/hello.wdl", package = "rcromwell")
file_inputs <- system.file("examples/inputs.json", package = "rcromwell")
file.copy(file_hello, (file_hello_tmp <- tempfile()))
#> [1] TRUE

Submit the job

this_job <- cromwell_submit_batch(wdl = file_hello, params = file_inputs)
#> Submitting a batch workflow to Cromwell
job_id <- this_job$id

this_job$id (00815b98-5f7e-4946-b324-1e4b1d1360a1) is the unique Cromwell ID for your entire workflow - you can use that to request all sorts of metadata!!!

Now get all your metadata and track the workflow!!

Return a data frame of all jobs run in the past number of days (uses your database)

cromwell_jobs(days = 7)
#> Querying cromwell for jobs in the last 7 days.
#> # A tibble: 1 × 1
#>   workflow_id
#>   <lgl>      
#> 1 NA

Return a data frame (one line if you only submit one workflow id) containing workflow level metadata

w <- cromwell_workflow(job_id)
#> Querying for metadata for workflow id: 00815b98-5f7e-4946-b324-1e4b1d1360a1

Print the current status of the workflow(s) is(are)

w$status
#> [1] "Succeeded"

Return a data frame containing all call level metadata

df <- cromwell_call(job_id)
#> Querying for call metadata for workflow id: 00815b98-5f7e-4946-b324-1e4b1d1360a1

Handy set of dplyr commands to tell you about how the various calls are doing

df %>%
  group_by(callName, executionStatus) %>%
  summarize(status = n()) %>%
  arrange(executionStatus)
#> `summarise()` has grouped output by 'callName'. You can override using the
#> `.groups` argument.
#> # A tibble: 1 × 3
#> # Groups:   callName [1]
#>   callName executionStatus status
#>   <chr>    <chr>            <int>
#> 1 hello    Done                 1

Returns a data frame containing call level call caching metadata

cromwell_cache(job_id)
#> Querying for call caching metadata for workflow id: 00815b98-5f7e-4946-b324-1e4b1d1360a1
#> # A tibble: 1 × 11
#>   workflowName callName outputs.response                  callCaching.allowRes…¹
#>   <chr>        <chr>    <chr>                             <chr>                 
#> 1 test         hello    /Users/schambe3/github/cromwell/… FALSE                 
#> # ℹ abbreviated name: ¹​callCaching.allowResultReuse
#> # ℹ 7 more variables: callCaching.effectiveCallCachingMode <chr>,
#> #   inputs.name <chr>, shardIndex <chr>, workflow_id <chr>,
#> #   executionStatus <chr>, returnCode <int>, jobId <chr>


FredHutch/fh.wdlR documentation built on March 26, 2024, 8:40 p.m.