Mercurial > repos > greg > queue_genotype_workflow
changeset 6:b7212fe2d597 draft
Uploaded
author | greg |
---|---|
date | Mon, 02 Dec 2019 09:17:50 -0500 (2019-12-02) |
parents | 934acc64b30c |
children | fd38595afbf3 |
files | queue_genotype_workflow.py queue_genotype_workflow.xml |
diffstat | 2 files changed, 19 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/queue_genotype_workflow.py Tue Nov 26 08:46:09 2019 -0500 +++ b/queue_genotype_workflow.py Mon Dec 02 09:17:50 2019 -0500 @@ -22,6 +22,7 @@ parser.add_argument('--reference_genome', dest='reference_genome', help='Reference genome') parser.add_argument('--history_id', dest='history_id', help='Encoded id of current history') parser.add_argument('--output', dest='output', help='Output dataset') +parser.add_argument('--output_nj_phylogeny_tree', dest='output_nj_phylogeny_tree', help='Flag to plot neighbor-joining phylogeny tree') parser.add_argument('--report', dest='report', help='Apt-probeset genotype report file') parser.add_argument('--sample_attributes', dest='sample_attributes', help='Sample attributes tabular file') parser.add_argument('--snp-posteriors', dest='snp-posteriors', help='Apt-probeset genotype snp-posteriors file') @@ -233,7 +234,7 @@ return library_dataset_dict -def update_workflow_params(workflow_dict, dbkey, outputfh): +def update_workflow_params(workflow_dict, dbkey, output_nj_phylogeny_tree, outputfh): parameter_updates = None name = workflow_dict['name'] outputfh.write("\nChecking for tool parameter updates for workflow %s using dbkey %s.\n" % (name, dbkey)) @@ -257,9 +258,17 @@ workflow_db_key = reference_genome_source_cond_dict['locally_cached_item'] if dbkey != workflow_db_key: reference_genome_source_cond_dict['locally_cached_item'] = dbkey - parameter_updates = {} + if parameter_updates is None: + parameter_updates = {} parameter_updates[step_id] = reference_genome_source_cond_dict outputfh.write("Updated step id %s with the following entry:\n%s\n" % (step_id, str(reference_genome_source_cond_dict))) + if tool_id.find('coral_multilocus_genotype') > 0 and output_nj_phylogeny_tree == 'yes': + # Reset the default value 'no' of output_nj_phylogeny_tree to 'yes'. + if parameter_updates is None: + parameter_updates = {} + output_nj_phylogeny_tree_dict = {'output_nj_phylogeny_tree' : 'yes'} + parameter_updates[step_id] = output_nj_phylogeny_tree_dict + outputfh.write("Updated step id %s with the following entry:\n%s\n" % (step_id, str(output_nj_phylogeny_tree_dict))) return parameter_updates @@ -372,7 +381,7 @@ coralsnp_workflow_input_datasets = get_workflow_input_datasets(gi, history_datasets, coralsnp_workflow_name, coralsnp_workflow_dict, outputfh) outputfh.write("\nCoralSNP workflow input datasets: %s\n" % str(coralsnp_workflow_input_datasets)) # Get the CoralSNP workflow params that could be updated. - coralsnp_params = update_workflow_params(coralsnp_workflow_dict, args.dbkey, outputfh) + coralsnp_params = update_workflow_params(coralsnp_workflow_dict, args.dbkey, args.output_nj_phylogeny_tree, outputfh) outputfh.write("\nCoralSNP params: %s\n" % str(coralsnp_params)) # Start the CoralSNP workflow. start_workflow(gi, coralsnp_workflow_id, coralsnp_workflow_name, coralsnp_workflow_input_datasets, coralsnp_params, args.history_id, outputfh)
--- a/queue_genotype_workflow.xml Tue Nov 26 08:46:09 2019 -0500 +++ b/queue_genotype_workflow.xml Mon Dec 02 09:17:50 2019 -0500 @@ -16,6 +16,9 @@ --sample_attributes '$sample_attributes' --snp-posteriors '$snp_posteriors' --summary '$summary' +#if str($output_nj_phylogeny_tree) == "yes": + --output_nj_phylogeny_tree '$output_nj_phylogeny_tree' +#end if --output '$output']]></command> <configfiles> <configfile name="get_user_api_key"><![CDATA[#from galaxy.managers import api_keys#${api_keys.ApiKeyManager( $__app__ ).get_or_create_api_key($__user__)} ]]></configfile> @@ -40,6 +43,10 @@ <validator type="no_options" message="No cached Fasta genome references are available for the build associated with the selected probeset annotation file." /> </options> </param> + <param name="output_nj_phylogeny_tree" type="select" display="radio" label="Plot neighbor-joining phylogeny tree in Corals Multilocus Genotype outputs?" help="This may significantly extend the tool execution time"> + <option value="yes">Yes</option> + <option value="no" selected="true">No</option> + </param> </inputs> <outputs> <data name="output" label="${tool.name} execution log" format="txt" />