diff --git a/bio/sexdeterrmine/environment.linux-64.pin.txt b/bio/sexdeterrmine/environment.linux-64.pin.txt new file mode 100644 index 00000000000..22c3abb4440 --- /dev/null +++ b/bio/sexdeterrmine/environment.linux-64.pin.txt @@ -0,0 +1,29 @@ +# This file may be used to create an environment using: +# $ conda create --name --file +# platform: linux-64 +# created-by: conda 24.9.2 +@EXPLICIT +https://conda.anaconda.org/conda-forge/linux-64/_libgcc_mutex-0.1-conda_forge.tar.bz2#d7c89558ba9fa0495403155b64376d81 +https://conda.anaconda.org/conda-forge/linux-64/ca-certificates-2024.8.30-hbcca054_0.conda#c27d1c142233b5bc9ca570c6e2e0c244 +https://conda.anaconda.org/conda-forge/linux-64/ld_impl_linux-64-2.43-h712a8e2_2.conda#048b02e3962f066da18efe3a21b77672 +https://conda.anaconda.org/conda-forge/linux-64/python_abi-3.13-5_cp313.conda#381bbd2a92c863f640a55b6ff3c35161 +https://conda.anaconda.org/conda-forge/noarch/tzdata-2024b-hc8b5060_0.conda#8ac3367aafb1cc0a068483c580af8015 +https://conda.anaconda.org/conda-forge/linux-64/libgomp-14.2.0-h77fa898_1.conda#cc3573974587f12dda90d96e3e55a702 +https://conda.anaconda.org/conda-forge/linux-64/_openmp_mutex-4.5-2_gnu.tar.bz2#73aaf86a425cc6e73fcf236a5a46396d +https://conda.anaconda.org/conda-forge/linux-64/libgcc-14.2.0-h77fa898_1.conda#3cb76c3f10d3bc7f1105b2fc9db984df +https://conda.anaconda.org/conda-forge/linux-64/libexpat-2.6.4-h5888daf_0.conda#db833e03127376d461e1e13e76f09b6c +https://conda.anaconda.org/conda-forge/linux-64/libgcc-ng-14.2.0-h69a702a_1.conda#e39480b9ca41323497b05492a63bc35b +https://conda.anaconda.org/conda-forge/linux-64/libzlib-1.3.1-hb9d3cd8_2.conda#edb0dca6bc32e4f4789199455a1dbeb8 +https://conda.anaconda.org/conda-forge/linux-64/openssl-3.4.0-hb9d3cd8_0.conda#23cc74f77eb99315c0360ec3533147a9 +https://conda.anaconda.org/conda-forge/linux-64/bzip2-1.0.8-h4bc722e_7.conda#62ee74e96c5ebb0af99386de58cf9553 +https://conda.anaconda.org/conda-forge/linux-64/libffi-3.4.2-h7f98852_5.tar.bz2#d645c6d2ac96843a2bfaccd2d62b3ac3 +https://conda.anaconda.org/conda-forge/linux-64/libmpdec-4.0.0-h4bc722e_0.conda#aeb98fdeb2e8f25d43ef71fbacbeec80 +https://conda.anaconda.org/conda-forge/linux-64/libsqlite-3.47.0-hadc24fc_1.conda#b6f02b52a174e612e89548f4663ce56a +https://conda.anaconda.org/conda-forge/linux-64/libuuid-2.38.1-h0b41bf4_0.conda#40b61aab5c7ba9ff276c41cfffe6b80b +https://conda.anaconda.org/conda-forge/linux-64/ncurses-6.5-he02047a_1.conda#70caf8bb6cf39a0b6b7efc885f51c0fe +https://conda.anaconda.org/conda-forge/linux-64/tk-8.6.13-noxft_h4845f30_101.conda#d453b98d9c83e71da0741bb0ff4d76bc +https://conda.anaconda.org/conda-forge/linux-64/xz-5.2.6-h166bdaf_0.tar.bz2#2161070d867d1b1204ea749c8eec4ef0 +https://conda.anaconda.org/conda-forge/linux-64/readline-8.2-h8228510_1.conda#47d31b792659ce70f470b5c82fdfb7a4 +https://conda.anaconda.org/conda-forge/linux-64/python-3.13.0-h9ebbce0_100_cp313.conda#08e9aef080f33daeb192b2ddc7e4721f +https://conda.anaconda.org/conda-forge/noarch/pip-24.3.1-pyh145f28c_0.conda#ca3afe2d7b893a8c8cdf489d30a2b1a3 +https://conda.anaconda.org/bioconda/noarch/sexdeterrmine-1.1.2-hdfd78af_1.tar.bz2#2e9b8e1a34bf366825e78812da25b66a diff --git a/bio/sexdeterrmine/environment.yaml b/bio/sexdeterrmine/environment.yaml new file mode 100644 index 00000000000..a7a379fafc0 --- /dev/null +++ b/bio/sexdeterrmine/environment.yaml @@ -0,0 +1,6 @@ +channels: + - bioconda + - conda-forge + - nodefaults +dependencies: + - sexdeterrmine=1.1.2 diff --git a/bio/sexdeterrmine/meta.yaml b/bio/sexdeterrmine/meta.yaml new file mode 100644 index 00000000000..fee52cf0a4f --- /dev/null +++ b/bio/sexdeterrmine/meta.yaml @@ -0,0 +1,13 @@ +name: Sex.detERRmine +description: | + calculate the relative coverage of X and Y chromosomes, and their associated error bars, out of capture data. +authors: + - Thibault Dayris +input: + - depth: Path to samtools depths file accross multiple samples with a header line giving sample names. +output: + - Path to result table +params: + - No extra parameters handled. +notes: | + See depth header format at: https://github.com/TCLamnidis/Sex.DetERRmine/tree/master?tab=readme-ov-file#instructions diff --git a/bio/sexdeterrmine/test/Snakefile b/bio/sexdeterrmine/test/Snakefile new file mode 100644 index 00000000000..aa5e531295b --- /dev/null +++ b/bio/sexdeterrmine/test/Snakefile @@ -0,0 +1,11 @@ +rule test_sexdeterrmine: + input: + depth="samples.depth.tsv", + output: + tsv="results.tsv", + json="results.json", + threads: 1 + log: + "sexdeterrmine.log", + wrapper: + "master/bio/sexdeterrmine" diff --git a/bio/sexdeterrmine/test/samples.depth.tsv b/bio/sexdeterrmine/test/samples.depth.tsv new file mode 100644 index 00000000000..abdedea322b --- /dev/null +++ b/bio/sexdeterrmine/test/samples.depth.tsv @@ -0,0 +1,5 @@ +#Chr Pos Sample1 Sample2 Sample3 Sample4 Sample5 +1 752566 1 1 1 1 1 +X 776546 0 0 0 0 1 +Y 832918 0 1 0 0 0 +Y 842013 0 1 0 3 1 diff --git a/bio/sexdeterrmine/wrapper.py b/bio/sexdeterrmine/wrapper.py new file mode 100644 index 00000000000..64236f7de6f --- /dev/null +++ b/bio/sexdeterrmine/wrapper.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +"""Snakemake wrapper for Sex.DetERRmine""" + +__author__ = "Thibault Dayris" +__copyright__ = "Copyright 2024, Thibault Dayris" +__email__ = "thibault.dayris@gustaveroussy.fr" +__license__ = "MIT" + +from snakemake.shell import shell +from tempfile import TemporaryDirectory + +import os +import os.path + +log = snakemake.log_fmt_shell( + stdout=False, + stderr=True, + append=False, +) +extra = snakemake.params.get("extra", "") + +with TemporaryDirectory() as tempdir: + old_path = os.getcwd() + depth_path = os.path.realpath(snakemake.input.depth) + os.chdir(tempdir) + shell(f"sexdeterrmine --Input {depth_path} {extra} > out.tsv 2> sexdeterrmine.log") + + log = snakemake.log_fmt_shell( + stdout=True, + stderr=True, + append=True, + ) + + os.chdir(old_path) + os.replace(f"{tempdir}/sexdeterrmine.log", str(snakemake.log)) + + tsv = snakemake.output.get("tsv") + if tsv: + shell("mv --verbose {tempdir}/out.tsv {tsv} {log}") + + json = snakemake.output.get("json") + if json: + shell("mv --verbose {tempdir}/sexdeterrmine.json {json} {log}") diff --git a/test_wrappers.py b/test_wrappers.py index fc308040490..5c47f4ea9b8 100644 --- a/test_wrappers.py +++ b/test_wrappers.py @@ -4615,6 +4615,12 @@ def test_gseapy_gsea(run): ) +def test_sexdeterrmine(run): + run( + "bio/sexdeterrmine", + ["snakemake", "--cores", "1", "results.tsv", "-F", "--use-conda"], + ) + def test_sourmash_compute(run): run( "bio/sourmash/compute/",