Skip to content

Commit 847ab1d

Browse files
tdayristdayristdayrisjohanneskoestergithub-actions[bot]
authored
feat: All ngsderive subcommands (#2732)
<!-- Ensure that the PR title follows conventional commit style (<type>: <description>)--> <!-- Possible types are here: https://github.com/commitizen/conventional-commit-types/blob/master/index.json --> <!-- Add a description of your PR here--> This PR adds all [ngsderive](https://github.com/stjudecloud/ngsderive) subcommands in a single wrapper, just like XSV and SeqKit. ### QC <!-- Make sure that you can tick the boxes below. --> * [X] I confirm that: For all wrappers added by this PR, * there is a test case which covers any introduced changes, * `input:` and `output:` file paths in the resulting rule can be changed arbitrarily, * either the wrapper can only use a single core, or the example rule contains a `threads: x` statement with `x` being a reasonable default, * rule names in the test case are in [snake_case](https://en.wikipedia.org/wiki/Snake_case) and somehow tell what the rule is about or match the tools purpose or name (e.g., `map_reads` for a step that maps reads), * all `environment.yaml` specifications follow [the respective best practices](https://stackoverflow.com/a/64594513/2352071), * the `environment.yaml` pinning has been updated by running `snakedeploy pin-conda-envs environment.yaml` on a linux machine, * wherever possible, command line arguments are inferred and set automatically (e.g. based on file extensions in `input:` or `output:`), * all fields of the example rules in the `Snakefile`s and their entries are explained via comments (`input:`/`output:`/`params:` etc.), * `stderr` and/or `stdout` are logged correctly (`log:`), depending on the wrapped tool, * temporary files are either written to a unique hidden folder in the working directory, or (better) stored where the Python function `tempfile.gettempdir()` points to (see [here](https://docs.python.org/3/library/tempfile.html#tempfile.gettempdir); this also means that using any Python `tempfile` default behavior works), * the `meta.yaml` contains a link to the documentation of the respective tool or command, * `Snakefile`s pass the linting (`snakemake --lint`), * `Snakefile`s are formatted with [snakefmt](https://github.com/snakemake/snakefmt), * Python wrapper scripts are formatted with [black](https://black.readthedocs.io). * Conda environments use a minimal amount of channels, in recommended ordering. E.g. for bioconda, use (conda-forge, bioconda, nodefaults, as conda-forge should have highest priority and defaults channels are usually not needed because most packages are in conda-forge nowadays). --------- Co-authored-by: tdayris <[email protected]> Co-authored-by: tdayris <[email protected]> Co-authored-by: Johannes Köster <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: snakedeploy-bot[bot] <115615832+snakedeploy-bot[bot]@users.noreply.github.com> Co-authored-by: Felix Mölder <[email protected]> Co-authored-by: Christopher Schröder <[email protected]> Co-authored-by: Filipe G. Vieira <[email protected]>
1 parent 9c8cf81 commit 847ab1d

File tree

10 files changed

+315
-0
lines changed

10 files changed

+315
-0
lines changed
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
# This file may be used to create an environment using:
2+
# $ conda create --name <env> --file <this file>
3+
# platform: linux-64
4+
@EXPLICIT
5+
https://conda.anaconda.org/conda-forge/linux-64/_libgcc_mutex-0.1-conda_forge.tar.bz2#d7c89558ba9fa0495403155b64376d81
6+
https://conda.anaconda.org/conda-forge/linux-64/ca-certificates-2024.2.2-hbcca054_0.conda#2f4327a1cbe7f022401b236e915a5fef
7+
https://conda.anaconda.org/conda-forge/linux-64/ld_impl_linux-64-2.40-h41732ed_0.conda#7aca3059a1729aa76c597603f10b0dd3
8+
https://conda.anaconda.org/conda-forge/linux-64/libstdcxx-ng-13.2.0-h7e041cc_5.conda#f6f6600d18a4047b54f803cf708b868a
9+
https://conda.anaconda.org/conda-forge/linux-64/python_abi-3.9-4_cp39.conda#bfe4b3259a8ac6cdf0037752904da6a7
10+
https://conda.anaconda.org/conda-forge/noarch/tzdata-2024a-h0c530f3_0.conda#161081fc7cec0bfda0d86d7cb595f8d8
11+
https://conda.anaconda.org/conda-forge/linux-64/libgomp-13.2.0-h807b86a_5.conda#d211c42b9ce49aee3734fdc828731689
12+
https://conda.anaconda.org/conda-forge/linux-64/_openmp_mutex-4.5-2_gnu.tar.bz2#73aaf86a425cc6e73fcf236a5a46396d
13+
https://conda.anaconda.org/conda-forge/linux-64/libgcc-ng-13.2.0-h807b86a_5.conda#d4ff227c46917d3b4565302a2bbb276b
14+
https://conda.anaconda.org/conda-forge/linux-64/aws-c-common-0.9.13-hd590300_0.conda#0ba89522712d993987e6d0fae108c721
15+
https://conda.anaconda.org/conda-forge/linux-64/bzip2-1.0.8-hd590300_5.conda#69b8b6202a07720f448be700e300ccf4
16+
https://conda.anaconda.org/conda-forge/linux-64/c-ares-1.27.0-hd590300_0.conda#f6afff0e9ee08d2f1b897881a4f38cdb
17+
https://conda.anaconda.org/conda-forge/linux-64/gflags-2.2.2-he1b5a44_1004.tar.bz2#cddaf2c63ea4a5901cf09524c490ecdc
18+
https://conda.anaconda.org/conda-forge/linux-64/icu-73.2-h59595ed_0.conda#cc47e1facc155f91abd89b11e48e72ff
19+
https://conda.anaconda.org/conda-forge/linux-64/keyutils-1.6.1-h166bdaf_0.tar.bz2#30186d27e2c9fa62b45fb1476b7200e3
20+
https://conda.anaconda.org/conda-forge/linux-64/libabseil-20240116.1-cxx17_h59595ed_2.conda#75648bc5dd3b8eab22406876c24d81ec
21+
https://conda.anaconda.org/conda-forge/linux-64/libbrotlicommon-1.1.0-hd590300_1.conda#aec6c91c7371c26392a06708a73c70e5
22+
https://conda.anaconda.org/conda-forge/linux-64/libcrc32c-1.1.2-h9c3ff4c_0.tar.bz2#c965a5aa0d5c1c37ffc62dff36e28400
23+
https://conda.anaconda.org/conda-forge/linux-64/libdeflate-1.18-h0b41bf4_0.conda#6aa9c9de5542ecb07fdda9ca626252d8
24+
https://conda.anaconda.org/conda-forge/linux-64/libev-4.33-hd590300_2.conda#172bf1cd1ff8629f2b1179945ed45055
25+
https://conda.anaconda.org/conda-forge/linux-64/libffi-3.4.2-h7f98852_5.tar.bz2#d645c6d2ac96843a2bfaccd2d62b3ac3
26+
https://conda.anaconda.org/conda-forge/linux-64/libgfortran5-13.2.0-ha4646dd_5.conda#7a6bd7a12a4bd359e2afe6c0fa1acace
27+
https://conda.anaconda.org/conda-forge/linux-64/libiconv-1.17-hd590300_2.conda#d66573916ffcf376178462f1b61c941e
28+
https://conda.anaconda.org/conda-forge/linux-64/libnl-3.9.0-hd590300_0.conda#d27c451db4f1d3c983c78167d2fdabc2
29+
https://conda.anaconda.org/conda-forge/linux-64/libnsl-2.0.1-hd590300_0.conda#30fd6e37fe21f86f4bd26d6ee73eeec7
30+
https://conda.anaconda.org/conda-forge/linux-64/libnuma-2.0.16-h0b41bf4_1.conda#28bfe2cb11357ccc5be21101a6b7ce86
31+
https://conda.anaconda.org/conda-forge/linux-64/libutf8proc-2.8.0-h166bdaf_0.tar.bz2#ede4266dc02e875fe1ea77b25dd43747
32+
https://conda.anaconda.org/conda-forge/linux-64/libuuid-2.38.1-h0b41bf4_0.conda#40b61aab5c7ba9ff276c41cfffe6b80b
33+
https://conda.anaconda.org/conda-forge/linux-64/libxcrypt-4.4.36-hd590300_1.conda#5aa797f8787fe7a17d1b0821485b5adc
34+
https://conda.anaconda.org/conda-forge/linux-64/libzlib-1.2.13-hd590300_5.conda#f36c115f1ee199da648e0597ec2047ad
35+
https://conda.anaconda.org/conda-forge/linux-64/lz4-c-1.9.4-hcb278e6_0.conda#318b08df404f9c9be5712aaa5a6f0bb0
36+
https://conda.anaconda.org/conda-forge/linux-64/ncurses-6.4-h59595ed_2.conda#7dbaa197d7ba6032caf7ae7f32c1efa0
37+
https://conda.anaconda.org/conda-forge/linux-64/openssl-3.2.1-hd590300_0.conda#51a753e64a3027bd7e23a189b1f6e91e
38+
https://conda.anaconda.org/conda-forge/linux-64/snappy-1.1.10-h9fff704_0.conda#e6d228cd0bb74a51dd18f5bfce0b4115
39+
https://conda.anaconda.org/conda-forge/linux-64/xz-5.2.6-h166bdaf_0.tar.bz2#2161070d867d1b1204ea749c8eec4ef0
40+
https://conda.anaconda.org/conda-forge/linux-64/aws-c-cal-0.6.10-hb29e0c7_1.conda#2400ab35ff4eec4fab57e06e7acd3c2a
41+
https://conda.anaconda.org/conda-forge/linux-64/aws-c-compression-0.2.18-hecc5fa9_1.conda#1d838050e7d65d2f38dc3b84b928aa2b
42+
https://conda.anaconda.org/conda-forge/linux-64/aws-c-sdkutils-0.1.15-hecc5fa9_1.conda#1f3169bc679a1ead5b44a6c79408add7
43+
https://conda.anaconda.org/conda-forge/linux-64/aws-checksums-0.1.18-hecc5fa9_1.conda#d49175b3e097182a65ba9e3fb2c38603
44+
https://conda.anaconda.org/conda-forge/linux-64/glog-0.7.0-hed5481d_0.conda#a9ea19c48e11754899299f8123070f4e
45+
https://conda.anaconda.org/conda-forge/linux-64/libbrotlidec-1.1.0-hd590300_1.conda#f07002e225d7a60a694d42a7bf5ff53f
46+
https://conda.anaconda.org/conda-forge/linux-64/libbrotlienc-1.1.0-hd590300_1.conda#5fc11c6020d421960607d821310fcd4d
47+
https://conda.anaconda.org/conda-forge/linux-64/libedit-3.1.20191231-he28a2e2_2.tar.bz2#4d331e44109e3f0e19b4cb8f9b82f3e1
48+
https://conda.anaconda.org/conda-forge/linux-64/libevent-2.1.12-hf998b51_1.conda#a1cfcc585f0c42bf8d5546bb1dfb668d
49+
https://conda.anaconda.org/conda-forge/linux-64/libgfortran-ng-13.2.0-h69a702a_5.conda#e73e9cfd1191783392131e6238bdb3e9
50+
https://conda.anaconda.org/conda-forge/linux-64/libnghttp2-1.58.0-h47da74e_1.conda#700ac6ea6d53d5510591c4344d5c989a
51+
https://conda.anaconda.org/conda-forge/linux-64/libprotobuf-4.25.2-h08a7969_1.conda#babbc506d2626698412c2e4ade78a20a
52+
https://conda.anaconda.org/conda-forge/linux-64/libre2-11-2023.09.01-h5a48ba9_2.conda#41c69fba59d495e8cf5ffda48a607e35
53+
https://conda.anaconda.org/conda-forge/linux-64/libsqlite-3.45.1-h2797004_0.conda#fc4ccadfbf6d4784de88c41704792562
54+
https://conda.anaconda.org/conda-forge/linux-64/libssh2-1.11.0-h0841786_0.conda#1f5a58e686b13bcfde88b93f547d23fe
55+
https://conda.anaconda.org/conda-forge/linux-64/libxml2-2.12.5-h232c23b_0.conda#c442ebfda7a475f5e78f1c8e45f1e919
56+
https://conda.anaconda.org/conda-forge/linux-64/rdma-core-50.0-hd3aeb46_0.conda#4594b391274e38f07c668acb45285a1f
57+
https://conda.anaconda.org/conda-forge/linux-64/readline-8.2-h8228510_1.conda#47d31b792659ce70f470b5c82fdfb7a4
58+
https://conda.anaconda.org/conda-forge/linux-64/s2n-1.4.5-h06160fa_0.conda#0d3d9c621239b674ac1b738df00a0793
59+
https://conda.anaconda.org/conda-forge/linux-64/tk-8.6.13-noxft_h4845f30_101.conda#d453b98d9c83e71da0741bb0ff4d76bc
60+
https://conda.anaconda.org/conda-forge/linux-64/zlib-1.2.13-hd590300_5.conda#68c34ec6149623be41a1933ab996a209
61+
https://conda.anaconda.org/conda-forge/linux-64/zstd-1.5.5-hfc55251_0.conda#04b88013080254850d6c01ed54810589
62+
https://conda.anaconda.org/conda-forge/linux-64/aws-c-io-0.14.5-h50678d4_1.conda#3d527c16470bfbf50234c9ce9c3290ee
63+
https://conda.anaconda.org/conda-forge/linux-64/krb5-1.21.2-h659d440_0.conda#cd95826dbd331ed1be26bdf401432844
64+
https://conda.anaconda.org/conda-forge/linux-64/libllvm16-16.0.6-hb3ce162_3.conda#a4d48c40dd5c60edbab7fd69c9a88967
65+
https://conda.anaconda.org/conda-forge/linux-64/libopenblas-0.3.26-pthreads_h413a1c8_0.conda#760ae35415f5ba8b15d09df5afe8b23a
66+
https://conda.anaconda.org/conda-forge/linux-64/libthrift-0.19.0-hb90f79a_1.conda#8cdb7d41faa0260875ba92414c487e2d
67+
https://conda.anaconda.org/conda-forge/linux-64/orc-1.9.2-h00e871a_2.conda#d88b3e7facb31754777da52eb62a2152
68+
https://conda.anaconda.org/conda-forge/linux-64/python-3.9.18-h0755675_1_cpython.conda#255a7002aeec7a067ff19b545aca6328
69+
https://conda.anaconda.org/conda-forge/linux-64/re2-2023.09.01-h7f4b329_2.conda#8f70e36268dea8eb666ef14c29bd3cda
70+
https://conda.anaconda.org/conda-forge/linux-64/ucx-1.15.0-h75e419f_3.conda#5baf4efbca923cdf73490c62cc7de1e2
71+
https://conda.anaconda.org/conda-forge/linux-64/aws-c-event-stream-0.4.2-hf9b2f7b_4.conda#772e5b7c3c3c9dd07a2648cfa95e1c34
72+
https://conda.anaconda.org/conda-forge/linux-64/aws-c-http-0.8.1-h5d7533a_5.conda#3315582ff86ff2c9e870eb5a9ad2a13c
73+
https://conda.anaconda.org/conda-forge/linux-64/colorlog-6.8.2-py39hf3d152e_0.conda#39fb2099b00fdd7a2a80de9e941c2c05
74+
https://conda.anaconda.org/conda-forge/linux-64/libblas-3.9.0-21_linux64_openblas.conda#0ac9f44fc096772b0aa092119b00c3ca
75+
https://conda.anaconda.org/conda-forge/linux-64/libcurl-8.5.0-hca28451_0.conda#7144d5a828e2cae218e0e3c98d8a0aeb
76+
https://conda.anaconda.org/conda-forge/linux-64/libgrpc-1.61.1-h42401df_1.conda#224692c7a317ca23f9e1d5d4b3c8fa93
77+
https://conda.anaconda.org/bioconda/linux-64/pytabix-0.1-py39h4e691d4_4.tar.bz2#3b5351210193b716ad13c8159932f5bb
78+
https://conda.anaconda.org/conda-forge/noarch/python-tzdata-2024.1-pyhd8ed1ab_0.conda#98206ea9954216ee7540f0c773f2104d
79+
https://conda.anaconda.org/conda-forge/noarch/pytz-2024.1-pyhd8ed1ab_0.conda#3eeeeb9e4827ace8c0c1419c85d590ad
80+
https://conda.anaconda.org/conda-forge/noarch/rstr-3.2.2-pyhd8ed1ab_0.conda#8ad5e0007bdeeadf3fd7532a02699fd4
81+
https://conda.anaconda.org/conda-forge/noarch/setuptools-69.1.1-pyhd8ed1ab_0.conda#576de899521b7d43674ba3ef6eae9142
82+
https://conda.anaconda.org/conda-forge/noarch/six-1.16.0-pyh6c4a22f_0.tar.bz2#e5f25f8dbc060e9a8d912e432202afc2
83+
https://conda.anaconda.org/conda-forge/noarch/sortedcontainers-2.4.0-pyhd8ed1ab_0.tar.bz2#6d6552722448103793743dabfbda532d
84+
https://conda.anaconda.org/conda-forge/noarch/typing_extensions-4.10.0-pyha770c72_0.conda#16ae769069b380646c47142d719ef466
85+
https://conda.anaconda.org/conda-forge/noarch/wheel-0.42.0-pyhd8ed1ab_0.conda#1cdea58981c5cbc17b51973bcaddcea7
86+
https://conda.anaconda.org/conda-forge/linux-64/aws-c-auth-0.7.16-h79b3bcb_6.conda#dfc34e202187d7859cb82e2795db1573
87+
https://conda.anaconda.org/conda-forge/linux-64/aws-c-mqtt-0.10.2-hf479d2b_4.conda#dc6a683c823f2b6445ed0e328160b3de
88+
https://conda.anaconda.org/bioconda/linux-64/htslib-1.19.1-h81da01d_2.tar.bz2#ad57eedd99d6722b2f00a8f7d0d71e2a
89+
https://conda.anaconda.org/conda-forge/linux-64/libcblas-3.9.0-21_linux64_openblas.conda#4a3816d06451c4946e2db26b86472cb6
90+
https://conda.anaconda.org/conda-forge/linux-64/libgoogle-cloud-2.21.0-h72bcb37_2.conda#14b15b923b9e45038f4193d06ecf5ae1
91+
https://conda.anaconda.org/conda-forge/linux-64/liblapack-3.9.0-21_linux64_openblas.conda#1a42f305615c3867684e049e85927531
92+
https://conda.anaconda.org/conda-forge/noarch/pip-24.0-pyhd8ed1ab_0.conda#f586ac1e56c8638b64f9c8122a7b8a67
93+
https://conda.anaconda.org/bioconda/linux-64/pysam-0.22.0-py39hcada746_1.tar.bz2#44fe602980bf98c124db2488498c5d36
94+
https://conda.anaconda.org/conda-forge/noarch/python-dateutil-2.9.0-pyhd8ed1ab_0.conda#2cf4264fffb9e6eff6031c5b6884d61c
95+
https://conda.anaconda.org/conda-forge/linux-64/aws-c-s3-0.5.2-h4ad9680_0.conda#d50162d0e3a1c74885d8281455d8e7c2
96+
https://conda.anaconda.org/conda-forge/linux-64/libgoogle-cloud-storage-2.21.0-hc7a4891_2.conda#cc54c794dac0d76eb1adaf6172e9c59e
97+
https://conda.anaconda.org/conda-forge/linux-64/numpy-1.26.4-py39h474f0d3_0.conda#aa265f5697237aa13cc10f53fa8acc4f
98+
https://conda.anaconda.org/bioconda/noarch/tabix-1.11-hdfd78af_0.tar.bz2#cb68d74b5a5ca94b745ce168b1043dfd
99+
https://conda.anaconda.org/conda-forge/linux-64/aws-crt-cpp-0.26.2-h19f5d62_7.conda#e49b978ccc14c1a34374fac693b3a998
100+
https://conda.anaconda.org/conda-forge/linux-64/pandas-2.2.1-py39hddac248_0.conda#85293a042c24a08e71b7608ee66b6134
101+
https://conda.anaconda.org/conda-forge/linux-64/polars-0.20.14-py39h2e8484c_0.conda#d8057e5c2fd2e68f9edd7700c771f6b1
102+
https://conda.anaconda.org/conda-forge/linux-64/aws-sdk-cpp-1.11.267-h5606698_1.conda#2f2f24cc595d2de8365e257050845c30
103+
https://conda.anaconda.org/conda-forge/linux-64/libarrow-15.0.0-h5001e6d_7_cpu.conda#3249fb87b4f2c207e1ff5fbcd44ec0df
104+
https://conda.anaconda.org/conda-forge/linux-64/libarrow-acero-15.0.0-h59595ed_7_cpu.conda#ee028786f388781b75937af244af17c1
105+
https://conda.anaconda.org/conda-forge/linux-64/libarrow-flight-15.0.0-hf334d8d_7_cpu.conda#baa6de62c8c19f48dca73fe246690f8b
106+
https://conda.anaconda.org/conda-forge/linux-64/libarrow-gandiva-15.0.0-h3f306ff_7_cpu.conda#25d20f9bfb833f5f658f230c8ba1a161
107+
https://conda.anaconda.org/conda-forge/linux-64/libparquet-15.0.0-h352af49_7_cpu.conda#5a5fd8d60cfb3fc35341e88fed6c0644
108+
https://conda.anaconda.org/conda-forge/linux-64/libarrow-dataset-15.0.0-h59595ed_7_cpu.conda#161b5f7569be51035242bcfbfaa1b504
109+
https://conda.anaconda.org/conda-forge/linux-64/libarrow-flight-sql-15.0.0-h469e5c9_7_cpu.conda#9947074ba2851e03dea90df356b903e3
110+
https://conda.anaconda.org/conda-forge/linux-64/libarrow-substrait-15.0.0-h469e5c9_7_cpu.conda#9b49ca045cc212b4139a16c14e11491b
111+
https://conda.anaconda.org/conda-forge/linux-64/pyarrow-15.0.0-py39h6925388_7_cpu.conda#29d642951dd0ed8d1ee6ebd311beea1a
112+
https://conda.anaconda.org/bioconda/noarch/gtfparse-2.5.0-pyh7cba7a3_0.tar.bz2#ea40e62a70c5b458cba8eb9f5b92cfe0
113+
https://conda.anaconda.org/bioconda/noarch/ngsderive-3.3.2-pyhdfd78af_0.tar.bz2#4e92e01625deca7753de5111de4aedf3

bio/ngsderive/environment.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
channels:
2+
- conda-forge
3+
- bioconda
4+
- nodefaults
5+
dependencies:
6+
- ngsderive=3.3.2

bio/ngsderive/meta.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: ngsderive
2+
description: Backwards computing information from next-generation sequencing data and annotating splice junctions
3+
url: "https://github.com/stjudecloud/ngsderive"
4+
authors:
5+
- "Thibault Dayris"
6+
input:
7+
- ngs: "Path to BAM/SAM/Fastq file. SAM/BAM files should be indexed."
8+
- gene_model: "Path to sorted GTF/GFF file. Should be tabix indexed."
9+
output:
10+
- tsv: Path to output file
11+
- junctions: Optional path to junction directory, or list of paths to junction files with a common prefix
12+
params:
13+
- subcommand: Name of the `ngsderive` subcommand
14+
- extra: Optional parameters, besides `-o`, `-g`
15+
notes: |
16+
GTF/GFF will be automatically sorted and tabix-indexed by `ngsderive` if needed.

bio/ngsderive/test/A.rg.bam

321 Bytes
Binary file not shown.

bio/ngsderive/test/A.rg.bam.bai

176 Bytes
Binary file not shown.

bio/ngsderive/test/Snakefile

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
rule test_ngsderive_endedness:
2+
input:
3+
ngs="A.rg.bam",
4+
output:
5+
tsv="A.endedness.tsv",
6+
log:
7+
"ngsderive/endedness.log",
8+
params:
9+
command="endedness",
10+
extra="-n 2 --lenient",
11+
wrapper:
12+
"master/bio/ngsderive"
13+
14+
15+
rule test_ngsderive_junction_annotation:
16+
input:
17+
ngs="A.rg.bam",
18+
gene_model="annotation.sorted.gtf.gz",
19+
output:
20+
tsv="A.junctions.tsv",
21+
junction_dir=directory("junctions"),
22+
log:
23+
"ngsderive/junctions.log",
24+
params:
25+
command="junction-annotation",
26+
extra="-i 2 -c",
27+
wrapper:
28+
"master/bio/ngsderive"
29+
30+
31+
rule test_ngsderive_junction_annotation_list:
32+
input:
33+
ngs="A.rg.bam",
34+
gene_model="annotation.sorted.gtf.gz",
35+
output:
36+
tsv="A.junctions_list.tsv",
37+
junction_dir=["junctions/A.rg.bam.junctions.tsv"],
38+
log:
39+
"ngsderive/junctions.log",
40+
params:
41+
command="junction-annotation",
42+
extra="-i 2 -c",
43+
wrapper:
44+
"master/bio/ngsderive"
45+
46+
47+
rule test_ngsderive_strandeness:
48+
input:
49+
ngs="A.rg.bam",
50+
gene_model="annotation.sorted.gtf.gz",
51+
output:
52+
tsv="A.strandedness.tsv",
53+
log:
54+
"ngsderive/strand.log",
55+
params:
56+
command="strandedness",
57+
extra="--verbose -m 2 -n 1",
58+
wrapper:
59+
"master/bio/ngsderive"
60+
61+
62+
rule test_ngsderive_encoding:
63+
input:
64+
ngs="A.rg.bam",
65+
output:
66+
tsv="A.encoding.tsv",
67+
log:
68+
"ngsderive/encoding.log",
69+
params:
70+
command="encoding",
71+
extra="-n 2",
72+
wrapper:
73+
"master/bio/ngsderive"
74+
75+
76+
rule test_ngsderive_instrument:
77+
input:
78+
ngs="A.rg.bam",
79+
output:
80+
tsv="A.instrument.tsv",
81+
log:
82+
"ngsderive/instrument.log",
83+
params:
84+
command="instrument",
85+
extra="-n 2 -v",
86+
wrapper:
87+
"master/bio/ngsderive"
88+
89+
90+
rule test_ngsderive_readlen:
91+
input:
92+
ngs="A.rg.bam",
93+
output:
94+
tsv="A.readlen.tsv",
95+
log:
96+
"ngsderive/readlen.log",
97+
params:
98+
command="readlen",
99+
extra="-c 0.1 -n 2",
100+
wrapper:
101+
"master/bio/ngsderive"
314 Bytes
Binary file not shown.
128 Bytes
Binary file not shown.

bio/ngsderive/wrapper.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# coding: utf-8
2+
3+
__author__ = "Thibault Dayris"
4+
__mail__ = "[email protected]"
5+
__copyright__ = "Copyright 2024, Thibault Dayris"
6+
__license__ = "MIT"
7+
8+
from os.path import commonprefix, dirname
9+
from snakemake import shell
10+
from warnings import warn
11+
12+
extra = snakemake.params.get("extra", "")
13+
log = snakemake.log_fmt_shell(stdout=True, stderr=True)
14+
15+
gene_model = snakemake.input.get("gene_model", "")
16+
if gene_model:
17+
gene_model = f"--gene-model {gene_model}"
18+
19+
20+
junction_dir = snakemake.output.get("junction_dir", "")
21+
if isinstance(junction_dir, list):
22+
junction_dir = commonprefix([dirname(fp) for fp in junction_dir])
23+
if not junction_dir:
24+
warn(
25+
"No common prefix was found within the list of "
26+
"files given as `junction_files_dir`. Falling "
27+
"back to default ngsderive value"
28+
)
29+
30+
if junction_dir:
31+
junction_dir = f"--junction-files-dir {junction_dir}"
32+
33+
34+
shell(
35+
"ngsderive {snakemake.params.command} "
36+
"{extra} {gene_model} {junction_dir} "
37+
"{snakemake.input.ngs} "
38+
"--outfile {snakemake.output.tsv} "
39+
"{log} "
40+
)

test.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3658,6 +3658,45 @@ def test_nanosimh():
36583658
)
36593659

