Skip to content
Open
Show file tree
Hide file tree
Changes from 53 commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
b89759c
feat/add_pytrf: add basic working code without complete wrapper just …
rohan-ibn-tariq Nov 26, 2025
f01dfd2
feat/add_pytrf: delete unified wrapper approach
rohan-ibn-tariq Nov 26, 2025
4e1e6bb
feat/add_pytrf: add findstr basic wrapper
rohan-ibn-tariq Nov 26, 2025
70294eb
feat/add_pytrf: add findgtr basic wrapper
rohan-ibn-tariq Nov 27, 2025
c2260fa
feat/add_pytrf: add in meta discalaimer note
rohan-ibn-tariq Nov 27, 2025
cfefde7
feat/add_pytrf: fix output docs
rohan-ibn-tariq Nov 27, 2025
ba3ca6f
feat/add_pytrf: add end line
rohan-ibn-tariq Nov 27, 2025
dcbefdf
feat/add_pytrf: add pytrf subcommand findatr
rohan-ibn-tariq Nov 27, 2025
9daf5f1
feat/add_pytrf: black fmt for test_wrappers.py and basic pytrf tests …
rohan-ibn-tariq Nov 27, 2025
e4b5aa0
feat/add_pytrf: update with expected results test info and doc-comments
rohan-ibn-tariq Nov 27, 2025
4c87765
feat/add_pytrf: update with expected results test info and defaults test
rohan-ibn-tariq Nov 27, 2025
6e357ed
feat/add_pytrf: finalize findgtr with expected results very basic min…
rohan-ibn-tariq Nov 27, 2025
fd0b7f4
feat/add_pytrf: add comparison for findgtr minimal
rohan-ibn-tariq Nov 27, 2025
0dd30f6
feat/add_pytrf: refactor doc
rohan-ibn-tariq Nov 27, 2025
0fe268f
feat/add_pytrf: refactor doc
rohan-ibn-tariq Nov 27, 2025
86adfd6
feat/add_pytrf: add expected test for findatr + doc refactor
rohan-ibn-tariq Nov 27, 2025
653e9c5
feat/add_pytrf: remove python pins not required
rohan-ibn-tariq Nov 27, 2025
5b505fe
feat/add_pytrf: fix extract test
rohan-ibn-tariq Nov 27, 2025
55b31be
feat/add_pytrf: fix url and add additional note
rohan-ibn-tariq Nov 27, 2025
6cc90bd
feat/add_pytrf: black fmt wrapper.py
rohan-ibn-tariq Nov 27, 2025
8c2eb7d
feat/add_pytrf: snakefile fmt findatr findstr
rohan-ibn-tariq Nov 27, 2025
59e569f
feat/add_pytrf: pylint fixes for pytrf findstr
rohan-ibn-tariq Nov 27, 2025
8bbe890
feat/add_pytrf: pylint fixes for pytrf findgtr
rohan-ibn-tariq Nov 27, 2025
b29a28a
feat/add_pytrf: pylint fixes for pytrf findatr
rohan-ibn-tariq Nov 27, 2025
19530be
feat/add_pytrf: add extract but test failing
rohan-ibn-tariq Nov 27, 2025
718846c
feat/add_pytrf: add extract command issue in pytest skip and meta.yaml
rohan-ibn-tariq Nov 27, 2025
7b43c71
feat/add_pytrf: refactor meta.yaml's of 4 commands
rohan-ibn-tariq Nov 27, 2025
04b9263
feat/add_pytrf: refactor meta.yaml for findatr
rohan-ibn-tariq Nov 27, 2025
75421c4
feat/add_pytrf: pin envoirnments for four subcommands
rohan-ibn-tariq Nov 27, 2025
e93f085
feat/add-pytrf: merge branch master
rohan-ibn-tariq Nov 27, 2025
c0f2aaf
feat/add-pytrf: refactor meta.yaml
rohan-ibn-tariq Nov 27, 2025
df84e32
Deleting the pinned environment
rohan-ibn-tariq Dec 5, 2025
6da0812
feat/add_pytrf: remove pyfastx dependency due to upstream fix
rohan-ibn-tariq Dec 5, 2025
b4e02df
feat/add_pytrf: remove dead code in the four wrappers
rohan-ibn-tariq Dec 5, 2025
a786bc2
Merge remote-tracking branch 'upstream/master' into feat/add-pytrf
rohan-ibn-tariq Dec 5, 2025
e1f8ef3
feat/add_pytrf: pin four pytrf wrapper environments
rohan-ibn-tariq Dec 5, 2025
2a54579
merge branch master
rohan-ibn-tariq Jan 13, 2026
53705d5
feat/add-pytrf: format test_wrapperts.py with black
rohan-ibn-tariq Jan 13, 2026
985a957
feat/add-pytrf: refactor findstr based on review
rohan-ibn-tariq Jan 20, 2026
2b02651
feat/add-pytrf: refactor findgtr based on review
rohan-ibn-tariq Jan 20, 2026
3e122b5
feat/add-pytrf: refactor findatr based on review
rohan-ibn-tariq Jan 20, 2026
bb1e68c
feat/add-pytrf: fix findstr default output call
rohan-ibn-tariq Jan 20, 2026
c0e19d3
feat/add-pytrf: fix extract based on review
rohan-ibn-tariq Jan 20, 2026
8abd076
feat/add_pytrf: refactor and fix findstr command
rohan-ibn-tariq Jan 25, 2026
2363ed2
feat/add_pytrf: refactor and fix findgtr command
rohan-ibn-tariq Jan 25, 2026
b45d897
feat/add_pytrf: refactor and fix findatr command
rohan-ibn-tariq Jan 25, 2026
85c8961
feat/add_pytrf: refactor and fix extract command
rohan-ibn-tariq Jan 25, 2026
fc9e9c4
Merge remote-tracking branch 'upstream/master' into feat/add-pytrf
rohan-ibn-tariq Jan 25, 2026
e481bad
Small tweaks
fgvieira Jan 26, 2026
d7cb22a
Small tweak
fgvieira Jan 26, 2026
b5836e1
Combine tests
fgvieira Jan 26, 2026
842f12d
Fix typo
fgvieira Jan 26, 2026
37e8d18
Small tweak
fgvieira Jan 26, 2026
8858332
Simplify shell command
fgvieira Jan 26, 2026
4697659
Code format
fgvieira Jan 26, 2026
427bd56
Code format
fgvieira Jan 26, 2026
d434dba
feat/add-pytrf: making shell block consistent with other pytrf wrappe…
rohan-ibn-tariq Jan 28, 2026
30e7ccb
feat/add-pytrf: applying cr suggestion to block output file in extra …
rohan-ibn-tariq Jan 28, 2026
1c81fbf
feat/add-pytrf: applying cr suggestion to block output file in extra …
rohan-ibn-tariq Jan 28, 2026
4c54040
feat/add-pytrf: applying cr suggestion to block output file in extra …
rohan-ibn-tariq Jan 28, 2026
ca9d6af
feat/add-pytrf: updated pytrf findstr bed output format bug in meta
rohan-ibn-tariq Jan 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions bio/pytrf/extract/environment.linux-64.pin.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# This file may be used to create an environment using:
# $ conda create --name <env> --file <this file>
# platform: linux-64
# created-by: conda 25.11.0
@EXPLICIT
https://conda.anaconda.org/conda-forge/linux-64/_libgcc_mutex-0.1-conda_forge.tar.bz2#d7c89558ba9fa0495403155b64376d81
https://conda.anaconda.org/conda-forge/noarch/ca-certificates-2026.1.4-hbd8a1cb_0.conda#bddacf101bb4dd0e51811cb69c7790e2
https://conda.anaconda.org/conda-forge/linux-64/libgomp-15.2.0-he0feb66_16.conda#26c46f90d0e727e95c6c9498a33a09f3
https://conda.anaconda.org/conda-forge/noarch/python_abi-3.12-8_cp312.conda#c3efd25ac4d74b1584d2f7a57195ddf1
https://conda.anaconda.org/conda-forge/noarch/tzdata-2025c-hc9c84f9_1.conda#ad659d0a2b3e47e38d829aa8cad2d610
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-15.2.0-he0feb66_16.conda#6d0363467e6ed84f11435eb309f2ff06
https://conda.anaconda.org/conda-forge/linux-64/bzip2-1.0.8-hda65f42_8.conda#51a19bba1b8ebfb60df25cde030b7ebc
https://conda.anaconda.org/conda-forge/linux-64/libexpat-2.7.3-hecca717_0.conda#8b09ae86839581147ef2e5c5e229d164
https://conda.anaconda.org/conda-forge/linux-64/libffi-3.5.2-h9ec8514_0.conda#35f29eec58405aaf55e01cb470d8c26a
https://conda.anaconda.org/conda-forge/linux-64/libgcc-ng-15.2.0-h69a702a_16.conda#5a68259fac2da8f2ee6f7bfe49c9eb8b
https://conda.anaconda.org/conda-forge/linux-64/liblzma-5.8.2-hb03c661_0.conda#c7c83eecbb72d88b940c249af56c8b17
https://conda.anaconda.org/conda-forge/linux-64/libnsl-2.0.1-hb9d3cd8_1.conda#d864d34357c3b65a4b731f78c0801dc4
https://conda.anaconda.org/conda-forge/linux-64/libstdcxx-15.2.0-h934c35e_16.conda#68f68355000ec3f1d6f26ea13e8f525f
https://conda.anaconda.org/conda-forge/linux-64/libuuid-2.41.3-h5347b49_0.conda#db409b7c1720428638e7c0d509d3e1b5
https://conda.anaconda.org/conda-forge/linux-64/libzlib-1.3.1-hb9d3cd8_2.conda#edb0dca6bc32e4f4789199455a1dbeb8
https://conda.anaconda.org/conda-forge/linux-64/ncurses-6.5-h2d0b736_3.conda#47e340acb35de30501a76c7c799c41d7
https://conda.anaconda.org/conda-forge/linux-64/openssl-3.6.0-h26f9b46_0.conda#9ee58d5c534af06558933af3c845a780
https://conda.anaconda.org/conda-forge/linux-64/icu-78.2-h33c6efd_0.conda#186a18e3ba246eccfc7cff00cd19a870
https://conda.anaconda.org/conda-forge/linux-64/libxcrypt-4.4.36-hd590300_1.conda#5aa797f8787fe7a17d1b0821485b5adc
https://conda.anaconda.org/conda-forge/linux-64/readline-8.3-h853b02a_0.conda#d7d95fc8287ea7bf33e0e7116d2b95ec
https://conda.anaconda.org/conda-forge/linux-64/tk-8.6.13-noxft_ha0e22de_103.conda#86bc20552bf46075e3d92b67f089172d
https://conda.anaconda.org/conda-forge/linux-64/zstd-1.5.7-hb78ec9c_6.conda#4a13eeac0b5c8e5b8ab496e6c4ddd829
https://conda.anaconda.org/conda-forge/linux-64/ld_impl_linux-64-2.45-default_hbd61a6d_105.conda#3ec0aa5037d39b06554109a01e6fb0c6
https://conda.anaconda.org/conda-forge/linux-64/libsqlite-3.51.2-hf4e2dac_0.conda#da5be73701eecd0e8454423fd6ffcf30
https://conda.anaconda.org/conda-forge/linux-64/python-3.12.12-hd63d673_1_cpython.conda#5c00c8cea14ee8d02941cab9121dce41
https://conda.anaconda.org/conda-forge/noarch/packaging-26.0-pyhcf101f3_0.conda#b76541e68fea4d511b1ac46a28dcd2c6
https://conda.anaconda.org/bioconda/linux-64/pyfastx-2.3.0-py312h4711d71_1.conda#9f9e697e132b8567f25c80673da5d4e8
https://conda.anaconda.org/conda-forge/noarch/setuptools-80.10.1-pyh332efcf_0.conda#cb72cedd94dd923c6a9405a3d3b1c018
https://conda.anaconda.org/bioconda/noarch/snakemake-wrapper-utils-0.8.0-pyhdfd78af_0.conda#1650e521333852f45468d97b1b2fdcce
https://conda.anaconda.org/bioconda/linux-64/pytrf-1.4.2-py312h0fa9677_1.conda#a0c079e205c567635a2b5f22054ffc62
https://conda.anaconda.org/conda-forge/noarch/wheel-0.46.3-pyhd8ed1ab_0.conda#bdbd7385b4a67025ac2dba4ef8cb6a8f
https://conda.anaconda.org/conda-forge/noarch/pip-25.3-pyh8b19718_0.conda#c55515ca43c6444d2572e0f0d93cb6b9
7 changes: 7 additions & 0 deletions bio/pytrf/extract/environment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
channels:
- conda-forge
- bioconda
- nodefaults
dependencies:
- pytrf =1.4
- snakemake-wrapper-utils =0.8.0
25 changes: 25 additions & 0 deletions bio/pytrf/extract/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: pytrf extract (NOT WORKING, see notes)
description: >
Extract tandem repeat sequences with flanking regions from DNA sequences.
Requires output from pytrf findstr, findgtr, or findatr as input.
url: https://pytrf.readthedocs.io/en/latest/usage.html#commandline-interface
authors:
- Muhammad Rohan Ali Asmat
input:
- ref: FASTA or FASTQ file (supports gzip compression)
- repeat: TSV or CSV file from pytrf findstr/findgtr/findatr
output:
- Output file (required). Format auto-detected from file extension.
params:
extra: >
Additional command-line arguments passed to pytrf extract.
See url for options.
notes: >
**Bioconda package:** https://bioconda.github.io/recipes/pytrf/README.html |nl|
**GitHub repository:** https://github.com/lmdu/pytrf |nl|
**License:** MIT License |nl|
**Disclaimer:** This is a minimal implementation supporting basic functionality.
pytrf is not a Python binding to TRF - it's an independent tool. |nl|
**Known issue:** PyTRF 1.4.2 has a bug in the `extract` command (delimiter error). |nl|
See: https://github.com/lmdu/pytrf/issues/6 |nl|
This wrapper skips extract tests until upstream patch is released.
13 changes: 13 additions & 0 deletions bio/pytrf/extract/test/Snakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# SAMPLE RULE: Custom parameters via extra
rule pytrf_extract:
input:
ref="demo_data/{sample}.fasta", # reference fasta
repeat="demo_data/{sample}.tsv", # repeat file from findstr/findgtr/findatr
output:
"results/{sample}_extract.tsv",
params:
extra="-l 150", # flank-length=150
log:
"logs/{sample}.log",
wrapper:
"master/bio/pytrf/extract"
6 changes: 6 additions & 0 deletions bio/pytrf/extract/test/demo_data/small_test.fasta
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
>seq1
TCATCGGTCATCGGTCATCGGTCATCGGTCATCGG
>seq2
ACCCCTCAGGGTACCCCTCAGGGTACCCCTCAGGGTACCCCTCAGGGTACCCCTCAGGGTACCCCTCAGGGTACCCCTCAGGGT
>seq3
TGACTATATCCGCAAATGAAGGCTGTTCTCTGACATGACTATATCCGCAAATGAAGGCTGTTCTCTGACATGACTATATCCGCAAATGAAGGCTGTTCTCTGACATGACTATATCCGCAAATGAAGGCTGTTCTCTGACA
85 changes: 85 additions & 0 deletions bio/pytrf/extract/test/demo_data/small_test.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
seq1 1 3 TCA 3 1 3
seq1 4 6 TCG 3 1 3
seq1 7 9 GTC 3 1 3
seq1 10 12 ATC 3 1 3
seq1 13 15 GGT 3 1 3
seq1 16 18 CAT 3 1 3
seq1 19 21 CGG 3 1 3
seq1 22 24 TCA 3 1 3
seq1 25 27 TCG 3 1 3
seq1 28 30 GTC 3 1 3
seq1 31 33 ATC 3 1 3
seq1 34 36 GG 3 1 3
seq2 1 3 ACC 3 1 3
seq2 4 6 CCT 3 1 3
seq2 7 9 CAG 3 1 3
seq2 10 12 GGT 3 1 3
seq2 13 15 ACC 3 1 3
seq2 16 18 CCT 3 1 3
seq2 19 21 CAG 3 1 3
seq2 22 24 GGT 3 1 3
seq2 25 27 ACC 3 1 3
seq2 28 30 CCT 3 1 3
seq2 31 33 CAG 3 1 3
seq2 34 36 GGT 3 1 3
seq2 37 39 ACC 3 1 3
seq2 40 42 CCT 3 1 3
seq2 43 45 CAG 3 1 3
seq2 46 48 GGT 3 1 3
seq2 49 51 ACC 3 1 3
seq2 52 54 CCT 3 1 3
seq2 55 57 CAG 3 1 3
seq2 58 60 GGT 3 1 3
seq2 61 63 ACC 3 1 3
seq2 64 66 CCT 3 1 3
seq2 67 69 CAG 3 1 3
seq2 70 72 GGT 3 1 3
seq2 73 75 ACC 3 1 3
seq2 76 78 CCT 3 1 3
seq2 79 81 CAG 3 1 3
seq2 82 84 GGT 3 1 3
seq3 1 3 TGA 3 1 3
seq3 4 6 CTA 3 1 3
seq3 7 9 TAT 3 1 3
seq3 10 12 CCG 3 1 3
seq3 13 15 CAA 3 1 3
seq3 16 18 ATG 3 1 3
seq3 19 21 AAG 3 1 3
seq3 22 24 GCT 3 1 3
seq3 25 27 GTT 3 1 3
seq3 28 31 CT 2 2 4
seq3 32 34 GAC 3 1 3
seq3 35 37 ATG 3 1 3
seq3 38 40 ACT 3 1 3
seq3 41 44 AT 2 2 4
seq3 45 47 CCG 3 1 3
seq3 48 50 CAA 3 1 3
seq3 51 53 ATG 3 1 3
seq3 54 56 AAG 3 1 3
seq3 57 59 GCT 3 1 3
seq3 60 62 GTT 3 1 3
seq3 63 66 CT 2 2 4
seq3 67 69 GAC 3 1 3
seq3 70 72 ATG 3 1 3
seq3 73 75 ACT 3 1 3
seq3 76 79 AT 2 2 4
seq3 80 82 CCG 3 1 3
seq3 83 85 CAA 3 1 3
seq3 86 88 ATG 3 1 3
seq3 89 91 AAG 3 1 3
seq3 92 94 GCT 3 1 3
seq3 95 97 GTT 3 1 3
seq3 98 101 CT 2 2 4
seq3 102 104 GAC 3 1 3
seq3 105 107 ATG 3 1 3
seq3 108 110 ACT 3 1 3
seq3 111 114 AT 2 2 4
seq3 115 117 CCG 3 1 3
seq3 118 120 CAA 3 1 3
seq3 121 123 ATG 3 1 3
seq3 124 126 AAG 3 1 3
seq3 127 129 GCT 3 1 3
seq3 130 132 GTT 3 1 3
seq3 133 136 CT 2 2 4
seq3 137 139 GAC 3 1 3
seq3 140 142 A 3 1 3
Empty file.
66 changes: 66 additions & 0 deletions bio/pytrf/extract/wrapper.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
"""
Snakemake Wrapper for PyTRF extract
------------------------------------------------------
Extract tandem repeat sequences with flanking regions.
"""

