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