36603660

3661+
@skip_if_not_modified
3662+
def test_ngsderive():
3663+
run(
3664+
"bio/ngsderive",
3665+
["snakemake", "--cores", "1", "--use-conda", "-F", "A.readlen.tsv"],
3666+
)
3667+
run(
3668+
"bio/ngsderive",
3669+
["snakemake", "--cores", "1", "--use-conda", "-F", "A.instrument.tsv"],
3670+
)
3671+
run(
3672+
"bio/ngsderive",
3673+
["snakemake", "--cores", "1", "--use-conda", "-F", "A.strandedness.tsv"],
3674+
)
3675+
run(
3676+
"bio/ngsderive",
3677+
["snakemake", "--cores", "1", "--use-conda", "-F", "A.encoding.tsv"],
3678+
)
3679+
run(
3680+
"bio/ngsderive",
3681+
["snakemake", "--cores", "1", "--use-conda", "-F", "A.junctions.tsv"],
3682+
)
3683+
run(
3684+
"bio/ngsderive",
3685+
[
3686+
"snakemake",
3687+
"--cores",
3688+
"1",
3689+
"--use-conda",
3690+
"-F",
3691+
"junctions/A.rg.bam.junctions.tsv",
3692+
],
3693+
)
3694+
run(
3695+
"bio/ngsderive",
3696+
["snakemake", "--cores", "1", "--use-conda", "-F", "A.endedness.tsv"],
3697+
)
3698+
3699+
36613700
@skip_if_not_modified
36623701
def test_ngs_disambiguate():
36633702
run(

0 commit comments

Comments
 (0)