blend4php  v0.1
A PHP API for interacting with Galaxy
 All Classes Functions Variables Pages
GalaxyWorkflows Class Reference

Public Member Functions

 __construct (GalaxyInstance $galaxy)
 
 index ($is_published=FALSE)
 
 show ($workflow_id, $show_published=true)
 
 delete ($workflow_id)
 
 export ($workflow_id)
 
 download ($workflow_id)
 
 update ($workflow_id, $JSON_Workflow)
 
 buildModule ($tool_id, $tool_input_ids=NULL, $tool_version=NULL, $annotation=NULL)
 
 indexInvocations ($workflow_id)
 
 showInvocations ($workflow_id, $invocation_id)
 
 cancelInvocation ($workflow_id, $invocation_id)
 
 invocationSteps ($workflow_id, $invocation_id, $step_id)
 
 updateInvocationSteps ($workflow_id, $invocation_id, $step_id, $payload=array())
 
 invoke ($workflow_id, $input_dataset_ids, $parameters=NULL, $hist_id=NULL)
 
 create ($params)
 

Constructor & Destructor Documentation

GalaxyWorkflows::__construct ( GalaxyInstance  $galaxy)

The Workflows constructor.

Parameters
GalaxyInstance$galaxyA GalaxyInstance object.
Returns
An instance of a workflows object.

Member Function Documentation

GalaxyWorkflows::buildModule (   $tool_id,
  $tool_input_ids = NULL,
  $tool_version = NULL,
  $annotation = NULL 
)

TODO incomplete

GalaxyWorkflows::cancelInvocation (   $workflow_id,
  $invocation_id 
)

Cancel an invocation request.

Corresponds to the Galaxy API/path at DELETE /api/workflows/{workflow_id}/invocation/{invocation_id}

Parameters
$workflow_idThe id of the workflow that the invocation belongs to. To obtain a workflow invocation, please use this class's index() function.
$invocation_idThe id of the invocation to invoke.
Returns
An array containing details of the specified invocation.
GalaxyWorkflows::create (   $params)

Creates or edits a workflow with the given parameters.

Corresponds to the Galaxy api/path at POST /api/workflows

Parameters
$paramsAn associative array containing the input parameters for this function. The following parameters are available:

If importing a JSON workflow:

  • workflow: A JSON representation of a workflow to be inserted into the database.

If running workflow from pre-existing workflow:

  • workflow_id: An existing workflow id. Either workflow_id, installed_repository_file or from_history_id must be specified. To obtain a workflow id, please see this class's index() function.
  • parameters: If workflow_id is set, specify the parameters for the workflow. See this class's invoke() for more details.
  • ds_map: If workflow_id is set - a dictionary mapping each input step id to a dictionary with 2 keys: ‘src’ (which can be ‘ldda’, ‘ld’ or ‘hda’) and ‘id’ (which should be the id of a LibraryDatasetDatasetAssociation, LibraryDataset or HistoryDatasetAssociation respectively).
  • no_add_to_history: If workflow_id is set; if present in the payload with any value, the input datasets will not be added to the selected history.
  • replacement_params: If workflow_id is set an optional dictionary used when renaming datasets.
  • history: If workflow_id is set optional history where to run the workflow, either the name of a new history or “hist_id=HIST_ID” where HIST_ID is the id of an existing history. If not specified, the workflow will be run a new unnamed history. To obtain a history ID Please refer to the index() function in the histories class.