from pathlib import Path
from snakemake.shell import shell
from snakemake_wrapper_utils.snakemake import get_format, is_arg


# Logging
log = snakemake.log_fmt_shell(stdout=True, stderr=True)

# Get input file
try:
input_file = Path(snakemake.input.ref).resolve()
repeat_file = Path(snakemake.input.repeat).resolve()
except (AttributeError, TypeError) as e:
raise ValueError(
f"Input specification error: {e}. "
"Expected named inputs: ref=<fasta/fastq>, repeat=<tsv/csv>"
) from e

# Get output file and determine format
try:
output_file = Path(snakemake.output[0]).resolve()
except (IndexError, TypeError) as e:
raise ValueError("Output file is required") from e

out_format = get_format(output_file)

supported_formats = {"tsv", "csv", "fasta"}

if out_format not in supported_formats:
raise ValueError(
f"Unsupported format '{out_format}' for pytrf extract. "
f"Supported formats: {', '.join(supported_formats)}"
)

# Additional parameters
extra = snakemake.params.get("extra", "")

if is_arg("-f", extra) or is_arg("--out-format", extra):
raise ValueError(
"Output format is automatically inferred from output file extension. "
"Do not specify -f/--out-format in params.extra. "
)

if is_arg("-r", extra) or is_arg("--repeat-file", extra):
raise ValueError(
"Repeat file should be specified as an input. "
"Do not specify -r/--repeat-file in params.extra"
)

