align-trim 1.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- align_trim-1.1.0/.github/ISSUE_TEMPLATE/bug_report.yml +40 -0
- align_trim-1.1.0/.github/ISSUE_TEMPLATE/feature_request.yml +11 -0
- align_trim-1.1.0/.github/workflows/pytest.yml +34 -0
- align_trim-1.1.0/.github/workflows/python-publish.yml +64 -0
- align_trim-1.1.0/.gitignore +204 -0
- align_trim-1.1.0/.pre-commit-config.yaml +17 -0
- align_trim-1.1.0/LICENSE +19 -0
- align_trim-1.1.0/PKG-INFO +133 -0
- align_trim-1.1.0/README.md +117 -0
- align_trim-1.1.0/align_trim/__init__.py +0 -0
- align_trim-1.1.0/align_trim/main.py +1065 -0
- align_trim-1.1.0/pyproject.toml +42 -0
- align_trim-1.1.0/tests/__init__.py +0 -0
- align_trim-1.1.0/tests/test_data/primer.bed +196 -0
- align_trim-1.1.0/tests/test_data/sars-cov-2_v3.0.0_paired.bam +0 -0
- align_trim-1.1.0/tests/test_data/sars-cov-2_v5.3.2.bam +0 -0
- align_trim-1.1.0/tests/test_data/v1.0.0.primer.bed +196 -0
- align_trim-1.1.0/tests/test_data/v3.0.0.primer.bed +218 -0
- align_trim-1.1.0/tests/test_data/v5.3.2.primer.bed +193 -0
- align_trim-1.1.0/tests/test_integration.py +470 -0
- align_trim-1.1.0/tests/test_legacy.py +204 -0
- align_trim-1.1.0/tests/test_main.py +219 -0
- align_trim-1.1.0/tests/test_normalise.py +220 -0
- align_trim-1.1.0/uv.lock +674 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
name: Bug report
|
|
2
|
+
description: Report something that is broken or incorrect, please ensure you have checked existing issues before submitting a new issue.
|
|
3
|
+
labels: [bug]
|
|
4
|
+
body:
|
|
5
|
+
- type: textarea
|
|
6
|
+
id: description
|
|
7
|
+
attributes:
|
|
8
|
+
label: Description of the bug
|
|
9
|
+
description: A clear and concise description of what the bug is.
|
|
10
|
+
validations:
|
|
11
|
+
required: true
|
|
12
|
+
|
|
13
|
+
- type: textarea
|
|
14
|
+
id: command_used
|
|
15
|
+
attributes:
|
|
16
|
+
label: Command used and terminal output
|
|
17
|
+
description: Steps to reproduce the behaviour. Please paste the command you used to launch the pipeline and the output from your terminal.
|
|
18
|
+
render: console
|
|
19
|
+
placeholder: |
|
|
20
|
+
$ align_trim ...
|
|
21
|
+
|
|
22
|
+
Some output where something broke
|
|
23
|
+
|
|
24
|
+
- type: textarea
|
|
25
|
+
id: files
|
|
26
|
+
attributes:
|
|
27
|
+
label: Relevant files
|
|
28
|
+
description: |
|
|
29
|
+
Please drag and drop the relevant files here. Create a `.zip` archive if the extension is not allowed.
|
|
30
|
+
Your verbose log file (from stderr with --verbose enabled), the report TSV generated with `--report`, and your primer scheme bedfile are all helpful.
|
|
31
|
+
|
|
32
|
+
- type: textarea
|
|
33
|
+
id: system
|
|
34
|
+
attributes:
|
|
35
|
+
label: System information
|
|
36
|
+
description: |
|
|
37
|
+
* Hardware _(eg. HPC, Desktop, Cloud)_
|
|
38
|
+
* OS _(eg. CentOS Linux, macOS, Linux Mint)_
|
|
39
|
+
* Install method _(eg. pip, conda, source)_
|
|
40
|
+
* Version of align_trim _(eg. 1.1, 1.5, 1.8.2)_
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
name: Feature request
|
|
2
|
+
description: Suggest an idea for the align_trim, please ensure you have checked existing feature requests before submitting a new suggestion to avoid duplicates.
|
|
3
|
+
labels: enhancement
|
|
4
|
+
body:
|
|
5
|
+
- type: textarea
|
|
6
|
+
id: description
|
|
7
|
+
attributes:
|
|
8
|
+
label: Description of feature
|
|
9
|
+
description: Please describe your suggestion for a new feature. It might help to describe a problem or use case, plus any alternatives that you have considered.
|
|
10
|
+
validations:
|
|
11
|
+
required: true
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
name: pytest
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
paths:
|
|
5
|
+
- "align_trim/**"
|
|
6
|
+
- "tests/**"
|
|
7
|
+
- "pyproject.toml"
|
|
8
|
+
- "uv.lock"
|
|
9
|
+
- ".github/workflows/pytest.yml"
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
ci:
|
|
13
|
+
strategy:
|
|
14
|
+
fail-fast: false
|
|
15
|
+
matrix:
|
|
16
|
+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
|
|
17
|
+
os: [ubuntu-22.04, macos-latest]
|
|
18
|
+
runs-on: ${{ matrix.os }}
|
|
19
|
+
steps:
|
|
20
|
+
- uses: actions/checkout@v4
|
|
21
|
+
|
|
22
|
+
- name: install uv
|
|
23
|
+
uses: astral-sh/setup-uv@v5
|
|
24
|
+
|
|
25
|
+
- name: set up python
|
|
26
|
+
uses: actions/setup-python@v5
|
|
27
|
+
with:
|
|
28
|
+
python-version: ${{ matrix.python-version }}
|
|
29
|
+
|
|
30
|
+
- name: install project
|
|
31
|
+
run: uv sync --python ${{ matrix.python-version }} --locked --all-extras --dev
|
|
32
|
+
|
|
33
|
+
- name: run tests
|
|
34
|
+
run: uv run --python ${{ matrix.python-version }} pytest
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# This workflow will upload a Python Package to PyPI when a release is created
|
|
2
|
+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
|
|
3
|
+
|
|
4
|
+
# This workflow uses actions that are not certified by GitHub.
|
|
5
|
+
# They are provided by a third-party and are governed by
|
|
6
|
+
# separate terms of service, privacy policy, and support
|
|
7
|
+
# documentation.
|
|
8
|
+
|
|
9
|
+
name: Upload Python Package
|
|
10
|
+
|
|
11
|
+
on:
|
|
12
|
+
release:
|
|
13
|
+
types: [published]
|
|
14
|
+
|
|
15
|
+
permissions:
|
|
16
|
+
contents: read
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
release-build:
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
|
|
22
|
+
steps:
|
|
23
|
+
- uses: actions/checkout@v4
|
|
24
|
+
|
|
25
|
+
- uses: actions/setup-python@v5
|
|
26
|
+
with:
|
|
27
|
+
python-version: "3.x"
|
|
28
|
+
|
|
29
|
+
- name: Build release distributions
|
|
30
|
+
run: |
|
|
31
|
+
python -m pip install build
|
|
32
|
+
python -m build
|
|
33
|
+
|
|
34
|
+
- name: Upload distributions
|
|
35
|
+
uses: actions/upload-artifact@v4
|
|
36
|
+
with:
|
|
37
|
+
name: release-dists
|
|
38
|
+
path: dist/
|
|
39
|
+
|
|
40
|
+
pypi-publish:
|
|
41
|
+
runs-on: ubuntu-latest
|
|
42
|
+
needs:
|
|
43
|
+
- release-build
|
|
44
|
+
permissions:
|
|
45
|
+
# IMPORTANT: this permission is mandatory for trusted publishing
|
|
46
|
+
id-token: write
|
|
47
|
+
|
|
48
|
+
# Dedicated environments with protections for publishing are strongly recommended.
|
|
49
|
+
# For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules
|
|
50
|
+
environment:
|
|
51
|
+
name: pypi
|
|
52
|
+
url: https://pypi.org/p/align_trim
|
|
53
|
+
|
|
54
|
+
steps:
|
|
55
|
+
- name: Retrieve release distributions
|
|
56
|
+
uses: actions/download-artifact@v4
|
|
57
|
+
with:
|
|
58
|
+
name: release-dists
|
|
59
|
+
path: dist/
|
|
60
|
+
|
|
61
|
+
- name: Publish release distributions to PyPI
|
|
62
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
63
|
+
with:
|
|
64
|
+
packages-dir: dist/
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[codz]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
.DS_store
|
|
29
|
+
|
|
30
|
+
# PyInstaller
|
|
31
|
+
# Usually these files are written by a python script from a template
|
|
32
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
33
|
+
*.manifest
|
|
34
|
+
*.spec
|
|
35
|
+
|
|
36
|
+
# Installer logs
|
|
37
|
+
pip-log.txt
|
|
38
|
+
pip-delete-this-directory.txt
|
|
39
|
+
|
|
40
|
+
# Unit test / coverage reports
|
|
41
|
+
htmlcov/
|
|
42
|
+
.tox/
|
|
43
|
+
.nox/
|
|
44
|
+
.coverage
|
|
45
|
+
.coverage.*
|
|
46
|
+
.cache
|
|
47
|
+
nosetests.xml
|
|
48
|
+
coverage.xml
|
|
49
|
+
*.cover
|
|
50
|
+
*.py.cover
|
|
51
|
+
.hypothesis/
|
|
52
|
+
.pytest_cache/
|
|
53
|
+
cover/
|
|
54
|
+
|
|
55
|
+
# Translations
|
|
56
|
+
*.mo
|
|
57
|
+
*.pot
|
|
58
|
+
|
|
59
|
+
# Django stuff:
|
|
60
|
+
*.log
|
|
61
|
+
local_settings.py
|
|
62
|
+
db.sqlite3
|
|
63
|
+
db.sqlite3-journal
|
|
64
|
+
|
|
65
|
+
# Flask stuff:
|
|
66
|
+
instance/
|
|
67
|
+
.webassets-cache
|
|
68
|
+
|
|
69
|
+
# Scrapy stuff:
|
|
70
|
+
.scrapy
|
|
71
|
+
|
|
72
|
+
# Sphinx documentation
|
|
73
|
+
docs/_build/
|
|
74
|
+
|
|
75
|
+
# PyBuilder
|
|
76
|
+
.pybuilder/
|
|
77
|
+
target/
|
|
78
|
+
|
|
79
|
+
# Jupyter Notebook
|
|
80
|
+
.ipynb_checkpoints
|
|
81
|
+
|
|
82
|
+
# IPython
|
|
83
|
+
profile_default/
|
|
84
|
+
ipython_config.py
|
|
85
|
+
|
|
86
|
+
# pyenv
|
|
87
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
88
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
89
|
+
# .python-version
|
|
90
|
+
|
|
91
|
+
# pipenv
|
|
92
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
93
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
94
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
95
|
+
# install all needed dependencies.
|
|
96
|
+
#Pipfile.lock
|
|
97
|
+
|
|
98
|
+
# UV
|
|
99
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
100
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
101
|
+
# commonly ignored for libraries.
|
|
102
|
+
#uv.lock
|
|
103
|
+
|
|
104
|
+
# poetry
|
|
105
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
106
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
107
|
+
# commonly ignored for libraries.
|
|
108
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
109
|
+
#poetry.lock
|
|
110
|
+
#poetry.toml
|
|
111
|
+
|
|
112
|
+
# pdm
|
|
113
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
114
|
+
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
|
|
115
|
+
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
|
|
116
|
+
#pdm.lock
|
|
117
|
+
#pdm.toml
|
|
118
|
+
.pdm-python
|
|
119
|
+
.pdm-build/
|
|
120
|
+
|
|
121
|
+
# pixi
|
|
122
|
+
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
|
|
123
|
+
#pixi.lock
|
|
124
|
+
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
|
|
125
|
+
# in the .venv directory. It is recommended not to include this directory in version control.
|
|
126
|
+
.pixi
|
|
127
|
+
|
|
128
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
129
|
+
__pypackages__/
|
|
130
|
+
|
|
131
|
+
# Celery stuff
|
|
132
|
+
celerybeat-schedule
|
|
133
|
+
celerybeat.pid
|
|
134
|
+
|
|
135
|
+
# SageMath parsed files
|
|
136
|
+
*.sage.py
|
|
137
|
+
|
|
138
|
+
# Environments
|
|
139
|
+
.env
|
|
140
|
+
.envrc
|
|
141
|
+
.venv
|
|
142
|
+
env/
|
|
143
|
+
venv/
|
|
144
|
+
ENV/
|
|
145
|
+
env.bak/
|
|
146
|
+
venv.bak/
|
|
147
|
+
|
|
148
|
+
# Spyder project settings
|
|
149
|
+
.spyderproject
|
|
150
|
+
.spyproject
|
|
151
|
+
|
|
152
|
+
# Rope project settings
|
|
153
|
+
.ropeproject
|
|
154
|
+
|
|
155
|
+
# mkdocs documentation
|
|
156
|
+
/site
|
|
157
|
+
|
|
158
|
+
# mypy
|
|
159
|
+
.mypy_cache/
|
|
160
|
+
.dmypy.json
|
|
161
|
+
dmypy.json
|
|
162
|
+
|
|
163
|
+
# Pyre type checker
|
|
164
|
+
.pyre/
|
|
165
|
+
|
|
166
|
+
# pytype static type analyzer
|
|
167
|
+
.pytype/
|
|
168
|
+
|
|
169
|
+
# Cython debug symbols
|
|
170
|
+
cython_debug/
|
|
171
|
+
|
|
172
|
+
# PyCharm
|
|
173
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
174
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
175
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
176
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
177
|
+
#.idea/
|
|
178
|
+
|
|
179
|
+
# Abstra
|
|
180
|
+
# Abstra is an AI-powered process automation framework.
|
|
181
|
+
# Ignore directories containing user credentials, local state, and settings.
|
|
182
|
+
# Learn more at https://abstra.io/docs
|
|
183
|
+
.abstra/
|
|
184
|
+
|
|
185
|
+
# Visual Studio Code
|
|
186
|
+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
|
|
187
|
+
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
|
|
188
|
+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
|
|
189
|
+
# you could uncomment the following to ignore the entire vscode folder
|
|
190
|
+
# .vscode/
|
|
191
|
+
|
|
192
|
+
# Ruff stuff:
|
|
193
|
+
.ruff_cache/
|
|
194
|
+
|
|
195
|
+
# PyPI configuration file
|
|
196
|
+
.pypirc
|
|
197
|
+
|
|
198
|
+
# Marimo
|
|
199
|
+
marimo/_static/
|
|
200
|
+
marimo/_lsp/
|
|
201
|
+
__marimo__/
|
|
202
|
+
|
|
203
|
+
# Streamlit
|
|
204
|
+
.streamlit/secrets.toml
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
repos:
|
|
2
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
3
|
+
# Ruff version.
|
|
4
|
+
rev: v0.4.1
|
|
5
|
+
hooks:
|
|
6
|
+
# Run the linter.
|
|
7
|
+
- id: ruff
|
|
8
|
+
args: [--fix, --show-fixes]
|
|
9
|
+
# Run the formatter.
|
|
10
|
+
- id: ruff-format
|
|
11
|
+
|
|
12
|
+
- repo: https://github.com/astral-sh/uv-pre-commit
|
|
13
|
+
# uv version.
|
|
14
|
+
rev: 0.7.11
|
|
15
|
+
hooks:
|
|
16
|
+
- id: uv-lock
|
|
17
|
+
- id: uv-export
|
align_trim-1.1.0/LICENSE
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Copyright (c) 2017-2018 Nick Loman & the ZiBRA Project & the ARTIC project
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
5
|
+
in the Software without restriction, including without limitation the rights
|
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
8
|
+
furnished to do so, subject to the following conditions:
|
|
9
|
+
|
|
10
|
+
The above copyright notice and this permission notice shall be included in all
|
|
11
|
+
copies or substantial portions of the Software.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
19
|
+
SOFTWARE.
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: align_trim
|
|
3
|
+
Version: 1.1.0
|
|
4
|
+
Summary: Soft-clip primer sites for SAM/BAM files generated from amplicon sequencing runs
|
|
5
|
+
Project-URL: Repository, https://github.com/artic-network/align_trim.git
|
|
6
|
+
Project-URL: Issues, https://github.com/artic-network/align_trim/issues
|
|
7
|
+
Author-email: Nick Loman <n.j.loman@bham.ac.uk>, Sam Wilkinson <s.a.j.wilkinson@bham.ac.uk>, Chris Kent <c.g.kent@bham.ac.uk>
|
|
8
|
+
Maintainer-email: Sam Wilkinson <s.a.j.wilkinson@bham.ac.uk>, Chris Kent <c.g.kent@bham.ac.uk>
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Requires-Python: >=3.9
|
|
12
|
+
Requires-Dist: numpy
|
|
13
|
+
Requires-Dist: primalbedtools>=0.10.1
|
|
14
|
+
Requires-Dist: pysam
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
|
|
17
|
+
# align_trim
|
|
18
|
+
|
|
19
|
+
Stand alone version of ARTIC's fieldbioinformatics align_trim.py
|
|
20
|
+
|
|
21
|
+
## Installation
|
|
22
|
+
|
|
23
|
+
From conda
|
|
24
|
+
```bash
|
|
25
|
+
conda install bioconda::align_trim
|
|
26
|
+
```
|
|
27
|
+
from pypi
|
|
28
|
+
```bash
|
|
29
|
+
pip install align_trim
|
|
30
|
+
```
|
|
31
|
+
from source
|
|
32
|
+
```bash
|
|
33
|
+
git clone https://github.com/artic-network/align_trim.git
|
|
34
|
+
cd align_trim
|
|
35
|
+
uv sync
|
|
36
|
+
uv run align_trim --help
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Command Line Interface
|
|
40
|
+
|
|
41
|
+
### Basic Usage
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
align_trim [OPTIONS] BEDFILE
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
The tool reads alignment data from either a SAM/BAM file or stdin and outputs trimmed alignments to stdout in SAM format by default.
|
|
48
|
+
|
|
49
|
+
### Required Arguments
|
|
50
|
+
|
|
51
|
+
- `BEDFILE`: BED file containing the amplicon primer scheme in [v3](https://doi.org/10.5281/zenodo.16366659) format.
|
|
52
|
+
|
|
53
|
+
### Optional Arguments
|
|
54
|
+
|
|
55
|
+
#### Input/Output Options
|
|
56
|
+
|
|
57
|
+
- `--samfile`, `-s` : Sorted SAM/BAM file containing the aligned reads, if this is not provided (or '-') then 'align_trim' will read from stdin.
|
|
58
|
+
- `--output`, `-o` : Output file path. Format determined by extension (.sam/.bam). If not provided or '-', writes SAM to stdout
|
|
59
|
+
|
|
60
|
+
#### Processing Options
|
|
61
|
+
|
|
62
|
+
- `--normalise`, `-n` : Normalise to target depth N per amplicon using a greedy per-read algorithm. Each read is kept only if it brings the amplicon depth closer to the target. Use 0 for no normalisation (default: 0)
|
|
63
|
+
- `--min-mapq`, `-m` : Minimum mapping quality to keep an aligned read (default: 20)
|
|
64
|
+
- `--primer-match-threshold`, `-p` : Add this many bases of padding to the 5' end of primer coordinates to allow fuzzy matching for reads with barcodes/adapters (default: 35)
|
|
65
|
+
|
|
66
|
+
#### Primer and Read Handling
|
|
67
|
+
|
|
68
|
+
- `--no-trim-primers` : Do not trim primers from reads (by default, primers are trimmed)
|
|
69
|
+
- `--allow-incorrect-pairs` : Allow reads to be assigned to amplicons even if primers are not correctly paired
|
|
70
|
+
- `--require-full-length` : Require all reads to start and stop in primer sites (do not use with rapid barcoding)
|
|
71
|
+
|
|
72
|
+
#### Output and Reporting
|
|
73
|
+
|
|
74
|
+
- `--report`, `-r` : Output detailed report TSV to specified filepath
|
|
75
|
+
- `--amp-depth-report`, `-a` : Output mean depth for each amplicon as TSV to specified filepath
|
|
76
|
+
- `--no-read-groups` : Do not divide reads into pool-based read groups in SAM/BAM output
|
|
77
|
+
|
|
78
|
+
#### General Options
|
|
79
|
+
|
|
80
|
+
- `--verbose`, `-v` : Enable debug mode with detailed logging to stderr
|
|
81
|
+
- `--version` : Show version information
|
|
82
|
+
- `--help` : Show help message
|
|
83
|
+
|
|
84
|
+
### Examples
|
|
85
|
+
|
|
86
|
+
#### Basic trimming with primer removal
|
|
87
|
+
```bash
|
|
88
|
+
align_trim primers.bed --samfile input.bam --output trimmed.bam
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
#### Normalize coverage and generate reports
|
|
92
|
+
```bash
|
|
93
|
+
align_trim primers.bed --samfile input.bam --normalise 100 \
|
|
94
|
+
--report alignment_report.tsv --amp-depth-report depth_report.tsv \
|
|
95
|
+
--output normalized.bam
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
#### Process from stdin with verbose output
|
|
99
|
+
```bash
|
|
100
|
+
samtools view -h input.bam | align_trim primers.bed --verbose > trimmed.sam 2> verbose.out.txt
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
#### Strict full-length read filtering
|
|
104
|
+
```bash
|
|
105
|
+
align_trim primers.bed --samfile input.bam --require-full-length \
|
|
106
|
+
--min-mapq 30 --output filtered.bam
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
#### Allow mismatched primer pairs with custom threshold
|
|
110
|
+
```bash
|
|
111
|
+
align_trim primers.bed --samfile input.bam --allow-incorrect-pairs \
|
|
112
|
+
--primer-match-threshold 50 --output relaxed.bam
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Output Formats
|
|
116
|
+
|
|
117
|
+
The tool supports multiple output formats based on file extension:
|
|
118
|
+
- `.sam` - SAM format (text)
|
|
119
|
+
- `.bam` - BAM format (binary, compressed)
|
|
120
|
+
- No extension or `-` - SAM format to stdout
|
|
121
|
+
|
|
122
|
+
### Report Files
|
|
123
|
+
|
|
124
|
+
When using `--report`, a tab-separated file is generated with the following columns:
|
|
125
|
+
- `chrom`: Reference chromosome/contig
|
|
126
|
+
- `QueryName`: Read name
|
|
127
|
+
- `ReferenceStart`/`ReferenceEnd`: Alignment coordinates
|
|
128
|
+
- `PrimerPair`: Primer pair assignment
|
|
129
|
+
- `Primer1`/`Primer2`: Individual primer information
|
|
130
|
+
- `CorrectlyPaired`: Boolean indicating proper primer pairing
|
|
131
|
+
- Additional alignment metrics
|
|
132
|
+
|
|
133
|
+
The `--amp-depth-report` generates a summary of coverage depth per amplicon.
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# align_trim
|
|
2
|
+
|
|
3
|
+
Stand alone version of ARTIC's fieldbioinformatics align_trim.py
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
From conda
|
|
8
|
+
```bash
|
|
9
|
+
conda install bioconda::align_trim
|
|
10
|
+
```
|
|
11
|
+
from pypi
|
|
12
|
+
```bash
|
|
13
|
+
pip install align_trim
|
|
14
|
+
```
|
|
15
|
+
from source
|
|
16
|
+
```bash
|
|
17
|
+
git clone https://github.com/artic-network/align_trim.git
|
|
18
|
+
cd align_trim
|
|
19
|
+
uv sync
|
|
20
|
+
uv run align_trim --help
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Command Line Interface
|
|
24
|
+
|
|
25
|
+
### Basic Usage
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
align_trim [OPTIONS] BEDFILE
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
The tool reads alignment data from either a SAM/BAM file or stdin and outputs trimmed alignments to stdout in SAM format by default.
|
|
32
|
+
|
|
33
|
+
### Required Arguments
|
|
34
|
+
|
|
35
|
+
- `BEDFILE`: BED file containing the amplicon primer scheme in [v3](https://doi.org/10.5281/zenodo.16366659) format.
|
|
36
|
+
|
|
37
|
+
### Optional Arguments
|
|
38
|
+
|
|
39
|
+
#### Input/Output Options
|
|
40
|
+
|
|
41
|
+
- `--samfile`, `-s` : Sorted SAM/BAM file containing the aligned reads, if this is not provided (or '-') then 'align_trim' will read from stdin.
|
|
42
|
+
- `--output`, `-o` : Output file path. Format determined by extension (.sam/.bam). If not provided or '-', writes SAM to stdout
|
|
43
|
+
|
|
44
|
+
#### Processing Options
|
|
45
|
+
|
|
46
|
+
- `--normalise`, `-n` : Normalise to target depth N per amplicon using a greedy per-read algorithm. Each read is kept only if it brings the amplicon depth closer to the target. Use 0 for no normalisation (default: 0)
|
|
47
|
+
- `--min-mapq`, `-m` : Minimum mapping quality to keep an aligned read (default: 20)
|
|
48
|
+
- `--primer-match-threshold`, `-p` : Add this many bases of padding to the 5' end of primer coordinates to allow fuzzy matching for reads with barcodes/adapters (default: 35)
|
|
49
|
+
|
|
50
|
+
#### Primer and Read Handling
|
|
51
|
+
|
|
52
|
+
- `--no-trim-primers` : Do not trim primers from reads (by default, primers are trimmed)
|
|
53
|
+
- `--allow-incorrect-pairs` : Allow reads to be assigned to amplicons even if primers are not correctly paired
|
|
54
|
+
- `--require-full-length` : Require all reads to start and stop in primer sites (do not use with rapid barcoding)
|
|
55
|
+
|
|
56
|
+
#### Output and Reporting
|
|
57
|
+
|
|
58
|
+
- `--report`, `-r` : Output detailed report TSV to specified filepath
|
|
59
|
+
- `--amp-depth-report`, `-a` : Output mean depth for each amplicon as TSV to specified filepath
|
|
60
|
+
- `--no-read-groups` : Do not divide reads into pool-based read groups in SAM/BAM output
|
|
61
|
+
|
|
62
|
+
#### General Options
|
|
63
|
+
|
|
64
|
+
- `--verbose`, `-v` : Enable debug mode with detailed logging to stderr
|
|
65
|
+
- `--version` : Show version information
|
|
66
|
+
- `--help` : Show help message
|
|
67
|
+
|
|
68
|
+
### Examples
|
|
69
|
+
|
|
70
|
+
#### Basic trimming with primer removal
|
|
71
|
+
```bash
|
|
72
|
+
align_trim primers.bed --samfile input.bam --output trimmed.bam
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
#### Normalize coverage and generate reports
|
|
76
|
+
```bash
|
|
77
|
+
align_trim primers.bed --samfile input.bam --normalise 100 \
|
|
78
|
+
--report alignment_report.tsv --amp-depth-report depth_report.tsv \
|
|
79
|
+
--output normalized.bam
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
#### Process from stdin with verbose output
|
|
83
|
+
```bash
|
|
84
|
+
samtools view -h input.bam | align_trim primers.bed --verbose > trimmed.sam 2> verbose.out.txt
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
#### Strict full-length read filtering
|
|
88
|
+
```bash
|
|
89
|
+
align_trim primers.bed --samfile input.bam --require-full-length \
|
|
90
|
+
--min-mapq 30 --output filtered.bam
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
#### Allow mismatched primer pairs with custom threshold
|
|
94
|
+
```bash
|
|
95
|
+
align_trim primers.bed --samfile input.bam --allow-incorrect-pairs \
|
|
96
|
+
--primer-match-threshold 50 --output relaxed.bam
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Output Formats
|
|
100
|
+
|
|
101
|
+
The tool supports multiple output formats based on file extension:
|
|
102
|
+
- `.sam` - SAM format (text)
|
|
103
|
+
- `.bam` - BAM format (binary, compressed)
|
|
104
|
+
- No extension or `-` - SAM format to stdout
|
|
105
|
+
|
|
106
|
+
### Report Files
|
|
107
|
+
|
|
108
|
+
When using `--report`, a tab-separated file is generated with the following columns:
|
|
109
|
+
- `chrom`: Reference chromosome/contig
|
|
110
|
+
- `QueryName`: Read name
|
|
111
|
+
- `ReferenceStart`/`ReferenceEnd`: Alignment coordinates
|
|
112
|
+
- `PrimerPair`: Primer pair assignment
|
|
113
|
+
- `Primer1`/`Primer2`: Individual primer information
|
|
114
|
+
- `CorrectlyPaired`: Boolean indicating proper primer pairing
|
|
115
|
+
- Additional alignment metrics
|
|
116
|
+
|
|
117
|
+
The `--amp-depth-report` generates a summary of coverage depth per amplicon.
|
|
File without changes
|