Mercurial > repos > ebi-gxa > run_sccaf
comparison run_sccaf.xml @ 0:ca26d4b4b02c draft
planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/tree/develop/tools/tertiary-analysis/sccaf commit 68be7a6fdb93e8b59e80e5f16e7fecdaa16f288c
author | ebi-gxa |
---|---|
date | Mon, 14 Oct 2019 08:11:29 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:ca26d4b4b02c |
---|---|
1 <?xml version="1.0" encoding="utf-8"?> | |
2 <tool id="run_sccaf" name="Run SCCAF" version="@TOOL_VERSION@+galaxy0"> | |
3 <description>to assess and optimise clustering</description> | |
4 <macros> | |
5 <import>sccaf_macros.xml</import> | |
6 </macros> | |
7 <expand macro="requirements"/> | |
8 <command detect_errors="exit_code"><![CDATA[ | |
9 ln -s ${input_obj_file} input.h5 && | |
10 sccaf -i input.h5 | |
11 | |
12 --cores \${GALAXY_SLOTS:-1} | |
13 | |
14 #if $cluster_source.use_tsv | |
15 --external-clustering-tsv ${cluster_source.input_tsv} | |
16 #else | |
17 --slot-for-existing-clustering ${cluster_source.obj_attr} | |
18 #end if | |
19 | |
20 #if $mode.skip_init_assessment | |
21 --skip-assessment | |
22 #end if | |
23 | |
24 #if $mode.optimise | |
25 #if not $mode.init.from_input | |
26 --resolution ${mode.init.resolution} | |
27 #end if | |
28 --optimise | |
29 #if $mode.optimisation_stop.condition == "accuracy_threshold" | |
30 --min-accuracy ${mode.optimisation_stop.accuracy} | |
31 #else | |
32 --min-accuracy 0.955 | |
33 --undercluster-boundary ${mode.optimisation_stop.min_resolution_clustering_slot} | |
34 #end if | |
35 --produce-rounds-summary | |
36 | |
37 --optimisation-plots-output ${opt_pdf_out} | |
38 | |
39 #if $mode.citer | |
40 --conf-sampling-iterations ${mode.citer} | |
41 #end if | |
42 | |
43 > ${opt_text_out}; | |
44 #end if | |
45 | |
46 #if $mode.optimise and $mode.distribute_assesment: | |
47 mkdir -p outputs; | |
48 for round in \$(cat rounds.txt); do | |
49 echo "Round: "\$round; | |
50 echo \$round > outputs/round_\$round\.txt; | |
51 done | |
52 #end if | |
53 | |
54 | |
55 | |
56 ]]></command> | |
57 | |
58 <inputs> | |
59 <expand macro="input_object_params"/> | |
60 | |
61 <conditional name="cluster_source"> | |
62 <param name="use_tsv" type="boolean" checked="true" label="Use external cluster information" help="If the provided AnnData/Loom file does not include the clustering, or if you want to use an external clustering assigment."/> | |
63 <when value="true"> | |
64 <param name="input_tsv" type="data" argument="--external-clustering-tsv" format="tsv" label="Cluster table for assessment in tsv format"/> | |
65 </when> | |
66 <when value="false"> | |
67 <param name="obj_attr" type="text" argument="--slot-for-existing-clustering" value="louvain" label="Attribute in input object that contains cluster information" help="If you are not using an external clustering, then you must specify the slot/index in the AnnData or Loom file where the clustering to be used for assessment (and potentially optimisation starting point) is saved."/> | |
68 </when> | |
69 </conditional> | |
70 | |
71 <conditional name="mode"> | |
72 <param name="optimise" type="boolean" checked="false" argument="--optimise" label="Run clustering optimisation" help="By default the tool only runs an assesment of the clustering quality. To further optimise the clustering, enable this option."/> | |
73 <when value="true"> | |
74 <conditional name="init"> | |
75 <param name="from_input" type="boolean" checked="true" label="Use input clustering to initialise optimisation" help="This option uses the previously specified clustering (either external file provided or internal index/slot specified) to serve as starting point for the optimisation process."/> | |
76 <when value="true"> | |
77 </when> | |
78 <when value="false"> | |
79 <param name="resolution" type="float" value="1.5" argument="--resolution" label="Resolution for initialising louvain clustering" help="Perform an initial clustering and use this as an starting point."/> | |
80 </when> | |
81 </conditional> | |
82 <conditional name="optimisation_stop"> | |
83 <param type="select" name="condition" help="How should the optimisation algorithm be stopped." label="Stop condition"> | |
84 <option value="accuracy_threshold" selected="true">Set a threshold for accuracy</option> | |
85 <option value="min_resolution_clustering">Use a slot with a low resolution clustering</option> | |
86 </param> | |
87 <when value="accuracy_threshold"> | |
88 <param name="accuracy" type="float" value="0.90" argument="--accuracy" label="Accuracy for convergence of the optimisation process" help="The SCCAF optimisation process will converge once this accuracy is achieved."/> | |
89 </when> | |
90 <when value="min_resolution_clustering"> | |
91 <param name="min_resolution_clustering_slot" type="text" argument="--undercluster-boundary" label="Underclustering boundary to use in the optimisation." help="The slot inside the ann data object with the desired underclustering (low resolution) to be used as exit condition."/> | |
92 </when> | |
93 </conditional> | |
94 <param name="skip_init_assessment" type="boolean" argument="--skip-assessment" checked="false" label="Run only the optimisation and skip the initial assessment" help="If you are running the optimisation, you can choose skip the initial assessment to save time."/> | |
95 <param name="distribute_assesment" type="boolean" checked="false" label="Produce parameter walk for asessment distribution" help="Will split rounds in files so that multiple assess processes can be distributed down the line"/> | |
96 <param name="citer" type="integer" value="3" argument="--conf-sampling-iterations" label="Number of iterations of sampling for the confusion matrix." help="By default is 3, higher numbers mean more stable results (number of rounds) but also longer execution times." optional="True"/> | |
97 </when> | |
98 <when value="false"> | |
99 </when> | |
100 </conditional> | |
101 </inputs> | |
102 | |
103 <outputs> | |
104 <data name="output_png" format="png" from_work_dir="roc-curve.png" label="${tool.name} on ${on_string} ROC Curve for initial assesment"> | |
105 <filter>not mode['skip_init_assessment']</filter> | |
106 </data> | |
107 <data name="output_h5" format="h5" from_work_dir="output.h5" label="${tool.name} on ${on_string} output.h5"> | |
108 <filter>mode['optimise']</filter> | |
109 </data> | |
110 <data name="optim_png" format="png" from_work_dir="optim.png" label="${tool.name} on ${on_string} ROC Curve for optimisation result"> | |
111 <filter>mode['optimise']</filter> | |
112 </data> | |
113 <collection name="rounds_walk" type="list" label="Rounds for assesment distribution"> | |
114 <filter>mode['optimise'] and mode['distribute_assesment']</filter> | |
115 <discover_datasets pattern="__name_and_ext__" directory="outputs"/> | |
116 </collection> | |
117 <data name="opt_text_out" format="txt" label="${tool.name} on ${on_string} Optimisation process log"> | |
118 <filter>mode['optimise']</filter> | |
119 </data> | |
120 <data name="opt_pdf_out" format="pdf" label="${tool.name} on ${on_string} Optimisation process plots"> | |
121 <filter>mode['optimise']</filter> | |
122 </data> | |
123 </outputs> | |
124 | |
125 <tests> | |
126 <test> | |
127 <param name="input_obj_file" value="find_cluster.h5"/> | |
128 <param name="use_tsv" value="true"/> | |
129 <param name="input_tsv" value="find_cluster.tsv"/> | |
130 <output name="output_png" file="run_sccaf.png" ftype="png"/> | |
131 </test> | |
132 </tests> | |
133 | |
134 <help><![CDATA[ | |
135 @SCCAF_INTRO@ | |
136 | |
137 Inputs | |
138 ------ | |
139 | |
140 * AnnData object which contains the expression matrix and pre-calculated coordinates for UMAP. The AnnData object can include already clustering data, in which case the user will need to know on which AnnData slot/label is contained. | |
141 * Optional external text file with mappings between cells and clusters (when no clustering is given inside the AnnData file). | |
142 | |
143 Modes of operation | |
144 ------------------ | |
145 | |
146 * Optimisation with exit condition based on accuracy cut-off. In this case the user provides a minimum cut-off for the accuracy to be achieved and the optimisation process will exit at that point. | |
147 * Optimisation with exit condition based on under-clustered scenario. In the case the AnnData object given must include a low resolution, under clustered clustering, and its label must be know to be specified. | |
148 * Assesment only (no optimisation), where an existing clustering is assessed. | |
149 | |
150 This is resource intensive. | |
151 | |
152 Distributed assesment | |
153 --------------------- | |
154 | |
155 If running the optimisation you can distribute assessments of the optimisation | |
156 results. For this, activate the "Produce parameter walk for assessment | |
157 distribution" option, which will generate a "Rounds for assesment distribution". | |
158 Then feed the AnnData output of the optimisation process and the rounds output | |
159 to the SCCAF Assesment module. Then merge all assessment results with | |
160 SCCAF Assesment Merger (this also receives the rounds output). The workflow | |
161 would look like this: | |
162 | |
163 .. image:: example_sccaf_workflow.png | |
164 :height: 400 px | |
165 :width: 850 px | |
166 :scale: 80 % | |
167 | |
168 | |
169 ]]></help> | |
170 <!-- <expand macro="citations"/> --> | |
171 </tool> |