Mercurial > repos > iuc > snapatac2_plotting
comparison plotting.xml @ 0:0cfd2d2f7351 draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/snapatac2 commit be132b56781bede5dc6e020aa80ca315546666cd
| author | iuc |
|---|---|
| date | Thu, 16 May 2024 13:15:05 +0000 |
| parents | |
| children | fecf9664c885 |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:0cfd2d2f7351 |
|---|---|
| 1 <tool id="snapatac2_plotting" name="SnapATAC2 Plotting" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@"> | |
| 2 <macros> | |
| 3 <import>macros.xml</import> | |
| 4 </macros> | |
| 5 <requirements> | |
| 6 <expand macro="requirements"/> | |
| 7 </requirements> | |
| 8 <command detect_errors="exit_code"><![CDATA[ | |
| 9 @PREP_ADATA@ | |
| 10 @CMD@ | |
| 11 ]]></command> | |
| 12 <configfiles> | |
| 13 <configfile name="script_file"><![CDATA[ | |
| 14 @CMD_imports@ | |
| 15 @CMD_read_inputs@ | |
| 16 | |
| 17 #if $method.method == 'pl.frag_size_distr' | |
| 18 #if $method.log_scale | |
| 19 fig = sa.pl.frag_size_distr(adata, show=False) | |
| 20 fig.update_yaxes(type="log") | |
| 21 sa.pl.render_plot(fig, @CMD_params_render_plot@) | |
| 22 #else | |
| 23 sa.pl.frag_size_distr(adata, @CMD_params_render_plot@) | |
| 24 #end if | |
| 25 #else if $method.method == 'pl.tsse' | |
| 26 sa.pl.tsse( | |
| 27 adata, | |
| 28 min_fragment = $method.min_fragment, | |
| 29 @CMD_params_render_plot@ | |
| 30 ) | |
| 31 #else if $method.method == 'pl.umap' | |
| 32 sa.pl.umap( | |
| 33 adata, | |
| 34 color = '$method.color', | |
| 35 use_rep = '$method.use_rep', | |
| 36 marker_size = $method.marker_size, | |
| 37 marker_opacity = $method.marker_opacity, | |
| 38 sample_size = $method.sample_size, | |
| 39 @CMD_params_render_plot@ | |
| 40 ) | |
| 41 #else if $method.method == 'pl.regions' | |
| 42 sa.pl.regions( | |
| 43 adata, | |
| 44 groupby = '$method.groupby', | |
| 45 peaks = '$method.peaks', | |
| 46 @CMD_params_render_plot@ | |
| 47 ) | |
| 48 #else if $method.method == 'pl.spectral_eigenvalues' | |
| 49 sa.pl.spectral_eigenvalues( | |
| 50 adata, | |
| 51 @CMD_params_render_plot@ | |
| 52 ) | |
| 53 #end if | |
| 54 ]]></configfile> | |
| 55 </configfiles> | |
| 56 <inputs> | |
| 57 <conditional name="method"> | |
| 58 <param name="method" type="select" label="Method used for plotting"> | |
| 59 <option value="pl.frag_size_distr">Plot fragment size distribution, using 'pl.frag_size_distr'</option> | |
| 60 <option value="pl.tsse">Plot the TSS enrichment vs. number of fragments density figure, using 'pl.tsse'</option> | |
| 61 <option value="pl.umap">Plot the UMAP embedding, using 'pl.umap'</option> | |
| 62 <option value="pl.spectral_eigenvalues">Plot the eigenvalues of spectral embedding, using 'pl.spectral_eigenvalues'</option> | |
| 63 </param> | |
| 64 <when value="pl.frag_size_distr"> | |
| 65 <expand macro="inputs_anndata"/> | |
| 66 <param name="log_scale" type="boolean" checked="False" label="Change the y-axis (fragment counts) to log scale"/> | |
| 67 <expand macro="params_render_plot"/> | |
| 68 </when> | |
| 69 <when value="pl.tsse"> | |
| 70 <expand macro="inputs_anndata"/> | |
| 71 <param argument="min_fragment" type="integer" value="500" label="Minimum number of unique fragments"/> | |
| 72 <expand macro="params_render_plot"/> | |
| 73 </when> | |
| 74 <when value="pl.umap"> | |
| 75 <expand macro="inputs_anndata"/> | |
| 76 <param argument="color" type="text" value="" optional="true" label="Color"/> | |
| 77 <param argument="use_rep" type="text" value="X_umap" label="Use the indicated representation in .obsm"/> | |
| 78 <param argument="marker_size" type="float" value="" optional="true" label="Size of the dots"/> | |
| 79 <param argument="marker_opacity" type="float" value="1" label="Opactiy of the dots"/> | |
| 80 <param argument="sample_size" type="integer" value="" optional="true" label="Number of cells to use"/> | |
| 81 <expand macro="params_render_plot"/> | |
| 82 </when> | |
| 83 <when value="pl.spectral_eigenvalues"> | |
| 84 <expand macro="inputs_anndata"/> | |
| 85 <expand macro="params_render_plot"/> | |
| 86 </when> | |
| 87 </conditional> | |
| 88 <expand macro="inputs_common_advanced"/> | |
| 89 </inputs> | |
| 90 <outputs> | |
| 91 <data name="out_png" format="png" from_work_dir="plot.png" label="PNG plot from ${tool.name} (${method.method}) on ${on_string}"> | |
| 92 <filter>method['out_file'] == 'png'</filter> | |
| 93 </data> | |
| 94 <data name="out_pdf" format="pdf" from_work_dir="plot.pdf" label="PDF plot from ${tool.name} (${method.method}) on ${on_string}"> | |
| 95 <filter>method['out_file'] == 'pdf'</filter> | |
| 96 </data> | |
| 97 <data name="out_svg" format="svg" from_work_dir="plot.svg" label="SVG plot from ${tool.name} (${method.method}) on ${on_string}"> | |
| 98 <filter>method['out_file'] == 'svg'</filter> | |
| 99 </data> | |
| 100 <data name="hidden_output" format="txt" label="Log file" hidden="true"> | |
| 101 <filter>advanced_common['show_log']</filter> | |
| 102 </data> | |
| 103 </outputs> | |
| 104 <tests> | |
| 105 <test expect_num_outputs="2"> | |
| 106 <!-- pl.frag_size_distr --> | |
| 107 <conditional name="method"> | |
| 108 <param name="method" value="pl.frag_size_distr"/> | |
| 109 <param name="adata" location="https://zenodo.org/records/11199963/files/pp.import_data.pbmc_500_chr21.h5ad"/> | |
| 110 <param name="log_scale" value="True"/> | |
| 111 <param name="out_file" value="pdf"/> | |
| 112 <expand macro="render_plot_test"/> | |
| 113 </conditional> | |
| 114 <section name="advanced_common"> | |
| 115 <param name="show_log" value="true"/> | |
| 116 </section> | |
| 117 <output name="out_pdf" location="https://zenodo.org/records/11199963/files/pl.frag_size_distr.pdf" ftype="pdf" compare="sim_size" delta_frac="0.1"/> | |
| 118 <output name="hidden_output"> | |
| 119 <assert_contents> | |
| 120 <has_text_matching expression="sa.pl.frag_size_distr"/> | |
| 121 <has_text_matching expression="fig.update_yaxes"/> | |
| 122 <expand macro="render_plot_matching_text"/> | |
| 123 </assert_contents> | |
| 124 </output> | |
| 125 </test> | |
| 126 <test expect_num_outputs="2"> | |
| 127 <!-- pl.tsse --> | |
| 128 <conditional name="method"> | |
| 129 <param name="method" value="pl.tsse"/> | |
| 130 <param name="adata" location="https://zenodo.org/records/11199963/files/metrics.tsse.pbmc_500_chr21.h5ad"/> | |
| 131 <param name="min_fragment" value="500"/> | |
| 132 <param name="out_file" value="png"/> | |
| 133 <expand macro="render_plot_test"/> | |
| 134 </conditional> | |
| 135 <section name="advanced_common"> | |
| 136 <param name="show_log" value="true"/> | |
| 137 </section> | |
| 138 <output name="hidden_output"> | |
| 139 <assert_contents> | |
| 140 <has_text_matching expression="sa.pl.tsse"/> | |
| 141 <has_text_matching expression="min_fragment = 500"/> | |
| 142 <expand macro="render_plot_matching_text"/> | |
| 143 </assert_contents> | |
| 144 </output> | |
| 145 <output name="out_png" location="https://zenodo.org/records/11199963/files/pl.tsse.png" ftype="png" compare="sim_size" delta_frac="0.1"/> | |
| 146 </test> | |
| 147 <test expect_num_outputs="2"> | |
| 148 <!-- pl.umap --> | |
| 149 <conditional name="method"> | |
| 150 <param name="method" value="pl.umap"/> | |
| 151 <param name="adata" ftype="h5ad" location="https://zenodo.org/records/11199963/files/tl.leiden.pbmc_500_chr21.h5ad"/> | |
| 152 <param name="color" value="leiden"/> | |
| 153 <param name="use_rep" value="X_umap"/> | |
| 154 <param name="marker_size" value="1"/> | |
| 155 <param name="marker_opacity" value="0.8"/> | |
| 156 <param name="sample_size" value="100"/> | |
| 157 <expand macro="render_plot_test"/> | |
| 158 <param name="out_file" value="svg"/> | |
| 159 </conditional> | |
| 160 <section name="advanced_common"> | |
| 161 <param name="show_log" value="true"/> | |
| 162 </section> | |
| 163 <output name="hidden_output"> | |
| 164 <assert_contents> | |
| 165 <has_text_matching expression="sa.pl.umap"/> | |
| 166 <has_text_matching expression="color = 'leiden'"/> | |
| 167 <has_text_matching expression="use_rep = 'X_umap'"/> | |
| 168 <has_text_matching expression="marker_size = 1"/> | |
| 169 <has_text_matching expression="marker_opacity = 0.8"/> | |
| 170 <has_text_matching expression="sample_size = 100"/> | |
| 171 <expand macro="render_plot_matching_text"/> | |
| 172 </assert_contents> | |
| 173 </output> | |
| 174 <output name="out_svg" location="https://zenodo.org/records/11199963/files/pl.umap.svg" ftype="svg" compare="sim_size" delta_frac="0.1"/> | |
| 175 </test> | |
| 176 <test expect_num_outputs="2"> | |
| 177 <!-- pl.spectral_eigenvalues --> | |
| 178 <conditional name="method"> | |
| 179 <param name="method" value="pl.spectral_eigenvalues"/> | |
| 180 <param name="adata" ftype="h5ad" location="https://zenodo.org/records/11199963/files/tl.spectral.pbmc_500_chr21.h5ad"/> | |
| 181 <expand macro="render_plot_test"/> | |
| 182 <param name="out_file" value="pdf"/> | |
| 183 </conditional> | |
| 184 <section name="advanced_common"> | |
| 185 <param name="show_log" value="true"/> | |
| 186 </section> | |
| 187 <output name="hidden_output"> | |
| 188 <assert_contents> | |
| 189 <has_text_matching expression="sa.pl.spectral_eigenvalues"/> | |
| 190 <expand macro="render_plot_matching_text"/> | |
| 191 </assert_contents> | |
| 192 </output> | |
| 193 <output name="out_pdf" location="https://zenodo.org/records/11199963/files/pl.spectral_eigenvalues.pdf" ftype="pdf" compare="sim_size" delta_frac="0.1"/> | |
| 194 </test> | |
| 195 </tests> | |
| 196 <help><![CDATA[ | |
| 197 Plot fragment size distribution, using `pl.frag_size_distr` | |
| 198 =========================================================== | |
| 199 | |
| 200 Plot fragment size distribution. | |
| 201 | |
| 202 `metrics.frag_size_distr` must be ran first in order to use this function. | |
| 203 | |
| 204 Plot the TSS enrichment vs. number of fragments density figure, using `pl.tsse` | |
| 205 =============================================================================== | |
| 206 | |
| 207 Plot the TSS enrichment vs. number of fragments density figure. | |
| 208 | |
| 209 More details on the `SnapATAC2 documentation | |
| 210 <https://kzhang.org/SnapATAC2/api/_autosummary/snapatac2.pl.tsse.html>`__ | |
| 211 | |
| 212 Plot the UMAP embedding, using `pl.umap` | |
| 213 ======================================== | |
| 214 | |
| 215 Plot the UMAP embedding. | |
| 216 | |
| 217 More details on the `SnapATAC2 documentation | |
| 218 <https://kzhang.org/SnapATAC2/api/_autosummary/snapatac2.pl.umap.html>`__ | |
| 219 | |
| 220 Plot the eigenvalues of spectral embedding, using `pl.spectral_eigenvalues` | |
| 221 =========================================================================== | |
| 222 | |
| 223 Plot the eigenvalues of spectral embedding. | |
| 224 | |
| 225 More details on the `SnapATAC2 documentation | |
| 226 <https://kzhang.org/SnapATAC2/api/_autosummary/snapatac2.pl.spectral_eigenvalues.html>`__ | |
| 227 ]]></help> | |
| 228 <expand macro="citations"/> | |
| 229 </tool> |
