Commit b87b77dc authored by Aaron Petkau's avatar Aaron Petkau

Added tool to generate Galaxy workflow given a template file

parent c7dbb159
......@@ -108,6 +108,15 @@ Installing the Workflow
Once the tools are installed the workflow under `workflows/` can be installed. This can be accomplished using the following steps.
Step 1: Generating a Galaxy workflow file
-----------------------------------------
The core snp pipeline workflow is stored as a Galaxy workflow, which contains references to all tools used + tool sheds used to install these tools. For example freebayes is refered to as `galaxy-shed.corefacility.ca/repos/phil/freebayes/freebayes/0.0.4`. If you have installed any of the local tools in a differently named tool shed, than this full path will not work. To work around this issue, a template file is included for the workflow `workflows/core_phylogenomics_pipeline_workflow/Galaxy-Workflow-Core_SNP_Pipeline.ga.tt`. We can generate the Galaxy-usable workflow file from this template file b y using a command similar to:
```bash
$ perl generate_galaxy_workflow.pl --local-toolshed localhost:9009/repos/aaron workflows/core_phylogenomics_pipeline_workflow/Galaxy-Workflow-Core_SNP_Pipeline.ga.tt > workflows/core_phylogenomics_pipeline_workflow/Galaxy-Workflow-Core_SNP_Pipeline.ga
```
Step 1: Upload Workflow to Tool Shed
------------------------------------
......@@ -126,6 +135,15 @@ To install a workflow from the Tool Shed into a running Galaxy instance please u
2. Find the particular tool shed containing your workflow and then find the workflow repository you just uploaded.
3. Install this workflow into Galaxy.
Updating Workflow
=================
The pipeline workflow is stored as a Galaxy workflow, which contains references to all tools used + tool sheds used to install these tools. For example freebayes is refered to as `galaxy-shed.corefacility.ca/repos/phil/freebayes/freebayes/0.0.4`. If you have installed any of the local tools in a differently named tool shed, than this full path will not work. A template file is also included for the workflow `workflows/core_phylogenomics_pipeline_workflow/Galaxy-Workflow-Core_SNP_Pipeline.ga.tt`. If you wish to update the workflow, the template file can be generated with a command like:
```bash
sed -e 's/"[^"]*core_pipeline/"[% LOCAL_REPOSITORY %]\/core_pipeline/' -e 's/"[^"]*smalt_collection/"[% LOCAL_REPOSITORY %]\/smalt_collection/' -e 's/"[^"]*phyml/"[% LOCAL_REPOSITORY %]\/phyml/' -e 's/"[^"]*freebayes/"[% LOCAL_REPOSITORY %]\/freebayes/' path/to/Galaxy-Workflow-Core_SNP_Pipeline.ga > workflows/core_phylogenomics_pipeline_workflow/Galaxy-Workflow-Core_SNP_Pipeline.ga.tt
```
[Core Phylogenomis Pipeline]: https://github.com/apetkau/core-phylogenomics
[Galaxy Tool Shed]: https://wiki.galaxyproject.org/ToolShed
[Testing Installed Tools]: https://wiki.galaxyproject.org/TestingInstalledTools
......
#!/usr/bin/env perl
use warnings;
use strict;
use Template;
use Pod::Usage;
use Getopt::Long;
my $pod_sections = "SYNOPSIS|EXAMPLE";
my $local_toolshed;
my $galaxy_template_file;
if (!GetOptions('l|local-toolshed=s' => \$local_toolshed)) {
pod2usage(-verbose => 99, -sections => $pod_sections, -exitval => 1);
}
if (not defined $local_toolshed) {
pod2usage(-message => "no galaxy local toolshed location defined", -sections => $pod_sections, -verbose => 99, -exitval => 1);
}
($galaxy_template_file) = @ARGV;
if (not defined $galaxy_template_file) {
pod2usage(-message=> "no galaxy template file defined", -sections => $pod_sections, -verbose => 99, -exitval => 1);
} elsif (not -e $galaxy_template_file) {
pod2usage(-message=> "galaxy template file $galaxy_template_file does not exist",
-sections => $pod_sections, -verbose => 99, -exitval => 1);
}
my $template = Template->new();
$template->process($galaxy_template_file, { 'LOCAL_REPOSITORY' => $local_toolshed });
=pod
=head1 NAME
generate_galaxy_workflow.pl: Script to generate a Galaxy workflow given the template workflow file.
=head1 SYNOPSIS
=over
=item generate_galaxy_workflow.pl --local-toolshed [local toolshed] [galaxy_workflow_template.ga.tt] > [galaxy_workflow.ga]
=back
=head1 EXAMPLE
=item generate_galaxy_workflow.pl --local-toolshed localhost:9009/repos/aaron Galaxy-Workflow-Core_SNP_Pipeline.ga > workflows/core_phylogenomics_pipeline_workflow/Galaxy-Workflow-Core_SNP_Pipeline.ga.tt
=back
=head1 DESCRIPTION
=over
=item -l|--local-toolshed: A URL to a local toolshed where the local tools will be installed.
=item [galaxy_workflow_template.ga.tt]: The Galaxy workflow template.
=item [galaxy_workflow.ga]: The output Galaxy workflow.
=back
=head1 AUTHORS
Aaron Petkau <aaron.petkau@phac-aspc.gc.ca>
=cut
......@@ -73,7 +73,7 @@
},
"post_job_actions": {},
"tool_errors": null,
"tool_id": "galaxy-toolshed-dev.corefacility.ca/repos/phil/core_pipeline/findrepeat/0.0.2",
"tool_id": "[% LOCAL_REPOSITORY %]/core_pipeline/findrepeat/0.0.2",
"tool_state": "{\"__page__\": 0, \"fasta\": \"null\", \"__rerun_remap_job_id__\": null, \"pid\": \"\\\"90\\\"\", \"length\": \"\\\"150\\\"\"}",
"tool_version": "0.0.2",
"type": "tool",
......@@ -106,7 +106,7 @@
},
"post_job_actions": {},
"tool_errors": null,
"tool_id": "galaxy-toolshed-dev.corefacility.ca/repos/phil/smalt_collection/smalt_index/0.0.3",
"tool_id": "[% LOCAL_REPOSITORY %]/smalt_collection/smalt_index/0.0.3",
"tool_state": "{\"__page__\": 0, \"k\": \"\\\"13\\\"\", \"__rerun_remap_job_id__\": null, \"s\": \"\\\"7\\\"\", \"reference\": \"null\"}",
"tool_version": "0.0.3",
"type": "tool",
......@@ -143,7 +143,7 @@
},
"post_job_actions": {},
"tool_errors": null,
"tool_id": "galaxy-toolshed-dev.corefacility.ca/repos/phil/smalt_collection/smalt_map/0.0.3",
"tool_id": "[% LOCAL_REPOSITORY %]/smalt_collection/smalt_map/0.0.3",
"tool_state": "{\"minbasq\": \"\\\"\\\"\", \"__page__\": 0, \"insertmin\": \"\\\"\\\"\", \"mincover\": \"\\\"\\\"\", \"insfil\": \"null\", \"scordiff\": \"\\\"\\\"\", \"insertmax\": \"\\\"\\\"\", \"singlePaired\": \"{\\\"fastq_collection\\\": null, \\\"sPaired\\\": \\\"collections\\\", \\\"__current_case__\\\": 3}\", \"minid\": \"\\\"0.5\\\"\", \"__rerun_remap_job_id__\": null, \"search_harder\": \"\\\"False\\\"\", \"seed\": \"\\\"-1\\\"\", \"threads\": \"\\\"8\\\"\", \"sw_weighted\": \"\\\"False\\\"\", \"smi\": \"null\", \"outformat\": \"\\\"sam\\\"\", \"pairtype\": \"\\\"pe\\\"\", \"minscor\": \"\\\"\\\"\", \"sma\": \"null\"}",
"tool_version": "0.0.3",
"type": "tool",
......@@ -254,7 +254,7 @@
},
"post_job_actions": {},
"tool_errors": null,
"tool_id": "galaxy-shed.corefacility.ca/repos/phil/freebayes/freebayes/0.0.4",
"tool_id": "[% LOCAL_REPOSITORY %]/freebayes/0.0.4",
"tool_state": "{\"reference_source\": \"{\\\"ref_file\\\": null, \\\"reference_source_selector\\\": \\\"history\\\", \\\"input_bams\\\": [{\\\"__index__\\\": 0, \\\"input_bam\\\": null}], \\\"__current_case__\\\": 1}\", \"__rerun_remap_job_id__\": null, \"options_type\": \"{\\\"section_mappability_priors_expectations_type\\\": {\\\"section_mappability_priors_expectations_type_selector\\\": \\\"do_not_set\\\", \\\"__current_case__\\\": 0}, \\\"haplotype_basis_alleles\\\": null, \\\"output_trace_option\\\": \\\"False\\\", \\\"dont_left_align_indels\\\": \\\"False\\\", \\\"options_type_selector\\\": \\\"advanced\\\", \\\"input_variant_type\\\": {\\\"input_variant_type_selector\\\": \\\"do_not_provide\\\", \\\"__current_case__\\\": 0}, \\\"report_all_haplotype_alleles\\\": \\\"False\\\", \\\"section_algorithmic_features_type\\\": {\\\"exclude_unobserved_genotypes\\\": \\\"False\\\", \\\"genotyping_max_iterations\\\": \\\"1000\\\", \\\"report_genotype_likelihood_max\\\": \\\"False\\\", \\\"genotype_variant_threshold\\\": \\\"\\\", \\\"posterior_integration_limits_m\\\": \\\"3\\\", \\\"posterior_integration_limits_n\\\": \\\"1\\\", \\\"harmonic_indel_quality\\\": \\\"False\\\", \\\"section_algorithmic_features_type_selector\\\": \\\"set\\\", \\\"site_selection_max_iterations\\\": \\\"5\\\", \\\"read_dependence_factor\\\": \\\"0.9\\\", \\\"__current_case__\\\": 1, \\\"use_mapping_quality\\\": \\\"False\\\", \\\"genotyping_max_banddepth\\\": \\\"7\\\", \\\"genotype_qualities\\\": \\\"False\\\"}, \\\"input_populations_file\\\": null, \\\"section_reporting_type\\\": {\\\"section_reporting_type_selector\\\": \\\"do_not_set\\\", \\\"__current_case__\\\": 0}, \\\"section_population_priors_type\\\": {\\\"section_population_priors_type_selector\\\": \\\"do_not_set\\\", \\\"__current_case__\\\": 0}, \\\"section_allele_scope_type\\\": {\\\"section_allele_scope_type_selector\\\": \\\"do_not_set\\\", \\\"__current_case__\\\": 0}, \\\"section_input_filters_type\\\": {\\\"min_alternate_count\\\": \\\"2\\\", \\\"section_input_filters_type_selector\\\": \\\"set\\\", \\\"__current_case__\\\": 1, \\\"min_coverage\\\": \\\"20\\\", \\\"mismatch_base_quality_threshold\\\": \\\"10\\\", \\\"read_snp_limit\\\": \\\"\\\", \\\"quality_filter_type\\\": {\\\"min_supporting_allele_qsum\\\": \\\"0\\\", \\\"min_base_quality\\\": \\\"30\\\", \\\"min_mapping_quality\\\": \\\"30\\\", \\\"quality_filter_type_selector\\\": \\\"apply_filters\\\", \\\"__current_case__\\\": 1, \\\"min_supporting_mapping_qsum\\\": \\\"0\\\"}, \\\"read_max_mismatch_fraction\\\": \\\"1.0\\\", \\\"min_alternate_fraction\\\": \\\"0.75\\\", \\\"read_indel_limit\\\": \\\"\\\", \\\"use_duplicate_reads\\\": \\\"False\\\", \\\"min_alternate_total\\\": \\\"1\\\", \\\"read_mismatch_limit\\\": \\\"\\\", \\\"indel_exclusion_window\\\": \\\"-1\\\", \\\"min_alternate_qsum\\\": \\\"0\\\"}, \\\"__current_case__\\\": 1, \\\"section_population_model_type\\\": {\\\"section_population_model_type_selector\\\": \\\"set\\\", \\\"pooled_continuous\\\": \\\"False\\\", \\\"pooled_discrete\\\": \\\"False\\\", \\\"__current_case__\\\": 1, \\\"theta\\\": \\\"0.001\\\", \\\"ploidy\\\": \\\"1\\\"}, \\\"use_reference_allele_type\\\": {\\\"use_reference_allele_type_selector\\\": \\\"do_not_include_reference_allele\\\", \\\"__current_case__\\\": 0}, \\\"output_failed_alleles_option\\\": \\\"False\\\", \\\"target_limit_type\\\": {\\\"target_limit_type_selector\\\": \\\"do_not_limit\\\", \\\"__current_case__\\\": 0}, \\\"input_cnv_map_bed\\\": null, \\\"input_sample_file\\\": null}\", \"__page__\": 0}",
"tool_version": "0.0.4",
"type": "tool",
......@@ -312,7 +312,7 @@
},
"post_job_actions": {},
"tool_errors": null,
"tool_id": "galaxy-toolshed-dev.corefacility.ca/repos/phil/core_pipeline/filtervcf/0.0.1",
"tool_id": "[% LOCAL_REPOSITORY %]/core_pipeline/filtervcf/0.0.1",
"tool_state": "{\"__page__\": 0, \"__rerun_remap_job_id__\": null, \"vcf\": \"null\"}",
"tool_version": "0.0.1",
"type": "tool",
......@@ -322,7 +322,7 @@
"annotation": "",
"id": 10,
"input_connections": {
"freebayes_collection": {
"[% LOCAL_REPOSITORY %]/freebayes_collection": {
"id": 9,
"output_name": "vcfout"
},
......@@ -372,8 +372,8 @@
}
},
"tool_errors": null,
"tool_id": "galaxy-toolshed-dev.corefacility.ca/repos/phil/core_pipeline/vcf2pseudoalignment/0.0.9",
"tool_state": "{\"ambiguous\": \"\\\"False\\\"\", \"reference\": \"\\\"Reference\\\"\", \"__page__\": 0, \"__rerun_remap_job_id__\": null, \"invalid\": \"null\", \"coverage\": \"\\\"20\\\"\", \"freebayes_collection\": \"null\", \"numcpus\": \"\\\"32\\\"\", \"mpileup_collection\": \"null\"}",
"tool_id": "[% LOCAL_REPOSITORY %]/core_pipeline/vcf2pseudoalignment/0.0.9",
"tool_state": "{\"ambiguous\": \"\\\"False\\\"\", \"reference\": \"\\\"Reference\\\"\", \"__page__\": 0, \"__rerun_remap_job_id__\": null, \"invalid\": \"null\", \"coverage\": \"\\\"20\\\"\", \"[% LOCAL_REPOSITORY %]/freebayes_collection\": \"null\", \"numcpus\": \"\\\"32\\\"\", \"mpileup_collection\": \"null\"}",
"tool_version": "0.0.9",
"type": "tool",
"user_outputs": []
......@@ -413,7 +413,7 @@
}
},
"tool_errors": null,
"tool_id": "galaxy-shed.corefacility.ca/repos/phil/phyml/phyml1/3.1",
"tool_id": "[% LOCAL_REPOSITORY %]/phyml1/3.1",
"tool_state": "{\"prop_invar\": \"\\\"0.0\\\"\", \"search\": \"\\\"NNI\\\"\", \"__page__\": 0, \"gamma_condition\": \"{\\\"shape\\\": \\\"e\\\", \\\"categories\\\": \\\"4\\\", \\\"gamma\\\": \\\"yes\\\", \\\"__current_case__\\\": 0}\", \"support_condition\": \"{\\\"support\\\": \\\"sh\\\", \\\"__current_case__\\\": 0}\", \"random_condition\": \"{\\\"random\\\": \\\"no\\\", \\\"__current_case__\\\": 1}\", \"datatype_condition\": \"{\\\"tstv\\\": \\\"e\\\", \\\"model\\\": \\\"HKY85\\\", \\\"type\\\": \\\"nt\\\", \\\"__current_case__\\\": 0}\", \"input\": \"null\", \"__rerun_remap_job_id__\": null}",
"tool_version": "3.1",
"type": "tool",
......@@ -450,7 +450,7 @@
}
},
"tool_errors": null,
"tool_id": "galaxy-toolshed-dev.corefacility.ca/repos/phil/core_pipeline/snpmatrix/0.0.1",
"tool_id": "[% LOCAL_REPOSITORY %]/core_pipeline/snpmatrix/0.0.1",
"tool_state": "{\"__page__\": 0, \"phylip\": \"null\", \"__rerun_remap_job_id__\": null}",
"tool_version": "0.0.1",
"type": "tool",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment