view plotly_ml_performance_plots.xml @ 4:f234e2e59d76 draft default tip

planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_ml_performance_plots commit daa111fcd8391d451aab39110251864fd120edf0
author bgruening
date Wed, 07 Aug 2024 10:20:17 +0000
parents 1c5dcef5ce0f
children
line wrap: on
line source

<tool id="plotly_ml_performance_plots" name="Plot confusion matrix, precision, recall and ROC and AUC curves" version="0.4" profile="22.05">
    <description>of tabular data</description>
    <requirements>
	<requirement type="package" version="0.10.0">galaxy-ml</requirement>
    </requirements>
    <version_command>echo $version</version_command>
    <command detect_errors="aggressive"><![CDATA[
    python '$__tool_directory__/plot_ml_performance.py'
        -i '$infile_input'
        -j '$infile_output'
        -k '$infile_trained_model'
]]>
    </command>
    <inputs>
        <param name="infile_input" type="data" format="tabular" label="Select input data file :" help="Input data is a matrix (tabular) where each column is a feature and the last column contains the (true or original) class labels."/>
        <param name="infile_output" type="data" format="tabular" label="Select predicted data file :" help="Predicted data is a matrix (tabular) where each column is a feature and the last column contains the predicted class labels."/>
        <param name="infile_trained_model" type="data" format="h5mlm" label="Select trained model :" help="This file is a final model trained on training data."/>
    </inputs>

    <outputs>
        <data name="output_confusion" format="png" from_work_dir="output_confusion.png" label="Confusion matrix of tabular data on ${on_string}"/>
        <data name="output_prf" format="html" from_work_dir="output_prf.html" label="Precision, recall and f-score of tabular data on ${on_string}"/>
        <data name="output_roc" format="html" from_work_dir="output_roc.html" label="ROC and AUC curves of tabular data on ${on_string}"/>
    </outputs>
    
    <tests>
        <test>
            <param name="infile_input" value="binary_test_label.tabular" ftype="tabular"/>
            <param name="infile_output" value="binary_prediction_sgd.tabular" ftype="tabular"/>
            <param name="infile_trained_model" value="model_binary_sgd.h5mlm" ftype="h5mlm"/>
	    <output name="output_confusion">
                <assert_contents>
		    <has_size value="31751" delta="1000" />
		</assert_contents>
            </output>
	    <output name="output_prf">
		<assert_contents>
		    <has_size value="3486974" delta="10000" />
		    <has_text text="html" />
		</assert_contents>
	    </output>
        </test>
        <test>
            <param name="infile_input" value="binary_test_label.tabular" ftype="tabular"/>
            <param name="infile_output" value="prediction_binary_linearsvm.tabular" ftype="tabular"/>
            <param name="infile_trained_model" value="model_binary_linearsvm.h5mlm" ftype="h5mlm"/>
	    <output name="output_confusion">
	        <assert_contents>
		    <has_size value="31983" delta="1000" />
                </assert_contents>
	    </output>
            <output name="output_prf">
		<assert_contents>
		    <has_size value="3486973" delta="10000" />
		    <has_text text="html" />
	        </assert_contents>
	    </output>
	    <output name="output_roc">
		<assert_contents>
                    <has_size value="3497518" delta="10000" />
		    <has_text text="html" />
		</assert_contents>
	    </output>
        </test>
        <test>
            <param name="infile_input" value="binary_test_label.tabular" ftype="tabular"/>
            <param name="infile_output" value="prediction_binary_rfc.tabular" ftype="tabular"/>
            <param name="infile_trained_model" value="model_binary_rfc.h5mlm" ftype="h5mlm"/>
            <output name="output_confusion">
	        <assert_contents>
		    <has_size value="34096" delta="1000" />
                </assert_contents>
	    </output>
            <output name="output_prf">
	        <assert_contents>
		    <has_size value="3486883" delta="10000" />
		    <has_text text="html" />
	        </assert_contents>
	    </output>
	    <output name="output_roc">
		<assert_contents>
                    <has_size value="3488335" delta="10000" />
		    <has_text text="html" />
	        </assert_contents>
	    </output>
        </test>
        <test>
            <param name="infile_input" value="binary_test_label_knn.tabular" ftype="tabular"/>
            <param name="infile_output" value="prediction_binary_knn.tabular" ftype="tabular"/>
            <param name="infile_trained_model" value="model_binary_knn.h5mlm" ftype="h5mlm"/>
            <output name="output_confusion">
	        <assert_contents>
		    <has_size value="32398" delta="1000" />
                </assert_contents>
	    </output>
            <output name="output_prf">
	        <assert_contents>
		    <has_size value="3486928" delta="10000" />
		    <has_text text="html" />
	        </assert_contents>
	    </output>
	    <output name="output_roc">
		<assert_contents>
                    <has_size value="3487215" delta="10000" />
		    <has_text text="html" />
		</assert_contents>
	    </output>
        </test>
        <test>
            <param name="infile_input" value="multi_test_label.tabular" ftype="tabular"/>
            <param name="infile_output" value="prediction_multi_lr.tabular" ftype="tabular"/>
            <param name="infile_trained_model" value="model_multi_lr.h5mlm" ftype="h5mlm"/>
            <output name="output_confusion">
	        <assert_contents>
		    <has_size value="34474" delta="1000" />
                </assert_contents>
	    </output>
            <output name="output_prf">
		<assert_contents>
		    <has_size value="3487035" delta="10000" />
		    <has_text text="html" />
	        </assert_contents>
	    </output>
	    <output name="output_roc">
	        <assert_contents>
                    <has_size value="3493184" delta="10000" />
		    <has_text text="html" />
		</assert_contents>
	    </output>
	</test>
    </tests>
    <help><![CDATA[
**What it does**


Produce a `heatmap plot (confusion matrix) <https://plot.ly/python/heatmaps/>`_ from tabular files. The input data contains the original/true class labels (last column) and the predicted data contains the predicted class labels (last column). The true and predicted class labels are plotted against each other. The diagonal of this heatmap shows the correctly predicted data. The plot is buried in a html file which
provides rich interactive features. Image can be saved in various format, such as 'png', 'svg', 'jpeg' and so on.


    ]]>
    </help>
    <citations>
        <citation type="doi">10.1371/journal.pcbi.1009014</citation>
    </citations>
</tool>