# Build command
CMD = f"pytrf extract {input_file} -r {repeat_file} -f {out_format}"
if extra:
CMD += f" {extra}"
CMD += f" -o {output_file}"

# Execute
try:
shell(f"{CMD} {log}")
except Exception as e:
raise RuntimeError(f"PyTRF extract execution failed: {e}") from e
38 changes: 38 additions & 0 deletions bio/pytrf/findatr/environment.linux-64.pin.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# This file may be used to create an environment using:
# $ conda create --name <env> --file <this file>
# platform: linux-64
# created-by: conda 25.11.0
@EXPLICIT
https://conda.anaconda.org/conda-forge/linux-64/_libgcc_mutex-0.1-conda_forge.tar.bz2#d7c89558ba9fa0495403155b64376d81
https://conda.anaconda.org/conda-forge/noarch/ca-certificates-2026.1.4-hbd8a1cb_0.conda#bddacf101bb4dd0e51811cb69c7790e2
https://conda.anaconda.org/conda-forge/linux-64/libgomp-15.2.0-he0feb66_16.conda#26c46f90d0e727e95c6c9498a33a09f3
https://conda.anaconda.org/conda-forge/noarch/python_abi-3.12-8_cp312.conda#c3efd25ac4d74b1584d2f7a57195ddf1
https://conda.anaconda.org/conda-forge/noarch/tzdata-2025c-hc9c84f9_1.conda#ad659d0a2b3e47e38d829aa8cad2d610
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-15.2.0-he0feb66_16.conda#6d0363467e6ed84f11435eb309f2ff06
https://conda.anaconda.org/conda-forge/linux-64/bzip2-1.0.8-hda65f42_8.conda#51a19bba1b8ebfb60df25cde030b7ebc
https://conda.anaconda.org/conda-forge/linux-64/libexpat-2.7.3-hecca717_0.conda#8b09ae86839581147ef2e5c5e229d164
https://conda.anaconda.org/conda-forge/linux-64/libffi-3.5.2-h9ec8514_0.conda#35f29eec58405aaf55e01cb470d8c26a
https://conda.anaconda.org/conda-forge/linux-64/libgcc-ng-15.2.0-h69a702a_16.conda#5a68259fac2da8f2ee6f7bfe49c9eb8b
https://conda.anaconda.org/conda-forge/linux-64/liblzma-5.8.2-hb03c661_0.conda#c7c83eecbb72d88b940c249af56c8b17
https://conda.anaconda.org/conda-forge/linux-64/libnsl-2.0.1-hb9d3cd8_1.conda#d864d34357c3b65a4b731f78c0801dc4
https://conda.anaconda.org/conda-forge/linux-64/libstdcxx-15.2.0-h934c35e_16.conda#68f68355000ec3f1d6f26ea13e8f525f
https://conda.anaconda.org/conda-forge/linux-64/libuuid-2.41.3-h5347b49_0.conda#db409b7c1720428638e7c0d509d3e1b5
https://conda.anaconda.org/conda-forge/linux-64/libzlib-1.3.1-hb9d3cd8_2.conda#edb0dca6bc32e4f4789199455a1dbeb8
https://conda.anaconda.org/conda-forge/linux-64/ncurses-6.5-h2d0b736_3.conda#47e340acb35de30501a76c7c799c41d7
https://conda.anaconda.org/conda-forge/linux-64/openssl-3.6.0-h26f9b46_0.conda#9ee58d5c534af06558933af3c845a780
https://conda.anaconda.org/conda-forge/linux-64/icu-78.2-h33c6efd_0.conda#186a18e3ba246eccfc7cff00cd19a870
https://conda.anaconda.org/conda-forge/linux-64/libxcrypt-4.4.36-hd590300_1.conda#5aa797f8787fe7a17d1b0821485b5adc
https://conda.anaconda.org/conda-forge/linux-64/readline-8.3-h853b02a_0.conda#d7d95fc8287ea7bf33e0e7116d2b95ec
https://conda.anaconda.org/conda-forge/linux-64/tk-8.6.13-noxft_ha0e22de_103.conda#86bc20552bf46075e3d92b67f089172d
https://conda.anaconda.org/conda-forge/linux-64/zstd-1.5.7-hb78ec9c_6.conda#4a13eeac0b5c8e5b8ab496e6c4ddd829
https://conda.anaconda.org/conda-forge/linux-64/ld_impl_linux-64-2.45-default_hbd61a6d_105.conda#3ec0aa5037d39b06554109a01e6fb0c6
https://conda.anaconda.org/conda-forge/linux-64/libsqlite-3.51.2-hf4e2dac_0.conda#da5be73701eecd0e8454423fd6ffcf30
https://conda.anaconda.org/conda-forge/linux-64/python-3.12.12-hd63d673_1_cpython.conda#5c00c8cea14ee8d02941cab9121dce41
https://conda.anaconda.org/conda-forge/noarch/packaging-26.0-pyhcf101f3_0.conda#b76541e68fea4d511b1ac46a28dcd2c6
https://conda.anaconda.org/bioconda/linux-64/pyfastx-2.3.0-py312h4711d71_1.conda#9f9e697e132b8567f25c80673da5d4e8
https://conda.anaconda.org/conda-forge/noarch/setuptools-80.10.1-pyh332efcf_0.conda#cb72cedd94dd923c6a9405a3d3b1c018
https://conda.anaconda.org/bioconda/noarch/snakemake-wrapper-utils-0.8.0-pyhdfd78af_0.conda#1650e521333852f45468d97b1b2fdcce
https://conda.anaconda.org/bioconda/linux-64/pytrf-1.4.2-py312h0fa9677_1.conda#a0c079e205c567635a2b5f22054ffc62
https://conda.anaconda.org/conda-forge/noarch/wheel-0.46.3-pyhd8ed1ab_0.conda#bdbd7385b4a67025ac2dba4ef8cb6a8f
https://conda.anaconda.org/conda-forge/noarch/pip-25.3-pyh8b19718_0.conda#c55515ca43c6444d2572e0f0d93cb6b9
7 changes: 7 additions & 0 deletions bio/pytrf/findatr/environment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
channels:
- conda-forge
- bioconda
- nodefaults
dependencies:
- pytrf =1.4
- snakemake-wrapper-utils =0.8.0
21 changes: 21 additions & 0 deletions bio/pytrf/findatr/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: pytrf findatr
description: >
Find approximate/imperfect tandem repeats from DNA sequences.
url: https://pytrf.readthedocs.io/en/latest/usage.html#commandline-interface
authors:
- Muhammad Rohan Ali Asmat
input:
- FASTA or FASTQ file (supports gzip compression)
output:
- Output file (required). Format auto-detected from file extension.
params:
extra: >
Additional command-line arguments passed to pytrf findatr.
See url for options.
notes: >
**Bioconda package:** https://bioconda.github.io/recipes/pytrf/README.html |nl|
**GitHub repository:** https://github.com/lmdu/pytrf |nl|
**License:** MIT License |nl|
**Disclaimer:** This is a minimal implementation supporting basic functionality.
pytrf is not a Python binding to TRF - it's an independent tool.

