Mercurial > repos > iuc > snapatac2_network
comparison macros.xml @ 0:2c289e3b566a draft default tip
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/snapatac2 commit e0f59fae19e57f54ae0c351a16dd1805d12aba1d
| author | iuc |
|---|---|
| date | Tue, 25 Nov 2025 16:39:58 +0000 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:2c289e3b566a |
|---|---|
| 1 <macros> | |
| 2 <token name="@TOOL_VERSION@">2.8.0</token> | |
| 3 <token name="@VERSION_SUFFIX@">0</token> | |
| 4 <token name="@PROFILE@">24.0</token> | |
| 5 <xml name="xrefs"> | |
| 6 <xrefs> | |
| 7 <xref type="bio.tools">snapatac</xref> | |
| 8 </xrefs> | |
| 9 </xml> | |
| 10 <xml name="requirements"> | |
| 11 <requirement type="package" version="@TOOL_VERSION@">snapatac2</requirement> | |
| 12 <requirement type="package" version="0.8.37">hdbscan</requirement> | |
| 13 <requirement type="package" version="0.10.2">leidenalg</requirement> | |
| 14 <requirement type="package" version="0.5.7">umap-learn</requirement> | |
| 15 <requirement type="package" version="3.0.4">xgboost</requirement> | |
| 16 <requirement type="package" version="0.2.1">python-kaleido</requirement> | |
| 17 <requirement type="package" version="1.31.0">polars</requirement> | |
| 18 <requirement type="package" version="5.24.1">plotly</requirement> | |
| 19 <requirement type="package" version="0.2.1">python-kaleido</requirement> | |
| 20 <requirement type="package" version="0.0.10">harmonypy</requirement> | |
| 21 <requirement type="package" version="1.7.4">scanorama</requirement> | |
| 22 <yield /> | |
| 23 </xml> | |
| 24 | |
| 25 <!-- command section --> | |
| 26 <token name="@CMD_PREP_ADATA@"><![CDATA[ | |
| 27 ## ln -s does not work here | |
| 28 cp '$method.adata' 'anndata.h5ad' && | |
| 29 ]]></token> | |
| 30 <token name="@CMD@"><![CDATA[ | |
| 31 cat '$script_file' > '$hidden_output' && | |
| 32 python '$script_file' >> '$hidden_output' && | |
| 33 touch 'anndata_info.txt' && | |
| 34 cat 'anndata_info.txt' @CMD_PRETTIFY_STDOUT@ | |
| 35 ]]></token> | |
| 36 <token name="@CMD_PRETTIFY_STDOUT@"><![CDATA[ | |
| 37 | sed -r '1 s|AnnData object with (.+) = (.*)\s*|\1: \2|g' | sed "s|'||g" | sed -r 's|^\s*(.*):\s(.*)|[\1]\n- \2|g' | sed 's|, |\n- |g' | |
| 38 ]]></token> | |
| 39 <token name="@CMD_GET_GFF@"><![CDATA[ | |
| 40 #if $method.gff_file_condi.gffSource == 'cached': | |
| 41 ln -s '$method.gff_file_condi.gff_pre_installed.fields.path' gff && | |
| 42 #else: | |
| 43 ln -s '$method.gff_file_condi.gff_history' gff && | |
| 44 #end if | |
| 45 ]]></token> | |
| 46 <token name="@CMD_GET_FASTA@"><![CDATA[ | |
| 47 #if $method.fasta_file_condi.fastaSource == 'indexed': | |
| 48 zcat '$method.fasta_file_condi.fasta_pre_installed.fields.path' > fasta.fa && | |
| 49 echo "Using built-in FASTA: '$method.fasta_file_condi.fasta_pre_installed.fields.name'" >&2 && | |
| 50 #else: | |
| 51 #if $method.fasta_file_condi.fasta_history.ext.endswith('.gz') | |
| 52 zcat '$method.fasta_file_condi.fasta_history' > fasta.fa && | |
| 53 #else: | |
| 54 ln -s '$method.fasta_file_condi.fasta_history' fasta.fa && | |
| 55 #end if | |
| 56 #end if | |
| 57 ]]></token> | |
| 58 | |
| 59 <!-- Config section --> | |
| 60 <token name="@CONF_IMPORTS@"><![CDATA[ | |
| 61 import snapatac2 as snap | |
| 62 import os | |
| 63 ]]></token> | |
| 64 <token name="@CONF_READ_INPUTS@"><![CDATA[ | |
| 65 adata = snap.read('anndata.h5ad', backed = None) | |
| 66 ]]></token> | |
| 67 <token name="@CONF_ANNDATA_WRITE_OUTPUTS@"><![CDATA[ | |
| 68 adata.write_h5ad('anndata.h5ad.gz', compression='gzip') | |
| 69 with open('anndata_info.txt','w', encoding='utf-8') as ainfo: | |
| 70 print(adata, file=ainfo) | |
| 71 ]]></token> | |
| 72 <token name="@CONF_PARAMS_RENDER_PLOT@"><![CDATA[ | |
| 73 width = $method.width, | |
| 74 height = $method.height, | |
| 75 show = False, | |
| 76 interactive = False, | |
| 77 out_file = 'plot.$method.out_file', | |
| 78 ]]></token> | |
| 79 <token name="@CONF_PARAMS_DATA_INTEGRATION@"><![CDATA[ | |
| 80 use_rep = '$method.use_rep', | |
| 81 #if $method.use_dims != '' | |
| 82 #set $dims = ([x.strip() for x in str($method.use_dims).split(',')]) | |
| 83 use_dims=$dims, | |
| 84 #end if | |
| 85 #if $method.groupby != '' | |
| 86 #set $groupby = ([x.strip() for x in str($method.groupby).split(',')]) | |
| 87 groupby=$groupby, | |
| 88 #end if | |
| 89 #if $method.key_added != '' | |
| 90 key_added = '$method.key_added', | |
| 91 #end if | |
| 92 ]]></token> | |
| 93 <token name="@CONF_IMPORT_MEME@"><![CDATA[ | |
| 94 motifs = read_motifs("input.meme") | |
| 95 for motif in motifs: | |
| 96 motif.name = motif.id.split('+')[0] | |
| 97 | |
| 98 unique_motifs = {} | |
| 99 for motif in motifs: | |
| 100 name = motif.name | |
| 101 if ( | |
| 102 name not in unique_motifs or | |
| 103 unique_motifs[name].info_content() < motif.info_content() | |
| 104 ): | |
| 105 unique_motifs[name] = motif | |
| 106 motifs = list(unique_motifs.values()) | |
| 107 | |
| 108 | |
| 109 #else: | |
| 110 motifs = read_motifs("input.meme") | |
| 111 for motif in motifs: | |
| 112 motif.name = motif.id.split('_')[0] | |
| 113 motif.family = motif.id.split('+')[-1] | |
| 114 ]]></token> | |
| 115 | |
| 116 <!-- input section --> | |
| 117 <xml name="sanitize_query" token_validinitial="string.printable"> | |
| 118 <sanitizer> | |
| 119 <valid initial="@VALIDINITIAL@"> | |
| 120 <remove value="'" /> | |
| 121 <yield/> | |
| 122 </valid> | |
| 123 </sanitizer> | |
| 124 </xml> | |
| 125 | |
| 126 <xml name="param_inputs_anndata" token_multiple="false" token_label="Annotated data matrix"> | |
| 127 <param name="adata" type="data" multiple="@MULTIPLE@" format="h5ad" label="@LABEL@"/> | |
| 128 </xml> | |
| 129 <xml name="param_groupby"> | |
| 130 <param argument="groupby" type="text" label="The key of the observation grouping to consider"> | |
| 131 <expand macro="sanitize_query" /> | |
| 132 </param> | |
| 133 </xml> | |
| 134 <xml name="param_common_advanced"> | |
| 135 <section name="advanced_common" title="Advanced Options" expanded="false"> | |
| 136 <param name="show_log" type="boolean" checked="false" label="Output Log?" /> | |
| 137 </section> | |
| 138 </xml> | |
| 139 <xml name="param_render_plot"> | |
| 140 <param argument="width" type="integer" value="600" label="Width of the plot"/> | |
| 141 <param argument="height" type="integer" value="400" label="Height of the plot"/> | |
| 142 <param name="out_file" type="select" optional="true" label="Type of output plot"> | |
| 143 <option value="png" selected="true">PNG</option> | |
| 144 <option value="svg">SVG</option> | |
| 145 <option value="pdf">PDF</option> | |
| 146 <option value="html">HTML</option> | |
| 147 </param> | |
| 148 </xml> | |
| 149 <xml name="param_shift" tokens="varname" token_value="0" token_label="Insertion site correction for the left end"> | |
| 150 <param argument="@VARNAME@" type="integer" value="@VALUE@" label="@LABEL@" help="Note this has no effect on single-end reads"/> | |
| 151 </xml> | |
| 152 <xml name="param_chunk_size" tokens="size"> | |
| 153 <param argument="chunk_size" type="integer" value="@SIZE@" label="chunk size"/> | |
| 154 </xml> | |
| 155 <xml name="param_min_max_frag_size"> | |
| 156 <param argument="min_frag_size" type="integer" optional="true" value="" label="Minimum fragment size to include"/> | |
| 157 <param argument="max_frag_size" type="integer" optional="true" value="" label="Maximum fragment size to include"/> | |
| 158 </xml> | |
| 159 <xml name="param_data_integration"> | |
| 160 <param argument="use_rep" type="text" value="X_spectral" label="The key for the matrix"/> | |
| 161 <param argument="use_dims" type="text" optional="true" value="" label="The dimensions used for computation"> | |
| 162 <expand macro="sanitize_query"/> | |
| 163 </param> | |
| 164 <param argument="groupby" type="text" optional="true" value="" label="The key of the observation grouping to consider"> | |
| 165 <expand macro="sanitize_query" /> | |
| 166 </param> | |
| 167 <param argument="key_added" type="text" optional="true" value="" label="If specified, add the result to adata.obsm with this key"/> | |
| 168 </xml> | |
| 169 <xml name="param_random_state" token_label="Seed of the random state generator" token_help=""> | |
| 170 <param argument="random_state" type="integer" value="0" label="@LABEL@" help="@HELP@"/> | |
| 171 </xml> | |
| 172 <xml name="param_key_added" tokens="key_added"> | |
| 173 <param argument="key_added" type="text" value="@KEY_ADDED@" label="`adata.obs` key under which t add cluster labels"/> | |
| 174 </xml> | |
| 175 <xml name="param_use_rep" token_label="Use the indicated representation in `.obsm`"> | |
| 176 <param argument="use_rep" type="text" value="X_spectral" label="@LABEL@"/> | |
| 177 </xml> | |
| 178 <xml name="param_n_iterations"> | |
| 179 <param argument="n_iterations" type="integer" value="-1" label="How many iterations of the Leiden clustering algorithm to perform" | |
| 180 help="Positive values above 2 define the total number of iterations to perform, -1 has the algorithm run until it reaches its optimal clustering."/> | |
| 181 </xml> | |
| 182 <xml name="param_counting_strategy"> | |
| 183 <param argument="counting_strategy" type="select" label="The strategy to compute feature counts"> | |
| 184 <option value="fragment">"fragment": based on the number of fragments that overlap with a region of interest</option> | |
| 185 <option value="insertion">"insertion": based on the number of insertions that overlap with a region of interest</option> | |
| 186 <option value="paired-insertion" selected="true">"paired-insertion": similar to "insertion", but it only counts the insertions once if the pair of insertions of a fragment are both within the same region of interest</option> | |
| 187 </param> | |
| 188 </xml> | |
| 189 <xml name="param_chrom_sizes"> | |
| 190 <param argument="chrom_sizes" type="data" format="tabular" label="Chromosome sizes" help="First column the chromosome name and second column the size"/> | |
| 191 </xml> | |
| 192 <xml name="param_genome_fasta"> | |
| 193 <conditional name="fasta_file_condi"> | |
| 194 <param name="fastaSource" type="select" label="Select a built-in FASTA or one from your history" help="Choose history if you don't see the correct FASTA."> | |
| 195 <option value="indexed" selected="true">Use a built-in FASTA</option> | |
| 196 <option value="history">Use a FASTA from history</option> | |
| 197 </param> | |
| 198 <when value="indexed"> | |
| 199 <param name="fasta_pre_installed" type="select" label="Select a FASTA file" help="Select the FASTA file from a list of pre-installed genomes"> | |
| 200 <options from_data_table="all_fasta"> | |
| 201 <filter type="sort_by" column="2" /> | |
| 202 </options> | |
| 203 </param> | |
| 204 </when> | |
| 205 <when value="history"> | |
| 206 <param name="fasta_history" type="data" format="fasta,fasta.gz" label="FASTA file" /> | |
| 207 </when> | |
| 208 </conditional> | |
| 209 </xml> | |
| 210 <xml name="param_gene_anno"> | |
| 211 <conditional name="gff_file_condi"> | |
| 212 <param name="gffSource" type="select" label="Select a built-in GFF file or one from your history" help="Choose history if you don't see the correct GFF" > | |
| 213 <option value="cached" selected="true">Use a built-in GFF</option> | |
| 214 <option value="history">Use a GFF from history</option> | |
| 215 </param> | |
| 216 <when value="cached"> | |
| 217 <param name="gff_pre_installed" type="select" label="Select a GFF file" help="Select the GFF from a list of pre-installed files"> | |
| 218 <options from_data_table="gene_sets"> | |
| 219 <filter type="sort_by" column="1" /> | |
| 220 </options> | |
| 221 </param> | |
| 222 </when> | |
| 223 <when value="history"> | |
| 224 <param name="gff_history" type="data" format="gff3.gz" label="Select a GFF file" help="Make sure that the GFF corresponds to the same genome as the FASTA"/> | |
| 225 </when> | |
| 226 </conditional> | |
| 227 </xml> | |
| 228 <xml name="param_n_comps" token_value="30" token_label="Number of dimensions to keep" token_help="The result is insensitive to this parameter when `weighted_by_sd` is set, as long as it is large enough, e.g. 30."> | |
| 229 <param argument="n_comps" type="integer" value="@VALUE@" label="@LABEL@" help="@HELP@"/> | |
| 230 </xml> | |
| 231 <xml name="param_meme_table"> | |
| 232 <param name="motifs" type="select" label="Select list of transcription factor motifs"> | |
| 233 <options from_data_table="meme"> | |
| 234 <filter type="sort_by" column="2" /> | |
| 235 </options> | |
| 236 </param> | |
| 237 </xml> | |
| 238 | |
| 239 | |
| 240 <!-- test section --> | |
| 241 <xml name="test_param_render_plot"> | |
| 242 <param name="width" value="650"/> | |
| 243 <param name="height" value="450"/> | |
| 244 </xml> | |
| 245 <xml name="test_render_plot_matching_text"> | |
| 246 <has_text_matching expression="width = 650"/> | |
| 247 <has_text_matching expression="height = 450"/> | |
| 248 </xml> | |
| 249 | |
| 250 | |
| 251 <xml name="citations"> | |
| 252 <citations> | |
| 253 <citation type="doi">10.1038/s41592-023-02139-9</citation> | |
| 254 </citations> | |
| 255 </xml> | |
| 256 </macros> |