If Creating / Running workflows from a History

  • from_history_id: Id of history to extract a workflow from. Either workflow_id, installed_repository_file or from_history_id must be specified.
  • job_ids: If from_history_id is set, optional list of jobs to include when extracting a workflow from history.
  • dataset_collection_ids: If from_history_id is set - optional list of HDCA hid`s corresponding to workflow inputs when extracting a workflow from history.
  • workflow_name: If from_history_id is set; name of the workflow to create when extracting a workflow from history.
  • allow_tool_state_corrections: if set to True, any Tool parameter changes will not prevent running workflow, defaults to False.
Returns
An array containing the created workflow.
GalaxyWorkflows::delete (   $workflow_id)

Delete a specified workflow.

Corresponds to the Galaxy API/method at DELETE /api/workflows/{encoded_workflow_id}

Parameters
$workflow_idThe id of the workflow to delete. To obtain a workflow id please use this class's index function.
GalaxyWorkflows::download (   $workflow_id)

Returns a selected workflow (using a filepath) to download.

It is similar to the export function except the returned array does not include a 'inputs' field.

Corresponds to the Galaxy API/path GET /api/workflows/{encoded_workflow_id}/download

Parameters
$workflow_idId of the Workflow to retreive To obtain a workflow id, please use this class index() function.
Returns
An array of the selected workflow.
GalaxyWorkflows::export (   $workflow_id)

Exports a workflow

Parameters
$workflow_idEncoded workflow ID.
Returns
An array representing the workflow requested.
GalaxyWorkflows::index (   $is_published = FALSE)

Retreive a list of all the workflows.

Corresponds to the Galaxy API/path at GET /api/workflows

Parameters
$is_publishedOptional, if true, published workflows will be displayed.
Returns
An array containing all of the workflows in Galaxy.
GalaxyWorkflows::indexInvocations (   $workflow_id)

Retreive a list of the workflow invocations for a given workflow.

Corresponds to the Galaxy API/path GET /api/workflows/{workflow_id}/invocations

Parameters
$workflow_idThe id of the workflow whos invocations to retreive.
Returns
An array containing the invocations of a workflow.
GalaxyWorkflows::invocationSteps (   $workflow_id,
  $invocation_id,
  $step_id 
)

Returns the invocation steps for a workflow.

Corresponds to the Galaxy API/path at GET /api/workflows/{workflow_id}/invocation/{invocation_id}/steps/{step_id}

Parameters
$workflow_idThe id of the workflow whos invocation steps to retreive. To obtain a workflow id, please use this class's index function.
$invocation_idThe id of the invocation the step belongs to. To obtain an invocaiton id please use this class's indexInvocation function.
$step_idThe id of the step to retreive.
Returns
An array containing information for all the invocation steps of the given workflow invocation.
GalaxyWorkflows::invoke (   $workflow_id,
  $input_dataset_ids,
  $parameters = NULL,
  $hist_id = NULL 
)

Invokes (runs) a specified workflow.

Corresponds to the Galaxy API method/path at POST /api/workflows/{encoded_workflow_id}/invocations

If a $hist_id or $hist_name are not provided then a new history is created.

Parameters
$workflow_idThe ID of the workflow to invoke.
$input_dataset_idsThe list of id's of the datasets to enter into the workflow. These id's can be found using the dataset class's index() function. For right now the dataset must come from a history. Also The dataset 'state' must be 'ok and 'deleted' must be set to false.
$parametersWorkflow tool parameters.
$hist_idOptional. The id of the history to export the results to. If a new history is not created. Leave this ommitted if a new history is to be created.
Returns
An array containing information on the workflow invoked.
GalaxyWorkflows::show (   $workflow_id,
  $show_published = true 
)

Retreive detailed information about a specific workflow.

Corresponds to the Galaxy API/path at GET /api/workflows/{encoded_workflow_id}

Parameters
$workflow_id
show$show_publishedIf true, show published workflows.
Returns
An array containing the details of a workflow.
GalaxyWorkflows::showInvocations (   $workflow_id,
  $invocation_id 
)

Retreive a detailed specific workflow invocation

Corresponds to the Galaxy API/path at GET /api/workflows/{workflow_id}/invocation/{invocation_id}

Parameters
$workflow_idThe specified workflow of the invocation to show. To obtain a workflow id please use this class index function.
$invocation_idThe id of the invocaiton. To obtain an invocation id, please use this class's index invocation function.
Returns
An array containing details of the specified invocation.
GalaxyWorkflows::update (   $workflow_id,
  $JSON_Workflow 
)

Updates an existing workflow using a pre-built JSON object.

Corresponds to the Galaxy API method and path PUT /api/workflows/{encoded_workflow_id}

Parameters
$workflow_idThe id of the workflow to update. You can obtain a workflow id through this class's index() function.
$JSON_WorkflowThe JSON representation of what the final workflow should look like, including the updates.
Returns
An array containing the updated workflow.
GalaxyWorkflows::updateInvocationSteps (   $workflow_id,
  $invocation_id,
  $step_id,
  $payload = array() 
)

Update state of running workflow step invocations.

Corresponds to the Galaxy API/path at PUT /api/workflows/{workflow_id}/invocation/{invocation_id}/steps/{step_id}

Parameters
$workflow_idThe id of the workflow whos invocation steps to update. To obtain a workflow id, please use this class's index function.
$invocation_idThe id of the invocation the step belongs to. To obtain an invocaiton id please use this class's indexInvocation function.
$step_idThe id of the step to update.
$payloadThe workflow as a JSON object (in an array), containing any or all update fields for the workflow.
Returns
An array containing information of the updated invocation step.

The documentation for this class was generated from the following file: