changeset 5:88045b4d5597 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/hamronization commit b49fc153425676a82e77dec090676403112bcbe6
author iuc
date Tue, 05 Mar 2024 19:47:21 +0000
parents f8bcc852f6b3
children
files hamronize_summarize.xml macros.xml test-data/mykrobe/mykrobe.json
diffstat 3 files changed, 354 insertions(+), 60 deletions(-) [+]
line wrap: on
line diff
--- a/hamronize_summarize.xml	Fri Feb 09 21:27:25 2024 +0000
+++ b/hamronize_summarize.xml	Tue Mar 05 19:47:21 2024 +0000
@@ -1,5 +1,5 @@
-<tool id="hamronize_summarize" name="hamronize: summarize" version="@TOOL_VERSION@+galaxy2" profile="@PROFILE@">
-    <description> harmorization reports</description>
+<tool id="hamronize_summarize" name="hamronize summarize:" version="@TOOL_VERSION@+galaxy0" profile="@PROFILE@">
+    <description>Concatenate and summarize AMR detection reports</description>
     <macros>
         <import>macros.xml</import>
     </macros>
@@ -7,45 +7,35 @@
     <expand macro="requirements" />
     <expand macro="version_command" />
     <command detect_errors="exit_code"><![CDATA[
-        #for $counter, $report in enumerate($reports):
-            #if $report.is_of_type('tsv', 'tabular'):
-                #set $ext = 'tsv'
-            #elif $report.is_of_type('json'):
-                #set $ext = 'json'
-            #end if
-            ln -s '$report' ./report_${counter}.${ext} &&
-        #end for
+#for $counter, $report in enumerate($reports):
+    #if $report.is_of_type('tsv', 'tabular'):
+        #set $ext = 'tsv'
+    #elif $report.is_of_type('json'):
+        #set $ext = 'json'
+    #end if
+    ln -s '$report' 'report_${counter}.${ext}' &&
+#end for
 
-        hamronize summarize
-        --summary_type $summary_type
-        #if $summary_type == "tsv"
-            --output output.tsv
-        #elif $summary_type == "json"
-            --output output.json
-        #else
-             --output output.html
-        #end if
-        ./report_*
-    ]]>    </command>
-
+hamronize 
+    summarize
+    --summary_type '$summary_type'
+    --output '$output'
+    report_*
+]]></command>
     <inputs>
         <param name="reports" type="data" multiple="true" format="tabular,json" label="Report files"/>
-        <param name="summary_type" type="select" label="Output format" multiple="false">
-            <option value="tsv">tsv</option>
-            <option value="json">json</option>
-            <option value="interactive">interactive</option>
+        <param argument="--summary_type" type="select" label="Output format" multiple="false">
+            <option value="tsv">Tabular</option>
+            <option value="json">JSON</option>
+            <option value="interactive">Interactive HTML</option>
         </param>
     </inputs>
-
     <outputs>
-        <data format="tabular" name="output_tsv" label="${tool.name} on ${on_string}: Table" from_work_dir="output.tsv">
-            <filter>summary_type == "tsv"</filter>
-        </data>
-        <data format="json" name="output_json" label="${tool.name} on ${on_string}: JSON" from_work_dir="output.json">
-            <filter>summary_type == "json"</filter>
-        </data>
-        <data format="html" name="output_html" label="${tool.name} on ${on_string}: Interactive" from_work_dir="output.html">
-            <filter>summary_type == "interactive"</filter>
+        <data name="output" format="tabular" label="${tool.name} on ${on_string}: Concatenated and summarized reports" from_work_dir="output.tsv">
+            <change_format>
+                <when input="summary_type" value="json" format="json"/>
+                <when input="summary_type" value="interactive" format="html"/>
+            </change_format>
         </data>
     </outputs>
     <tests>
@@ -53,30 +43,49 @@
         <test expect_num_outputs="1">
             <param name="reports" value="hamronized_abricate.tsv,hamronized_abricate.json,hamronized_ariba.tsv,hamronized_ariba.json,hamronized_rgi.tsv,hamronized_rgi.json" />
             <param name="summary_type" value="tsv" />
-            <output name="output_tsv" ftype="tabular" file="summary.tsv" />
+            <output name="output" ftype="tabular">
+                <assert_contents>
+                    <has_n_lines n="155"/>
+                    <has_n_columns n="37"/>
+                    <has_text text="GCF_010120755.1_ASM1012075v1_genomic" />
+                    <has_text text="ariba_report" />
+                    <has_text text="rgi_report" />
+                </assert_contents>
+            </output>
         </test>
         <!-- json output -->
         <test expect_num_outputs="1">
             <param name="reports" value="hamronized_abricate.tsv,hamronized_abricate.json,hamronized_ariba.tsv,hamronized_ariba.json,hamronized_rgi.tsv,hamronized_rgi.json" />
             <param name="summary_type" value="json" />
-            <output name="output_json" ftype="json">
+            <output name="output" ftype="json">
                 <assert_contents>
                     <has_text text="GCF_010120755.1_ASM1012075v1_genomic" />
-                    <has_text text="H_NS.3000676.BA000007.3.1737690_1738104.5476" />
-                    <has_text text="NODE_9_length_203843_cov_42.4911_20" />
+                    <has_text text="ariba_report" />
+                    <has_text text="rgi_report" />
+                </assert_contents>
+            </output>
+        </test>
+        <!-- html output -->
+        <test expect_num_outputs="1">
+            <param name="reports" value="hamronized_abricate.tsv,hamronized_abricate.json,hamronized_ariba.tsv,hamronized_ariba.json,hamronized_rgi.tsv,hamronized_rgi.json" />
+            <param name="summary_type" value="interactive" />
+            <output name="output" ftype="html">
+                <assert_contents>
+                    <has_text text="GCF_010120755.1_ASM1012075v1_genomic" />
+                    <has_text text="ariba_report" />
+                    <has_text text="rgi_report" />
                 </assert_contents>
             </output>
         </test>
     </tests>
-    <help>
-        <![CDATA[
-            **What it does**
-            This tool will take a list of report and create single sorted report in the specified format
-            just containing the unique entries across input reports. It can handle mixed json and tsv hamronized report formats
-            **Inputs**
-            A list of hamronize reports
-            
-        ]]>
-    </help>
+    <help><![CDATA[
+**What it does**
+
+This tool will take a list of report and create single sorted report in the specified format
+just containing the unique entries across input reports. It can handle mixed json and tsv hamronized report formats
+
+**Inputs**
+A list of hamronize reports     
+    ]]></help>
     <expand macro="citations"/>
 </tool>
--- a/macros.xml	Fri Feb 09 21:27:25 2024 +0000
+++ b/macros.xml	Tue Mar 05 19:47:21 2024 +0000
@@ -1,6 +1,6 @@
 <macros>
-    <token name="@TOOL_VERSION@">1.0.3</token>
-    <token name="@PROFILE@">20.05</token>
+    <token name="@TOOL_VERSION@">1.1.4</token>
+    <token name="@PROFILE@">23.1</token>
     <xml name="bio_tools">
         <xrefs>
             <xref type="bio.tools">hamronization</xref>
@@ -11,20 +11,36 @@
             <requirement type="package" version="@TOOL_VERSION@">hamronization</requirement>
         </requirements>
     </xml>
-    <xml name="input_file_name">
-        <param name="input_file_name" type="text" label="Input file name" help="Sample name which was scanned with the tool"></param>
+    <xml name="version_command">
+        <version_command>hamronize --version</version_command>
+    </xml>
+    <xml name="report" token_format="tabular" token_label="Report" >
+        <param argument="report" type="data" format="@FORMAT@" label="@LABEL@"/>
     </xml>
-    <xml name="reference_database_id">
-        <param name="reference_database_id" type="text" label="Reference database ID" help="String containing the reference_database_id of this tool"></param>
+    <xml name="input_file_name">
+        <param argument="--input_file_name" type="text" label="Sample name" help="If not provided, the input dataset will be taken"/>
+    </xml>
+    <xml name="analysis_software_version" token_software="">
+        <param argument="--analysis_software_version" type="text" label="@SOFTWARE@ version"/>
     </xml>
     <xml name="reference_database_version">
-        <param name="reference_database_version" type="text" label="Reference database version"></param>
+        <param name="reference_database_version" type="text" label="Reference database version"/>
     </xml>
-    <xml name="analysis_software_version">
-        <param name="analysis_software_version" type="text" label="Analysis software version"></param>
+    <xml name="origin" token_software="">
+        <conditional name="origin">
+            <param name="origin" type="select" label="Input generated within Galaxy on this server without leaving it?">
+                <option value="true" selected="true">Yes</option>
+                <option value="false">No</option>
+            </param>
+            <when value="true"/>
+            <when value="false">
+                <expand macro="analysis_software_version" software="@SOFTWARE@" />
+            </when>
+        </conditional>
+        <expand macro="reference_database_version"/>   
     </xml>
-    <xml name="version_command">
-        <version_command>hamronize --version</version_command>
+    <xml name="reference_database_name" token_software="">
+        <param name="reference_database_name" type="text" label="Reference database name for @SOFTWARE@"/>
     </xml>
     <xml name="citations">
         <citations>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/mykrobe/mykrobe.json	Tue Mar 05 19:47:21 2024 +0000
@@ -0,0 +1,269 @@
+{
+    "SRR6916544": {
+        "susceptibility": {
+            "Rifampicin": {
+                "predict": "r",
+                "called_by": {
+                    "rpoB_S450L-TCG761154TTG": {
+                        "variant": null,
+                        "genotype": [
+                            0,
+                            1
+                        ],
+                        "genotype_likelihoods": [
+                            -3594.140082249598,
+                            -136.57739012799902,
+                            -2127.6812715680494
+                        ],
+                        "info": {
+                            "coverage": {
+                                "reference": {
+                                    "percent_coverage": 100.0,
+                                    "median_depth": 40,
+                                    "min_non_zero_depth": 32,
+                                    "kmer_count": 796,
+                                    "klen": 21
+                                },
+                                "alternate": {
+                                    "percent_coverage": 100.0,
+                                    "median_depth": 60,
+                                    "min_non_zero_depth": 58,
+                                    "kmer_count": 1150,
+                                    "klen": 20
+                                }
+                            },
+                            "expected_depths": [
+                                124
+                            ],
+                            "contamination_depths": [],
+                            "filter": [],
+                            "conf": 3458
+                        },
+                        "_cls": "Call.VariantCall"
+                    }
+                }
+            }
+        },
+        "phylogenetics": {
+            "phylo_group": {
+                "Mycobacterium_tuberculosis_complex": {
+                    "percent_coverage": 99.681,
+                    "median_depth": 124
+                }
+            },
+            "sub_complex": {
+                "Unknown": {
+                    "percent_coverage": -1,
+                    "median_depth": -1
+                }
+            },
+            "species": {
+                "Mycobacterium_tuberculosis": {
+                    "percent_coverage": 98.804,
+                    "median_depth": 121
+                }
+            },
+            "lineage": {
+                "lineage": [
+                    "lineage2.2.10",
+                    "lineage3"
+                ],
+                "calls_summary": {
+                    "lineage2.2.10": {
+                        "good_nodes": 3,
+                        "tree_depth": 3,
+                        "genotypes": {
+                            "lineage2": 0.5,
+                            "lineage2.2": 0.5,
+                            "lineage2.2.10": 0.5
+                        }
+                    },
+                    "lineage3": {
+                        "good_nodes": 1,
+                        "tree_depth": 1,
+                        "genotypes": {
+                            "lineage3": 0.5
+                        }
+                    }
+                },
+                "calls": {
+                    "lineage2.2.10": {
+                        "lineage2": {
+                            "G497491A": {
+                                "variant": "ref-G497491A?var_name=G497491A&num_alts=1&ref=NC_000962.3&enum=0&gene=NA&mut=G497491A",
+                                "genotype": [
+                                    0,
+                                    1
+                                ],
+                                "genotype_likelihoods": [
+                                    -4852.294042193726,
+                                    -68.00214340670391,
+                                    -4045.7527933854217
+                                ],
+                                "info": {
+                                    "coverage": {
+                                        "reference": {
+                                            "percent_coverage": 100.0,
+                                            "median_depth": 76,
+                                            "min_non_zero_depth": 70,
+                                            "kmer_count": 1498,
+                                            "klen": 21
+                                        },
+                                        "alternate": {
+                                            "percent_coverage": 100.0,
+                                            "median_depth": 85,
+                                            "min_non_zero_depth": 82,
+                                            "kmer_count": 1695,
+                                            "klen": 21
+                                        }
+                                    },
+                                    "expected_depths": [
+                                        124
+                                    ],
+                                    "contamination_depths": [],
+                                    "filter": [],
+                                    "conf": 4784
+                                },
+                                "_cls": "Call.VariantCall"
+                            }
+                        },
+                        "lineage2.2": {
+                            "G2505085A": {
+                                "variant": "ref-G2505085A?var_name=G2505085A&num_alts=2&ref=NC_000962.3&enum=0&gene=NA&mut=G2505085A",
+                                "genotype": [
+                                    0,
+                                    1
+                                ],
+                                "genotype_likelihoods": [
+                                    -3967.5854789566783,
+                                    -20.859193826341652,
+                                    -3054.5971617777313
+                                ],
+                                "info": {
+                                    "coverage": {
+                                        "reference": {
+                                            "percent_coverage": 100.0,
+                                            "median_depth": 58,
+                                            "min_non_zero_depth": 56,
+                                            "kmer_count": 1160,
+                                            "klen": 21
+                                        },
+                                        "alternate": {
+                                            "percent_coverage": 100.0,
+                                            "median_depth": 69,
+                                            "min_non_zero_depth": 64,
+                                            "kmer_count": 1383,
+                                            "klen": 21
+                                        }
+                                    },
+                                    "expected_depths": [
+                                        124
+                                    ],
+                                    "contamination_depths": [],
+                                    "filter": [],
+                                    "conf": 3947
+                                },
+                                "_cls": "Call.VariantCall"
+                            }
+                        },
+                        "lineage2.2.10": {
+                            "G1364706A": {
+                                "variant": "ref-G1364706A?var_name=G1364706A&num_alts=2&ref=NC_000962.3&enum=0&gene=NA&mut=G1364706A",
+                                "genotype": [
+                                    0,
+                                    1
+                                ],
+                                "genotype_likelihoods": [
+                                    -2360.5217287767423,
+                                    -145.4041778818164,
+                                    -3052.427673185898
+                                ],
+                                "info": {
+                                    "coverage": {
+                                        "reference": {
+                                            "percent_coverage": 100.0,
+                                            "median_depth": 51,
+                                            "min_non_zero_depth": 47,
+                                            "kmer_count": 1017,
+                                            "klen": 21
+                                        },
+                                        "alternate": {
+                                            "percent_coverage": 100.0,
+                                            "median_depth": 42,
+                                            "min_non_zero_depth": 42,
+                                            "kmer_count": 848,
+                                            "klen": 21
+                                        }
+                                    },
+                                    "expected_depths": [
+                                        124
+                                    ],
+                                    "contamination_depths": [],
+                                    "filter": [],
+                                    "conf": 2215
+                                },
+                                "_cls": "Call.VariantCall"
+                            }
+                        }
+                    },
+                    "lineage3": {
+                        "lineage3": {
+                            "C3273107A": {
+                                "variant": "ref-C3273107A?var_name=C3273107A&num_alts=1&ref=NC_000962.3&enum=0&gene=NA&mut=C3273107A",
+                                "genotype": [
+                                    0,
+                                    1
+                                ],
+                                "genotype_likelihoods": [
+                                    -3093.863597972382,
+                                    -19.52878016336399,
+                                    -3761.204834296007
+                                ],
+                                "info": {
+                                    "coverage": {
+                                        "reference": {
+                                            "percent_coverage": 100.0,
+                                            "median_depth": 66,
+                                            "min_non_zero_depth": 64,
+                                            "kmer_count": 1323,
+                                            "klen": 21
+                                        },
+                                        "alternate": {
+                                            "percent_coverage": 100.0,
+                                            "median_depth": 58,
+                                            "min_non_zero_depth": 54,
+                                            "kmer_count": 1160,
+                                            "klen": 21
+                                        }
+                                    },
+                                    "expected_depths": [
+                                        124
+                                    ],
+                                    "contamination_depths": [],
+                                    "filter": [],
+                                    "conf": 3074
+                                },
+                                "_cls": "Call.VariantCall"
+                            }
+                        }
+                    }
+                }
+            }
+        },
+        "kmer": 21,
+        "probe_sets": [
+            "/home/pvh/miniconda3/envs/mykrobe/lib/python3.9/site-packages/mykrobe/data/tb/tb-species-170421.fasta.gz",
+            "/home/pvh/miniconda3/envs/mykrobe/lib/python3.9/site-packages/mykrobe/data/tb/tb-hunt-probe-set-jan-03-2019.fasta.gz",
+            "/home/pvh/miniconda3/envs/mykrobe/lib/python3.9/site-packages/mykrobe/data/tb/tb.lineage.20200930.probes.fa.gz"
+        ],
+        "files": [
+            "../SRR6916544_1.fastq.gz",
+            "../SRR6916544_2.fastq.gz"
+        ],
+        "version": {
+            "mykrobe-predictor": "v0.10.0",
+            "mykrobe-atlas": "v0.10.0"
+        },
+        "genotype_model": "kmer_count"
+    }
+}
\ No newline at end of file