Next changeset 1:cec3e76eaf05 (2024-05-23) |
Commit message:
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/snapatac2 commit be132b56781bede5dc6e020aa80ca315546666cd |
added:
macros.xml preprocessing.xml |
b |
diff -r 000000000000 -r 00a6721e1f81 macros.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/macros.xml Thu May 16 13:17:14 2024 +0000 |
[ |
b'@@ -0,0 +1,187 @@\n+<macros>\n+\t<token name="@TOOL_VERSION@">2.5.3</token>\n+ <token name="@VERSION_SUFFIX@">0</token>\n+ <token name="@PROFILE@">23.0</token>\n+ <xml name="requirements">\n+ <requirement type="package" version="@TOOL_VERSION@">snapatac2</requirement>\n+ <requirement type="package" version="5.18.0">plotly</requirement>\n+ <requirement type="package" version="0.2.1">python-kaleido</requirement>\n+ <requirement type="package" version="0.19.19">polars</requirement>\n+ <requirement type="package" version="14.0.1">pyarrow</requirement>\n+ <requirement type="package" version="0.11.3">python-igraph</requirement>\n+ <requirement type="package" version="0.8.33">hdbscan</requirement>\n+ <requirement type="package" version="0.0.9">harmonypy</requirement>\n+ <requirement type="package" version="1.7.4">scanorama</requirement>\n+ <yield />\n+ </xml>\n+\n+ <token name="@PREP_ADATA@"><![CDATA[\n+ cp \'$method.adata\' \'anndata.h5ad\' &&\n+ ]]>\n+ </token>\n+\n+ <token name="@CMD@"><![CDATA[\n+ cat \'$script_file\' > \'$hidden_output\' &&\n+ python \'$script_file\' >> \'$hidden_output\' &&\n+\t\ttouch \'anndata_info.txt\' &&\n+\t\tcat \'anndata_info.txt\' @CMD_prettify_stdout@\n+ ]]>\n+ </token>\n+\n+ <token name="@CMD_prettify_stdout@"><![CDATA[ | 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\'\n+ ]]></token>\n+\n+ <token name="@CMD_imports@"><![CDATA[\n+import snapatac2 as sa\n+import os\n+ ]]>\n+ </token>\n+ <xml name="sanitize_query" token_validinitial="string.printable">\n+ <sanitizer>\n+ <valid initial="@VALIDINITIAL@">\n+ <remove value="'" />\n+ </valid>\n+ </sanitizer>\n+ </xml>\n+\n+ <xml name="inputs_anndata">\n+ <param name="adata" type="data" format="h5ad" label="Annotated data matrix"/>\n+ </xml>\n+\n+ <token name="@CMD_read_inputs@"><![CDATA[\n+\n+adata = sa.read(\'anndata.h5ad\', backed = None)\n+]]>\n+ </token>\n+\n+ <xml name="dimentions_plot">\n+ <param argument="width" type="integer" value="500" label="Width of the plot"/>\n+\t\t<param argument="height" type="integer" value="400" label="Height of the plot"/>\n+ </xml>\n+\n+ <xml name="param_groupby">\n+ <param argument="groupby" type="text" label="The key of the observation grouping to consider">\n+ <expand macro="sanitize_query" />\n+ </param>\n+ </xml>\n+\n+ <xml name="out_file">\n+ <param name="out_file" type="select" optional="true" label="Type of output file">\n+ <option value="png" selected="true">PNG</option>\n+ <option value="svg">SVG</option>\n+ <option value="pdf">PDF</option>\n+\t\t</param>\n+ </xml>\n+ <token name="@CMD_anndata_write_outputs@"><![CDATA[\n+adata.write(\'anndata.h5ad\')\n+with open(\'anndata_info.txt\',\'w\', encoding=\'utf-8\') as ainfo:\n+ print(adata, file=ainfo)\n+]]>\n+ </token>\n+ <xml name="inputs_common_advanced">\n+ <section name="advanced_common" title="Advanced Options" expanded="false">\n+ <param name="show_log" type="boolean" checked="false" label="Output Log?" />\n+ </section>\n+ </xml>\n+ <xml name="params_render_plot">\n+ <param argument="width" type="integer" value="600" label="Width of the plot"/>\n+ <param argument="height" type="integer" value="400" label="Height of the plot"/>\n+ <expand macro="out_file"/>\n+ </xml>\n+ <xml name="param_shift">\n+ \t<param argument="shift_left" type="integer" value="4" label="Insertion site correction for the left end" help="Note this has no effect on single-end reads"/>\n+ \t<param argument="shift_right" type="integer" value="-5" label="Insertion site correction for the right end" help="Note this has no effect on single-end reads"/>\n+ </xml>\n+ <xml name="param_chunk_size" tokens="size">\n+ \t<param argument="chunk_size" ty'..b'nt="use_rep" type="text" value="X_spectral" label="The key for the matrix"/>\n+\t\t<param argument="use_dims" type="text" optional="true" value="" label="The dimensions used for computation">\n+\t\t\t<expand macro="sanitize_query"/>\n+\t\t</param>\n+\t\t<param argument="groupby" type="text" optional="true" value="" label="The key of the observation grouping to consider">\n+ <expand macro="sanitize_query" />\n+ </param>\n+\t\t<param argument="key_added" type="text" optional="true" value="" label="If specified, add the result to adata.obsm with this key"/>\n+\t</xml>\n+ <xml name="param_n_comps">\n+s <param argument="n_comps" type="integer" value="30" label="Number of dimensions to keep" help="The result is insensitive to this parameter when `weighted_by_sd` is set, as long as it is large enough, e.g. 30."/>\n+ </xml>\n+ <xml name="param_random_state">\n+ <param argument="random_state" type="integer" value="0" label="Seed of the random state generator"/>\n+ </xml>\n+ <xml name="param_key_added" tokens="key_added">\n+ <param argument="key_added" type="text" value="@KEY_ADDED@" label="`adata.obs` key under which t add cluster labels"/>\n+ </xml>\n+ <xml name="param_use_rep">\n+ <param argument="use_rep" type="text" value="X_spectral" label="Use the indicated representation in `.obsm`"/>\n+ </xml>\n+ <xml name="genome_fasta">\n+ <param argument="genome_fasta" type="text" label="A fasta file containing the genome sequences or a Genome object"/>\n+ </xml>\n+ <xml name="background">\n+ <param argument="background" type="text" optional="true" value="" label="A list of regions to be used as the background">\n+\t\t\t<expand macro="sanitize_query"/>\n+\t\t</param>\n+ </xml>\n+ <xml name="mat">\n+ <param argument="peak_mat" type="data" format="h5ad" optional="true" label="AnnData or AnnDataSet object storing the cell by peak count matrix"/>\n+\t\t<param argument="gene_mat" type="data" format="h5ad" optional="true" label="AnnData or AnnDataSet object storing the cell by gene count matrix"/>\n+ </xml>\n+ <xml name="param_network">\n+ <param argument="network" type="text" label="network"/>\n+ </xml>\n+ <xml name="param_n_iterations">\n+ <param argument="n_iterations" type="integer" value="-1" label="How many iterations of the Leiden clustering algorithm to perform"\n+ help="Positive values above 2 define the total number of iterations to perform, -1 has the algorithm run until it reaches its optimal clustering."/>\n+ </xml>\n+\n+ <xml name="citations">\n+ <citations>\n+ <citation type="doi">10.1038/s41592-023-02139-9</citation>\n+ </citations>\n+ </xml>\n+ <xml name="render_plot_test">\n+ \t<param name="width" value="650"/>\n+ <param name="height" value="450"/>\n+ </xml>\n+ <xml name="render_plot_matching_text">\n+ \t<has_text_matching expression="width = 650"/>\n+ <has_text_matching expression="height = 450"/>\n+ </xml>\n+ <xml name="param_counting_strategy">\n+ <param argument="counting_strategy" type="select" label="he strategy to compute feature counts">\n+ <option value="fragment">fragment</option>\n+ <option value="insertion" selected="true">insertion</option>\n+ <option value="paired-insertion">paired-insertion</option>\n+ </param>\n+ </xml>\n+\n+ <token name="@CMD_params_data_integration@"><![CDATA[\n+use_rep = \'$method.use_rep\',\n+#if $method.use_dims != \'\'\n+#set $dims = ([x.strip() for x in str($method.use_dims).split(\',\')])\n+use_dims=$dims,\n+#end if\n+#if $method.groupby != \'\'\n+#set $groupby = ([x.strip() for x in str($method.groupby).split(\',\')])\n+groupby=$groupby,\n+#end if\n+#if $method.key_added != \'\'\n+key_added = \'$method.key_added\',\n+#end if\n+ ]]>\n+ </token>\n+\n+ <token name="@CMD_params_render_plot@"><![CDATA[\n+ width = $method.width,\n+ height = $method.height,\n+ out_file = \'plot.$method.out_file\',\n+ ]]>\n+ </token>\n+</macros>\n' |
b |
diff -r 000000000000 -r 00a6721e1f81 preprocessing.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/preprocessing.xml Thu May 16 13:17:14 2024 +0000 |
[ |
b'@@ -0,0 +1,580 @@\n+<tool id="snapatac2_preprocessing" name="SnapATAC2 Preprocessing" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">\n+ <description>and integration</description>\n+ <macros>\n+ <import>macros.xml</import>\n+ </macros>\n+ <requirements>\n+ <expand macro="requirements"/>\n+ </requirements>\n+ <command detect_errors="exit_code"><![CDATA[\n+#if $method.method != \'pp.make_fragment_file\' and $method.method != \'pp.import_data\'\n+@PREP_ADATA@\n+#end if\n+@CMD@\n+ ]]></command>\n+ <configfiles>\n+ <configfile name="script_file"><![CDATA[\n+@CMD_imports@\n+\n+#if $method.method != \'pp.make_fragment_file\' and $method.method != \'pp.import_data\'\n+@CMD_read_inputs@\n+#end if\n+\n+#if $method.method == \'pp.make_fragment_file\'\n+sa.pp.make_fragment_file(\n+\tbam_file = \'$method.bam_file\',\n+\tis_paired = $method.is_paired,\n+\t#if $method.barcode.extract_type == \'from_tag\'\n+\t\t#if $method.barcode.barcode_tag != \'\'\n+\tbarcode_tag = \'$method.barcode.barcode_tag\',\n+\t\t#end if\n+\t#elif $method.barcode.extract_type == \'from_read_names\'\n+\t\t#if $method.barcode.barcode_regex != \'\'\n+\tbarcode_regex = \'$method.barcode.barcode_regex\',\n+\t\t#end if\n+\t#end if\n+\t#if $method.umi_tag != \'\'\n+\tumi_tag = \'$method.umi_tag\',\n+\t#end if\n+\t#if $method.umi_regex != \'\'\n+\tumi_regex = \'$method.umi_regex\',\n+\t#end if\n+\tshift_right = $method.shift_right,\n+\tshift_left = $method.shift_left,\n+\tmin_mapq = $method.min_mapq,\n+\tchunk_size = $method.chunk_size,\n+\tcompression = \'gzip\',\n+\toutput_file = \'$fragments_out\',\n+\ttempdir = "."\n+)\n+\n+#else if $method.method == \'pp.import_data\'\n+import csv\n+with open(\'$method.chrom_sizes\') as f:\n+ chr_sizes = {x[0]:int(x[1]) for x in csv.reader(f, delimiter=\'\\t\')}\n+\n+sa.pp.import_data(\n+\tfragment_file = \'$method.fragment_file\',\n+\tchrom_sizes = chr_sizes,\n+\tmin_num_fragments = $method.min_num_fragments,\n+\tsorted_by_barcode = $method.sorted_by_barcode,\n+\t#if str($method.whitelist) != \'None\'\n+\twhitelist = \'$method.whitelist\',\n+\t#end if\n+\tshift_left = $method.shift_left,\n+\tshift_right = $method.shift_right,\n+\t#set $chr_mt = ([x.strip() for x in str($method.chrM).split(\',\')])\n+\tchrM = $chr_mt,\n+\tchunk_size = $method.chunk_size,\n+\tfile = \'anndata.h5ad\',\n+\tn_jobs = os.getenv("GALAXY_SLOTS", 4)\n+)\n+\n+#else if $method.method == \'pp.add_tile_matrix\'\n+sa.pp.add_tile_matrix(\n+\tadata,\n+\tbin_size = $method.bin_size,\n+\tinplace = True,\n+\tchunk_size = $method.chunk_size,\n+\t#if $method.exclude_chroms != \'\'\n+\t#set $excl_chroms = ([x.strip() for x in str($method.exclude_chroms).split(\',\')])\n+\texclude_chroms = $excl_chroms,\n+\t#end if\n+\t#if $method.min_frag_size\n+\tmin_frag_size = $method.min_frag_size,\n+\t#end if\n+\t#if $method.max_frag_size\n+\tmax_frag_size = $method.max_frag_size,\n+\t#end if\n+\t##counting_strategy = \'$method.counting_strategy\',\n+\tcount_frag_as_reads = $method.count_frag_as_reads,\n+\tn_jobs = os.getenv("GALAXY_SLOTS", 4)\n+)\n+\n+#else if $method.method == \'pp.make_gene_matrix\'\n+sa.pp.make_gene_matrix(\n+\tadata,\n+\tgene_anno = \'$method.gene_anno\',\n+\tinplace = True,\n+\tchunk_size = $method.chunk_size,\n+\tuse_x = $method.use_x,\n+\tid_type = \'$method.id_type\',\n+\ttranscript_name_key = \'$method.transcript_name_key\',\n+\ttranscript_id_key = \'$method.transcript_id_key\',\n+\tgene_name_key = \'$method.gene_name_key\',\n+\tgene_id_key = \'$method.gene_id_key\',\n+\t#if $method.min_frag_size\n+\tmin_frag_size = $method.min_frag_size,\n+\t#end if\n+\t#if $method.max_frag_size\n+\tmax_frag_size = $method.max_frag_size,\n+\t#end if\n+\t##counting_strategy = \'$method.counting_strategy\'\n+\tcount_frag_as_reads = $method.count_frag_as_reads\n+)\n+\n+#else if $method.method == \'pp.filter_cells\'\n+sa.pp.filter_cells(\n+\tadata,\n+\tmin_counts = $method.min_counts,\n+\tmin_tsse = $method.min_tsse,\n+\t#if $method.max_counts\n+\tmax_counts = $method.max_counts,\n+\t#end if\n+\t#if $method.max_tsse\n+\tmax_tsse = $method.max_tsse,\n+\t#end if\n+\tinplace = True,\n+\tn_jobs = os.getenv("GALAXY_SLOTS", 4)\n+)\n+\n+#else if $method.method == \'pp.select_features\'\n+sa.pp.select_features(\n+'..b' doublets using randomly pairing chromatin accessibility profiles of individual cells. The simulated doublets are then embedded alongside the original cells using the spectral embedding algorithm in this package. A k-nearest-neighbor classifier is trained to distinguish between the simulated doublets and the authentic cells. This trained classifier produces a \xe2\x80\x9cdoublet score\xe2\x80\x9d for each cell. The doublet scores are then converted into probabilities using a Gaussian mixture model.\n+\n+More details on the `SnapATAC2 documentation\n+<https://kzhang.org/SnapATAC2/api/_autosummary/snapatac2.pp.scrublet.html>`__\n+\n+Remove doublets according to the doublet probability or doublet score, using `pp.filter_doublets`\n+=================================================================================================\n+\n+Remove doublets according to the doublet probability or doublet score.\n+\n+The user can choose to remove doublets by either the doublet probability or the doublet score. `scrublet` must be ran first in order to use this function.\n+\n+More details on the `SnapATAC2 documentation\n+<https://kzhang.org/SnapATAC2/api/_autosummary/snapatac2.pp.filter_doublets.html>`__\n+\n+A modified MNN-Correct algorithm based on cluster centroid, using `pp.mnc_correct`\n+==================================================================================\n+\n+A modified MNN-Correct algorithm based on cluster centroid.\n+\n+More details on the `SnapATAC2 documentation\n+<https://kzhang.org/SnapATAC2/api/_autosummary/snapatac2.pp.mnc_correct.html>`__\n+\n+Use harmonypy to integrate different experiments,using `pp.harmony`\n+===================================================================\n+\n+Use harmonypy to integrate different experiments.\n+\n+Harmony is an algorithm for integrating single-cell data from multiple experiments. This function uses the python port of Harmony, `harmonypy`, to integrate single-cell data stored in an AnnData object. This function should be run after performing dimension reduction.\n+\n+More details on the `SnapATAC2 documentation\n+<https://kzhang.org/SnapATAC2/api/_autosummary/snapatac2.pp.harmony.html>`__\n+\n+Use Scanorama to integrate different experiments, using `pp.scanorama_integrate`\n+========================================================================================\n+\n+Use Scanorama to integrate different experiments.\n+\n+Scanorama is an algorithm for integrating single-cell data from multiple experiments stored in an AnnData object. This function should be run after performing `tl.spectral` but before computing the neighbor graph.\n+\n+More details on the `SnapATAC2 documentation\n+<https://kzhang.org/SnapATAC2/api/_autosummary/snapatac2.pp.scanorama_integrate.html>`__\n+\n+Compute the fragment size distribution of the dataset, using `metrics.frag_size_distr`\n+======================================================================================\n+\n+Compute the fragment size distribution of the dataset.\n+\n+This function computes the fragment size distribution of the dataset. Note that it does not operate at the single-cell level. The result is stored in a vector where each element represents the number of fragments and the index represents the fragment length. The first posision of the vector is reserved for fragments with size larger than the `max_recorded_size` parameter. `import_data` must be ran first in order to use this function.\n+\n+More details on the `SnapATAC2 documentation\n+<https://kzhang.org/SnapATAC2/api/_autosummary/snapatac2.metrics.frag_size_distr.html>`__\n+\n+Compute the TSS enrichment score (TSSe) for each cell, using `metrics.tsse`\n+===========================================================================\n+\n+Compute the TSS enrichment score (TSSe) for each cell.\n+\n+`import_data` must be ran first in order to use this function.\n+\n+More details on the `SnapATAC2 documentation\n+<https://kzhang.org/SnapATAC2/api/_autosummary/snapatac2.metrics.tsse.html>`__\n+\n+ ]]></help>\n+ <expand macro="citations"/>\n+</tool>\n' |