12 changes: 12 additions & 0 deletions bio/pytrf/findatr/test/Snakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# SAMPLE RULE: Custom parameters via extra
rule pytrf_findatr:
input:
"demo_data/{sample}.fasta",
output:
"results/{sample}.tsv",
log:
"logs/{sample}.log",
params:
extra="-m 3 -M 10", # min-motif-size=3, max-motif-size=10
wrapper:
"master/bio/pytrf/findatr"
2 changes: 2 additions & 0 deletions bio/pytrf/findatr/test/demo_data/small_test.fasta
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
>seq1
TCATCGGTCATCGGTCATCGGTCATCGGTCATCGG
1 change: 1 addition & 0 deletions bio/pytrf/findatr/test/expected/findatr_basic.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
seq1 1 35 TCATCGG 7 5.0 35 1 35 5 35 35 0 0 0 100.0
55 changes: 55 additions & 0 deletions bio/pytrf/findatr/wrapper.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
"""
Snakemake Wrapper for PyTRF findatr
------------------------------------------------------
Find approximate/imperfect tandem repeats.
"""

from pathlib import Path
from snakemake.shell import shell
from snakemake_wrapper_utils.snakemake import get_format, is_arg


# Logging
log = snakemake.log_fmt_shell(stdout=True, stderr=True)

# Get input file
try:
input_file = Path(snakemake.input[0]).resolve()
except (IndexError, TypeError) as e:
raise ValueError(f"Input specification error: {e}") from e

# Get output file and determine format
try:
output_file = Path(snakemake.output[0]).resolve()
except (IndexError, TypeError) as e:
raise ValueError("Output file is required") from e

out_format = get_format(output_file)

supported_formats = {"tsv", "csv", "gff"}

if out_format not in supported_formats:
raise ValueError(
f"Unsupported format '{out_format}' for pytrf findatr. "
f"Supported formats: {', '.join(supported_formats)}"
)

# Additional parameters
extra = snakemake.params.get("extra", "")

if is_arg("-f", extra) or is_arg("--out-format", extra):
raise ValueError(
"Output format is automatically inferred from output file extension. "
"Do not specify -f/--out-format in params.extra. "
)

CMD = f"pytrf findatr {input_file} -f {out_format}"
if extra:
CMD += f" {extra}"
CMD += f" -o {output_file}"

# Execute
try:
shell(f"{CMD} {log}")
except Exception as e:
raise RuntimeError(f"PyTRF findatr execution failed: {e}") from e
Loading
Loading