Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

Adding a Result to the ClinSeq Pipeline

mkiwala-g edited this page Jul 8, 2014 · 3 revisions

Existing pipelines can be modified to produce additional results. To add an new result to a pipeline, there must be a Command Class which produces the result and the workflow of the pipeline must be expanded in order to execute the command. This tutorial guides a developer towards adding a new result to the ClinSeq Pipeline. This tutorial assumes that a Command Class (such as a Genome Model Tool) already exists to produce the result that is needed. If an appropriate Command Class does not exist, it should be developed first (see "Writing a New Command Class in the Genome Modeling System" for more information).

Expanding the ClinSeq Pipeline Workflow

When a build is started in the Genome Modeling System, the build object calls _resolve_workflow_for_build() on its Model. In return the Model object should construct and return a Workflow::Model object which describes the workflow of the pipeline that should be run in order to complete the build. The particular way that a pipeline constructs its workflow varies from pipeline to pipeline.

In the ClinSeq Pipeline, _resolve_workflow_for_build() is defined in the the Genome::Model::ClinSeq class. It is called when a ClinSeq build is about to start, and returns a Workflow::Model object which describes how the ClinSeq pipeline should run for that build. In order to expand the ClinSeq Pipeline workflow to include another result, the _resolve_workflow_for_build() in the Genome::Model::ClinSeq class must be modified to include:

  • a new model output to represent the new result
  • a new operation which executes the Command Class
  • a new input link to connect the appropriate ClinSeq input to the operation
  • a new output link to connect the result of the operation to the output of the model

This code diff shows how the _resolve_workflow_for_build() method was modified to incorporate the results of the Genome::Model::ClinSeq::Command::DumpIgvXml Command Class into the ClinSeq pipeline. This code diff shows three calls to a code reference named $add_link, which is used to link the Command Class into the pipeline's workflow.

Adding a New Output Result to the ClinSeq Model

diff --git b/lib/perl/Genome/Model/ClinSeq.pm a/lib/perl/Genome/Model/ClinSeq.pm
index 93450eb..346efc9 100644
--- b/lib/perl/Genome/Model/ClinSeq.pm
+++ a/lib/perl/Genome/Model/ClinSeq.pm
@@ -483,6 +483,7 @@ sub _resolve_workflow_for_build {
   # (too bad it can't just be inferred from a dynamically expanding output connector)
   my @output_properties = qw(
       summarize_builds_result
+      igv_session_result
   );
   if ($build->wgs_build) {
@@ -886,6 +887,12 @@ sub _resolve_workflow_for_build {
       }
   }
 
+  $msg = "Create IGV XML session files for varying levels of detail using the input builds";
+  my $igv_session_op = $add_step->($msg, "Genome::Model::ClinSeq::Command::DumpIgvXml");
+  $add_link->($input_connector, 'build_as_array', $igv_session_op, 'builds');
+  $add_link->($input_connector, 'igv_session_dir', $igv_session_op, 'outdir');
+  $add_link->($igv_session_op, 'result', $output_connector, 'igv_session_result');
+
   #GenerateClonalityPlots - Run clonality analysis and produce clonality plots
   my $clonality_op;
   if ($build->wgs_build){
Clone this wiki locally