Mercurial > repos > iuc > picrust2_pipeline
diff picrust2_pipeline.xml @ 0:540aedfc81c7 draft
planemo upload for repository https://github.com/picrust/picrust2 commit 972784d909912af20cd213fc56830fee79d83ca6
author | iuc |
---|---|
date | Sat, 04 Mar 2023 20:26:40 +0000 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/picrust2_pipeline.xml Sat Mar 04 20:26:40 2023 +0000 @@ -0,0 +1,379 @@ +<tool id="picrust2_pipeline" name="PICRUSt2 Full pipeline" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@"> + <description></description> + <macros> + <import>macros.xml</import> + </macros> + <expand macro="bio_tool"/> + <expand macro="requirements"/> + <version_command>picrust2_pipeline.py -v</version_command> + <command detect_errors="exit_code"><![CDATA[ +@VAR_ACCESS_FOO@ +@PLACE_SEQS_PREPROCESSING@ +@PREPARE_METAGENOME_PIPELINE_PARAMS@ + +picrust2_pipeline.py + ## place_seqs parameters + @PLACE_SEQS_PARAMS@ + + ## hsp parameters + @HSP_PARAMS@ + + ## metagenome_pipeline parameters + @METAGENOME_PIPELINE_PARAMS@ + + ## pathway_pipeline parameters + #if $predict_pathways.no_pathways == '' + @PATHWAY_PIPELINE_PARAMS@ + --reaction_func '$predict_pathways.reaction_map_file.reaction_func' + #end if + + #if $remove_intermediate is None + --remove_intermediate + #end if + + --output 'full_pipeline_output' + --processes "\${GALAXY_SLOTS:-1}" + ## unzip all (potential) output files + && + find full_pipeline_output -name "*.gz" -exec gunzip {} \; + ## rename all tsv files to tabular to simplify discovery + && + find full_pipeline_output -name "*.tsv" -exec sh -c 'mv {} \$(dirname {})/\$(basename {} .tsv).tabular' \; + ## flatten metagenome output dirs ro simplify/enable discovery + && + for d in full_pipeline_output/*_metagenome_out; do + D=\$(basename \$d); + for i in \$d/*; do + I=\$(basename \$i); + mv "\$i" "full_pipeline_output/""\$D""_""\$I"; + done; + done; + ]]></command> + <inputs> + <!-- place_seqs parameters --> + <section name="place_seqs_section" title="Sequence placement options" expanded="true"> + <expand macro="place_seqs_params"/> + </section> + + <!-- hsp parameters --> + <section name="hsp_section" title="Hidden state prediction (HSP) options" expanded="true"> + <expand macro="hsp_params" nsti_falsevalue="--skip_nsti" nsti_checked="true" in_trait_arg="--in_traits" in_trait_multiple="true" in_trait_label_suff="(s)" in_traits_help="Note that EC numbers will always be predicted unless --no_pathways is set"> + <token name="custom_traits"> + <!-- both go separately into hsp observed_trait_table --> + <param argument="--custom_trait_tables" type="data" multiple="true" format="tabular" label="Customized trait table(s)" help="with gene families as columns and genomes as rows"/> + <!-- by default 16S is used also goes into observed_trait_table --> + <param argument="--marker_gene_table" type="data" format="tabular" optional="true" label="Table of predicted marker gene (16S or other) copy numbers" /> + </token> + </expand> + </section> + + <!-- metagenome_pipeline parameters --> + <section name="metagenome_pipeline_section" title="Metagenome prediction options" expanded="true"> + <expand macro="metagenome_pipeline_params" stratified_arg="--stratified"/> + </section> + + <!-- pathway_pipeline parameters --> + <conditional name="predict_pathways"> + <param argument="--no_pathways" type="select" truevalue="" falsevalue="--no_pathways" checked="true" label="Infer pathways"> + <option value="">Yes</option> + <option value="--no_pathways">No</option> + </param> + <when value=""> + <expand macro="pathway_pipeline_params" mapargument="--pathway_map"/> + <conditional name="reaction_map_file"> + <param name="selector" type="select" label="Functional database to use as reactions for inferring pathway abundances"> + <option value="default" selected="true">Default functional database</option> + <option value="custom">Customized reation functional map file</option> + </param> + <when value="default"> + <param argument="--reaction_func" type="select" label="Default functional database"> + <option value="COG">Clusters of Orthologous Genes database (COG)</option> + <option value="EC" selected="true">Enzyme Commission number database (EC number)</option> + <option value="KO">KEGG Orthology database (KO)</option> + <option value="PFAM">Pfam database</option> + <option value="TIGRFAM">TIGRFAM database</option> + </param> + </when> + <when value="custom"> + <param argument="--reaction_func" type="data" format="tabular" label="Custom mapping table" help="An input 2 column map table linking function ids to descriptions for each function"/> + </when> + </conditional> + </when> + <when value="--no_pathways"/> + </conditional> + <param argument="--remove_intermediate" type="select" multiple="true" optional="true" label="Keep intermediate files of"> + <option value="place_seqs">place_seqs</option> + <option value="pathways">pathways_pipeline</option> + </param> + </inputs> + <outputs> + <!-- place seqs outputs --> + <expand macro="place_seqs_output" from_work_dir="full_pipeline_output/" label_suffix="(place_seqs)"> + <filter>remove_intermediate and "place_seqs" in remove_intermediate</filter> + </expand> + + <!-- hsp output --> + <collection name="hsp_output" type="list" label="${tool.name} on ${on_string}: predicted copy numbers" > + <discover_datasets pattern="(?P<designation>.+)_predicted\.tabular" directory="full_pipeline_output/" format="tabular"/> + </collection> + + <!-- metagenome output --> + <collection name="metagenome_output" type="list:list" label="${tool.name} on ${on_string}: metagenome output" > + <discover_datasets pattern="(?P<identifier_0>.+)_metagenome_out_(?P<identifier_1>.+)\.tabular" directory="full_pipeline_output/" format="tabular"/> + </collection> + + <!-- pathways output --> + <expand macro="pathways_output" from_work_dir="full_pipeline_output/" label_suffix="pathways"> + <filter>predict_pathways["no_pathways"] == ""</filter> + <token name="intermediate_filter"> + <filter>remove_intermediate and "pathways" in remove_intermediate</filter> + </token> + <token name="coverage_filter"> + <filter>predict_pathways["coverage"]</filter> + </token> + <token name="per_sequence_filter"> + <filter>predict_pathways["strat_output"]["per_sequence_contrib"]</filter> + </token> + </expand> + </outputs> + <tests> + <test expect_num_outputs="5"> + <!-- place_seq --> + <param name="study_fasta" value="study_seqs_full.fasta"/> + <param name="placement_tool" value="sepp"/> + <param name="min_align" value="0.0"/> + <!-- hsp --> + <conditional name="trait_input"> + <param name="selector" value="default"/> + <param name="in_traits" value="EC,COG"/> + </conditional> + <param name="skip_nsti" value="false"/> + <!-- metagenome --> + <param name="input" value="workflow_seq_abun.biom"/> + <conditional name="input_options"> + <param name="selector" value="ASV"/> + <param name="min_reads" value="1"/> + <param name="min_samples" value="1"/> + </conditional> + <param name="max_nsti" value="2.0"/> + <param name="skip_norm" value="false"/> + <!-- pathway --> + <param name="skip_minpath" value="false"/> + <param name="no_gap_fill" value="true"/> + + <param name="remove_intermediate" value="place_seqs"/> + <output name="out_tree" ftype="newick"> + <assert_contents> + <has_text text="643348582"/> + <has_n_lines n="1"/> + </assert_contents> + </output> + <output_collection name="place_seqs_intermediate_output" type="list" count="2"> + <element name="query_align" ftype="stockholm"> + <assert_contents> + <has_text text="STOCKHOLM 1.0"/> + <has_n_lines n="160106"/> + </assert_contents> + </element> + <element name="study_seqs_filtered" ftype="fasta"> + <assert_contents> + <has_text text="02905cfb87861c837dde629596d9272b"/> + <has_n_lines n="10"/> + </assert_contents> + </element> + </output_collection> + <output_collection name="hsp_output" type="list" count="3"> + <element name="COG"> + <assert_contents> + <has_text text="COG0001"/> + <has_n_lines n="6"/> + </assert_contents> + </element> + <element name="EC"> + <assert_contents> + <has_text text="EC:1.1.1.1"/> + <has_n_lines n="6"/> + </assert_contents> + </element> + <element name="marker"> + <assert_contents> + <has_text text="16S_rRNA_Count"/> + <has_n_lines n="6"/> + </assert_contents> + </element> + </output_collection> + <output_collection name="metagenome_output" type="list:list" count="2"> + <element name="COG"> + <element name="pred_metagenome_unstrat"> + <assert_contents> + <has_text text="function"/> + <has_n_lines n="1793"/> + </assert_contents> + </element> + <element name="seqtab_norm"> + <assert_contents> + <has_text text="normalized"/> + <has_n_lines n="6"/> + </assert_contents> + </element> + </element> + <element name="EC"> + <element name="pred_metagenome_unstrat"> + <assert_contents> + <has_text text="function"/> + <has_n_lines n="768"/> + </assert_contents> + </element> + <element name="seqtab_norm"> + <assert_contents> + <has_text text="normalized"/> + <has_n_lines n="6"/> + </assert_contents> + </element> + </element> + </output_collection> + <output name="pathways_output" ftype="tabular"> + <assert_contents> + <has_text text="pathway"/> + <has_n_lines n="149"/> + <has_n_columns n="3"/> + </assert_contents> + </output> + </test> + <!-- same as test 1, but only COG as in_traits (which has the same result since EC is added automatically), and test the other intermediate result --> + <test expect_num_outputs="5"> + <!-- place_seq --> + <param name="study_fasta" value="study_seqs_full.fasta"/> + <param name="placement_tool" value="sepp"/> + <param name="min_align" value="0.0"/> + <!-- hsp --> + <conditional name="trait_input"> + <param name="selector" value="default"/> + <param name="in_traits" value="COG"/> + </conditional> + <param name="skip_nsti" value="false"/> + <!-- metagenome --> + <param name="input" value="workflow_seq_abun.biom"/> + <conditional name="input_options"> + <param name="selector" value="ASV"/> + <param name="min_reads" value="1"/> + <param name="min_samples" value="1"/> + </conditional> + <param name="max_nsti" value="2.0"/> + <param name="skip_norm" value="false"/> + <!-- pathway --> + <param name="skip_minpath" value="false"/> + <param name="no_gap_fill" value="true"/> + + <param name="remove_intermediate" value="pathways"/> + <output name="out_tree" ftype="newick"> + <assert_contents> + <has_text text="643348582"/> + <has_n_lines n="1"/> + </assert_contents> + </output> + <output_collection name="hsp_output" type="list" count="3"> + <element name="COG" ftype="tabular"> + <assert_contents> + <has_text text="COG0001"/> + <has_n_lines n="6"/> + <has_n_columns n="4599"/> + </assert_contents> + </element> + <element name="EC" ftype="tabular"> + <assert_contents> + <has_text text="EC:1.1.1.1"/> + <has_n_lines n="6"/> + <has_n_columns n="2914"/> + </assert_contents> + </element> + <element name="marker" ftype="tabular"> + <assert_contents> + <has_text text="16S_rRNA_Count"/> + <has_n_lines n="6"/> + <has_n_columns n="2"/> + </assert_contents> + </element> + </output_collection> + + <output_collection name="metagenome_output" type="list:list" count="2"> + <element name="COG"> + <element name="pred_metagenome_unstrat" ftype="tabular"> + <assert_contents> + <has_text text="function"/> + <has_n_lines n="1793"/> + <has_n_columns n="3"/> + </assert_contents> + </element> + <element name="seqtab_norm" ftype="tabular"> + <assert_contents> + <has_text text="normalized"/> + <has_n_lines n="6"/> + <has_n_columns n="3"/> + </assert_contents> + </element> + </element> + <element name="EC"> + <element name="pred_metagenome_unstrat" ftype="tabular"> + <assert_contents> + <has_text text="function"/> + <has_n_lines n="768"/> + <has_n_columns n="3"/> + </assert_contents> + </element> + <element name="seqtab_norm" ftype="tabular"> + <assert_contents> + <has_text text="normalized"/> + <has_n_lines n="6"/> + <has_n_columns n="3"/> + </assert_contents> + </element> + </element> + </output_collection> + <output name="pathways_output" ftype="tabular"> + <assert_contents> + <has_text text="pathway"/> + <has_n_lines n="149"/> + <has_n_columns n="3"/> + </assert_contents> + </output> + <output_collection name="pathways_intermediate_output" type="list" count="1"> + <element name="regrouped_infile" ftype="tabular"> + <assert_contents> + <has_text text="function"/> + <has_n_lines n="1509"/> + <has_n_columns n="3"/> + </assert_contents> + </element> + </output_collection> + </test> + <!-- due to the long test times the other pathways_outputs + have been tested manually --> + </tests> + <help><![CDATA[ +@HELP_HEADER@ + +PICRUSt2 full pipeline +====================== +Run sequence placement with EPA-NG and GAPPA to place study sequences (i.e. OTUs and ASVs) into a reference tree. Then runs hidden-state prediction with the castor R package to predict genome for each study sequence. Metagenome profiles are then generated, which can be optionally stratified by the contributing sequence. Finally, pathway abundances are predicted based on metagenome profiles. By default, output files include predictions for Enzyme Commission (EC) numbers, KEGG Orthologs (KOs), and MetaCyc pathway abundances. However, the tool enables users to use custom reference and trait tables to customize analyses. + +Note +==== +The standard pipeline will generate metagenome predictions for 16S rRNA gene data. + +Input +===== +1. A FASTA of amplicon sequences variants (ASVs; i.e. your representative sequences, not your raw reads) +2. A BIOM table of the abundance of each ASV across each sample. + +Output +====== +1. Output tree with placed study sequences. +2. Metagenome Predictions +3. Pathway level predictions + + ]]></help> + <citations> + <citation type="doi">10.1038/s41587-020-0548-6</citation> + </citations> +</tool> \ No newline at end of file