Repository 'deepmicro'
hg clone https://toolshed.g2.bx.psu.edu/repos/iuc/deepmicro

Changeset 0:77cbfe3e1b0d (2023-05-02)
Next changeset 1:c58c1a99578b (2023-06-10)
Commit message:
planemo upload for repository https://github.com/paulzierep/DeepMicro commit 1bbea291a9d77beafaeba83ab775d870ec24719e
added:
deepmicro.xml
macros.xml
static/images/ML_Workflow.png
test-data/UserDataExample.csv
test-data/UserLabelExample.csv
b
diff -r 000000000000 -r 77cbfe3e1b0d deepmicro.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/deepmicro.xml Tue May 02 17:39:13 2023 +0000
[
b'@@ -0,0 +1,289 @@\n+<tool id="deepmicro" name="DeepMicro" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">\n+    <description>\n+        Representation learning and classification framework\n+    </description>\n+    <macros>\n+        <import>macros.xml</import>\n+    </macros>\n+    <expand macro="biotools" />\n+    <expand macro="requirements" />\n+    <expand macro="version" />\n+    <command detect_errors="exit_code"><![CDATA[\n+        mkdir data &&\n+        mkdir results &&\n+        ln -s \'$features\' data/features.csv &&\n+\n+        #if $mode.mode_type == "only_encoding":\n+\n+            #for $params in $mode.parameter_set:\n+\n+                #if $params.rl_type.rl_type_choice == "--pca" or $params.rl_type.rl_type_choice == "--rp":\n+                    DM.py -r 1 -cd features.csv \'$params.rl_type.rl_type_choice\' --save_rep --no_clf -t \\${GALAXY_SLOTS:-8} &&\n+                #else: \n+                    DM.py -r 1 -cd features.csv \'$params.rl_type.rl_type_choice\' -dm \'$params.rl_type.dm\' --save_rep --no_clf -t \\${GALAXY_SLOTS:-8} &&\n+                #end if\n+            #end for\n+\n+        #else:\n+\n+            ln -s \'$mode.class_labels\' data/labels.csv &&\n+\n+            #for $params in $mode.parameter_set:\n+\n+                #if $params.rl_type.rl_type_choice == "--pca" or $params.rl_type.rl_type_choice == "--rp":\n+                    DM.py -r 1 -cd features.csv -cl labels.csv \'$params.rl_type.rl_type_choice\' --save_rep -m \'$params.rl_type.classifier\' -t \\${GALAXY_SLOTS:-8} &&\n+                #else: \n+                    DM.py -r 1 -cd features.csv -cl labels.csv \'$params.rl_type.rl_type_choice\' -dm \'$params.rl_type.dm\' --save_rep -m \'$params.rl_type.classifier\'  -t \\${GALAXY_SLOTS:-8} &&\n+                #end if\n+            #end for\n+\n+        #end if\n+\n+        echo Done !\n+        ]]>\n+    </command>\n+    <inputs>\n+        <param argument="--features" type="data" format="tabular" label="Feature table" help="Dataset containing the features of samples"/>\n+        <conditional name="mode">\n+            <param name="mode_type" type="select" label="Mode" help="The tool can either only create a latent \n+            representation of the data or create a latent representation of the data and cross validate a classifier using that encoding.">\n+                <option value="only_encoding">Create only encoding</option>\n+                <option value="e_and_c">Create encoding and cross validate a classifier</option>\n+            </param>\n+            <when value="only_encoding">\n+                <repeat name="parameter_set" title="Parameter Set">\n+                    <conditional name="rl_type">\n+                        <param name="rl_type_choice" type="select" label="Representation learning type" help="The type of representation learning" >\n+                            <option value="--pca">PCA</option>\n+                            <option value="--rp">Random Projection</option>\n+                            <option value="--ae">Autoencoder or Deep Autoencoder</option>\n+                            <option value="--vae">Variational Autoencoder</option>\n+                            <option value="--cae">Convolutional Autoencoder</option>\n+                        </param>\n+                        <when value="--pca"/>\n+                        <when value="--rp"/>\n+                        <when value="--ae">\n+                            <expand macro="dm" />                        \n+                        </when>\n+                        <when value="--vae">\n+                            <expand macro="dm" />                          \n+                        </when>\n+                        <when value="--cae">\n+                            <expand macro="dm" />  \n+                        </when>\n+                    </conditional>\n+                </repeat>\n+            </when>\n+            <when value="e_and_c">\n+                <param argument="--class_labels" type="data" format="tabular" label="Class labels" help="Da'..b'       </test>  \n+\n+        <!-- encoding and clf -->\n+        <!-- test one parameter set -->\n+\n+        <test expect_num_outputs="1">\n+            <param name="features" value="UserDataExample.csv" />\n+            <param name="mode_type" value="e_and_c" />\n+            <param name="class_labels" value="UserLabelExample.csv" />\n+            <param name="rl_type_choice" value="--vae" />\n+            <param name="dm" value="40" />\n+            <param name="classifier" value="rf" /> \n+            <output ftype="tabular" name="results" >\n+                <assert_contents>\n+                    <has_text text="VAE[40]_rf" />\n+                </assert_contents>\n+            </output>\n+\n+        </test>\n+\n+        <!-- test multiple parameter sets -->\n+        <test expect_num_outputs="1">\n+            <param name="features" value="UserDataExample.csv" />\n+            <conditional name="mode">\n+                <param name="mode_type" value="e_and_c" />\n+                <param name="class_labels" value="UserLabelExample.csv" />\n+\n+                <repeat name="parameter_set">\n+                    <conditional name="rl_type">\n+                        <param name="rl_type_choice" value="--cae" />\n+                        <param name="dm" value="20" />\n+                        <param name="classifier" value="rf" /> \n+                    </conditional>\n+                </repeat>\n+\n+                <repeat name="parameter_set">\n+                    <conditional name="rl_type">\n+                        <param name="rl_type_choice" value="--vae" />\n+                        <param name="dm" value="40" />\n+                        <param name="classifier" value="mlp" /> \n+                    </conditional>\n+                </repeat>\n+            \n+            </conditional>\n+            \n+            <output ftype="tabular" name="results" >\n+                <assert_contents>\n+                    <has_text text="CAE[20]_rf" />\n+                    <has_text text="VAE[40]_mlp" />\n+                </assert_contents>\n+            </output>\n+\n+        </test>  \n+\n+    </tests>\n+    <help>\n+        <![CDATA[\n+DeepMicro is a deep representation learning framework exploiting various autoencoders \n+to learn robust low-dimensional representations from high-dimensional data and training\n+classification models based on the learned representation.\n+\n+======================================\n+Option 1) Only representation learning\n+====================================== \n+\n+The representation learning does not require class labels and can be learned from the features alone. \n+The wrapper allows to explore multiple paramertes (i.e. different modes to\n+generate the features, please refer to the publication for details), for each \n+added parameter the encoded features are generated. Those features can then be passed to subsequent ML tools,\n+such as `Ensemble methods for classification and regression` or `Split Dataset into training and test subsets`\n+\n+=====================================================\n+Option 2)  Representation learning and classification\n+=====================================================\n+\n+The tool itself can also evaluate the performance of the generated representation learning for different\n+classifiers internally using 5 fold CV. The wrapper allows to explore multiple paramertes and clfs.\n+Each parameter run will be stored as a line to the result file. If this option is chosen the latent representation is not\n+exported as output. To create the latent representation of the complete feature set, run the tool again\n+with the same parameters using the `Only representation learning` option.\n+The header of the result file is: \n+\n+\'{Encoding}_{classifier}, AUC, ACC, Recall, Precision, F1_score, time-end, runtime(sec), classfication time(sec), best hyper-parameter\'\n+\n+The overall schema of the tool is shown in:\n+\n+.. image:: ML_Workflow.png\n+        ]]>\n+    </help>\n+    <expand macro="citations" />\n+    <expand macro="creator" />\n+</tool>\n'
b
diff -r 000000000000 -r 77cbfe3e1b0d macros.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/macros.xml Tue May 02 17:39:13 2023 +0000
[
@@ -0,0 +1,49 @@
+<?xml version="1.0"?>
+<macros>
+    <token name="@TOOL_VERSION@">1.4</token>
+    <token name="@VERSION_SUFFIX@">0</token>
+    <token name="@PROFILE@">22.05</token>
+    <xml name="biotools">
+        <xrefs>
+            <xref type="bio.tools">
+                DeepMicro
+            </xref>
+        </xrefs>
+    </xml>
+    <xml name="requirements">
+        <requirements>
+            <requirement type="package" version="@TOOL_VERSION@">deepmicro</requirement>
+        </requirements>
+    </xml>
+    <xml name="version">
+        <version_command><![CDATA[
+            echo "@TOOL_VERSION@"
+        ]]></version_command>
+    </xml>
+    <xml name="citations">
+        <citations>
+            <citation type="doi">
+                10.1038/s41598-020-63159-5
+            </citation>
+        </citations>
+    </xml>
+    <xml name="creator">
+    <creator>
+        <person givenName="Paul" familyName="Zierep" email="zierep@informatik.uni-freiburg.de" />
+    </creator>
+    </xml>
+    <xml name="dm">
+        <param name="dm" type="text" value="40" label="Dimensions for deep representation learning" help="Comma-separated dimensions for deep representation learning e.g. [50,30,20]">
+            <validator type="regex" message="Use only numbers and commas for this input">^(\d+|\,)+$</validator>
+        </param >
+
+    </xml>
+    <xml name="clfs">
+        <param name="classifier" type="select" label="Classifier for the cross validation" help="The classifier used for the cross validation (`all` will create a run for each classifier)">
+            <option value="svm">svm</option>
+            <option value="mlp">mlp</option>
+            <option value="rf">rf</option>
+            <option value="all">all</option>
+        </param>   
+    </xml>
+</macros>
b
diff -r 000000000000 -r 77cbfe3e1b0d static/images/ML_Workflow.png
b
Binary file static/images/ML_Workflow.png has changed
b
diff -r 000000000000 -r 77cbfe3e1b0d test-data/UserDataExample.csv
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/UserDataExample.csv Tue May 02 17:39:13 2023 +0000
b
b'@@ -0,0 +1,20 @@\n+0.98271949,0.180504862,0.468251089,0.172887822,0.047141066,0.773570078,0.521855365,0.269459902,0.382783875,0.05195432,0.633891129,0.588767099,0.062732329,0.172025014,0.047290928,0.93816431,0.574027662,0.252246951,0.116604341,0.93070614,0.564841007,0.269353778,0.43741597,0.132469184,0.661772035,0.409051377,0.729391595,0.962745526,0.280638962,0.981289236,0.810579548,0.807074742,0.953342465,0.083364037,0.482577559,0.440712374,0.469753906,0.652900049,0.343016499,0.743521611,0.827820774,0.283789271,0.610321283,0.660902402,0.429834553,0.246555527,0.454322492,0.778034507,0.159571492,0.244017608,0.628439416,0.514035013,0.85220075,0.025296563,0.497486172,0.438627079,0.661046758,0.941931323,0.232908738,0.328427969,0.309735366,0.220323351,0.091066235,0.324294641,0.675011899,0.723486697,0.738660307,0.073766873,0.094992369,0.569909189,0.642011092,0.124958906,0.570058038,0.527716016,0.845358445,0.257469817,0.042496921,0.975034298,0.379089552,0.598015165,0.135676086,0.642679985,0.23924652,0.495082434,0.081861311,0.450497528,0.884466529,0.726811456,0.463781552,0.872327572,0.388819232,0.492966843,0.64422976,0.287075275,0.446575902,0.211652638,0.140924,0.523014546,0.962735863,0.502031574,0.661568648,0.997272932,0.521078856,0.092934076,0.441391078,0.029077833,0.498146692,0.551656879,0.073767502,0.329736599,0.298923535,0.169702377,0.65728464,0.195527924,0.297564746,0.646286516,0.257509664,0.567360486,0.416796542,0.039959772,0.986346733,0.721171867,0.427282734,0.534262516,0.664410591,0.45547518,0.66618104,0.930728624,0.389611052,0.930044038,0.847387677,0.112836888,0.007533859,0.42134867,0.43167832,0.464647974,0.138311687,0.705462625,0.729764136,0.431665714,0.964270617,0.807757233,0.150859721,0.967570925,0.594236182,0.226305106,0.141782514,0.100321473,0.129953896,0.642103055,0.30814459,0.282290166,0.237582075,0.961842107,0.735613026,0.408208309,0.448584434,0.092556486,0.112170895,0.298853998,0.04536008,0.52266803,0.752665512,0.218295964,0.810018548,0.301484682,0.534662463,0.1388431,0.46487755,0.021666178,0.385966308,0.851365575,0.626443792,0.184297004,0.629658586,0.709727221,0.303282026,0.764852887,0.007405067,0.252820348,0.530804661,0.977201683,0.449529071,0.049595829,0.148090377,0.80859306,0.146932238,0.072642258,0.799917953,0.359986062,0.646830199,0.705522383,0.530382156,0.924399929,0.971678826,0.907610518,0.064501484,0.583198365,0.014670484,0.497840525\n+0.206779889,0.259104897,0.198398082,0.196221928,0.259590875,0.130193462,0.735265156,0.229027116,0.868035231,0.322417616,0.683957601,0.861376103,0.006296261,0.494174963,0.699079904,0.089501678,0.098489569,0.109116872,0.203680672,0.434153807,0.402326669,0.594493048,0.507542867,0.303810506,0.849276679,0.090957514,0.545629127,0.653064695,0.032856786,0.576945501,0.035877289,0.148624466,0.776477014,0.260141491,0.514985847,0.396856766,0.212922203,0.943847413,0.105120356,0.306431821,0.295965957,0.145355602,0.779691221,0.159898248,0.640366157,0.629105358,0.446081882,0.55144831,0.385601612,0.58542978,0.33452909,0.527774124,0.354785201,0.216160242,0.212310618,0.439340393,0.662744113,0.48035534,0.080787916,0.328401312,0.457802506,0.866853222,0.058082486,0.69610109,0.358012527,0.63878005,0.829228716,0.828834139,0.681563381,0.825535727,0.390208689,0.834424626,0.032943199,0.477577171,0.66544263,0.387247423,0.047936364,0.74855797,0.063395316,0.941736191,0.876896161,0.479927402,0.283405855,0.571128034,0.516828486,0.066705363,0.87838864,0.006643035,0.613208193,0.856519051,0.74563139,0.471823854,0.781108716,0.220437566,0.522848958,0.541959312,0.750745125,0.839032841,0.383846188,0.653336608,0.358879633,0.091623231,0.310696036,0.653234048,0.099134569,0.321942325,0.022605431,0.535346685,0.289819767,0.815782107,0.101412416,0.652008993,0.957910535,0.514772735,0.308250045,0.698646581,0.283028759,0.895945593,0.818490087,0.284010497,0.035801351,0.822541306,0.569585807,0.976136466,0.333230612,0.853313674,0.434036895,0.416635676,0.589262515,0.788056029,0.7564586,0.702081679,0.088995847,0.658265364,0.81957'..b'081636739,0.68612551,0.250902172,0.696630718,0.735970989,0.165528649,0.724459467,0.770091166,0.518066797,0.078529929,0.469622534,0.288719553,0.555189815,0.900566966,0.260299014,0.491477946,0.459966587,0.872722933,0.886114727,0.46756228,0.581891964,0.831067812,0.648180519,0.403926926,0.813658199,0.11317365,0.025572656,0.22580733,0.695036055,0.543046944,0.841117004,0.306718541,0.519318716,0.348356791,0.747990155,0.060869661,0.721942778,0.195962481,0.792811005,0.248197388,0.025545264,0.688030979,0.089076526,0.488020804,0.588069635,0.751413068,0.908220201,0.2166294,0.90719109,0.651538826,0.733790848,0.581253494,0.934629185,0.724769243,0.243882316,0.571538637,0.630935877,0.52282453,0.169697401,0.215089439,0.290058831,0.827033011,0.648928513,0.198231137,0.694107656,0.607010356,0.124171499,0.622233051,0.021554884,0.844987036,0.471586256,0.413755394,0.241364486,0.547082047,0.005375958,0.615266443,0.930622858,0.161033147,0.88545859,0.818448416,0.147515195,0.112835799,0.98865194,0.069612168,0.491554008,0.699844248,0.883314614,0.510870821,0.693346576,0.309208762,0.304119421,0.050641291,0.118065606,0.076020708,0.50423559,0.270657181,0.780507711,0.830555859,0.69605176,0.892462647,0.444217514,0.984424757,0.176259462,0.589438526,0.116275725,0.899475645,0.188442633,0.750274281,0.390365777,0.50652587,0.493751414,0.83558948,0.166205184,0.425179998,0.307943215,0.429529427,0.426073885,0.613258702,0.859037009,0.054944038,0.49579972,0.55658738,0.918552157,0.352956507,0.375360234,0.025678051,0.544306167,0.266051209,0.783924585,0.036415759,0.826054726,0.402713399,0.533576067,0.902392178,0.244672168,0.243436308\n+0.039104228,0.584294653,0.025209158,0.823336359,0.320557364,0.084254056,0.872917264,0.884170156,0.786040229,0.830074302,0.217955017,0.007155342,0.871540721,0.819820363,0.408544125,0.355558657,0.659422264,0.856215054,0.373961894,0.847246749,0.221428298,0.721199886,0.100142434,0.945209342,0.768316742,0.997736709,0.589411981,0.995490779,0.385586789,0.814564517,0.768119249,0.016252165,0.736420033,0.668352336,0.019187738,0.786009506,0.934932028,0.250884153,0.128717596,0.146751957,0.448061221,0.194831526,0.441640682,0.096293667,0.135455123,0.94291305,0.537446646,0.034835808,0.200800345,0.664661446,0.189389108,0.713225213,0.60124332,0.499242082,0.348527281,0.689551777,0.891090705,0.577505866,0.154966104,0.361338579,0.852466161,0.846363738,0.744341638,0.206727492,0.601085404,0.373989142,0.228778335,0.745900077,0.648473068,0.105303191,0.337122868,0.240542084,0.82227605,0.481802882,0.823864627,0.713712182,0.599898414,0.696513099,0.310749082,0.83634955,0.882914719,0.920641474,0.682733328,0.341067713,0.406861294,0.167183017,0.56953446,0.821949094,0.687196121,0.504118767,0.816093179,0.462303043,0.850678918,0.357248985,0.908377263,0.754489335,0.818356054,0.502602436,0.07219394,0.466740329,0.321704661,0.517273787,0.796171595,0.115012596,0.742020681,0.561014228,0.099801082,0.928455543,0.723714214,0.12357007,0.065493007,0.924020282,0.275654289,0.866747552,0.68262988,0.997236437,0.543149074,0.170420746,0.877794026,0.448018278,0.92292162,0.979848844,0.327112441,0.714686831,0.794067645,0.206005785,0.836286354,0.888590352,0.763281121,0.819229165,0.63187163,0.603470576,0.966407174,0.431067359,0.091053441,0.70049968,0.297561463,0.597685982,0.117414933,0.580810322,0.829843762,0.09133859,0.619858251,0.524804821,0.6002763,0.513414142,0.811066167,0.136441549,0.525945869,0.637368384,0.32791072,0.417831076,0.278477262,0.120340039,0.284972771,0.612502672,0.776648729,0.704171723,0.930573788,0.767191185,0.642772763,0.263597023,0.875026921,0.097981165,0.720602585,0.783605236,0.006930343,0.342520358,0.795138803,0.04721887,0.900286801,0.087997202,0.853966738,0.566002675,0.646861405,0.973598914,0.173432258,0.811874543,0.001817288,0.480418112,0.956693413,0.942607573,0.547909348,0.478265004,0.199643587,0.182160282,0.019393384,0.453157257,0.570136137,0.699695726,0.028420838,0.823332691,0.034888961,0.162436972,0.072081647,0.154190925,0.382289154,0.423335487,0.050902135,0.566994109\n'
b
diff -r 000000000000 -r 77cbfe3e1b0d test-data/UserLabelExample.csv
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/UserLabelExample.csv Tue May 02 17:39:13 2023 +0000
b
@@ -0,0 +1,20 @@
+1
+0
+0
+1
+0
+0
+1
+1
+0
+1
+1
+1
+1
+0
+0
+1
+1
+0
+1
+1