align_trim
Stand alone version of ARTIC's fieldbioinformatics align_trim.py. It assigns aligned reads from a tiling amplicon scheme to their amplicons, soft-clips the primers and can normalise depth per amplicon.
Installation
From conda
conda install bioconda::align_trim
from pypi
pip install align_trim
from source
git clone https://github.com/artic-network/align_trim.git
cd align_trim
uv sync
uv run align_trim --help
Quick start
align_trim primer.bed --samfile input.bam --output trimmed.bam
primer.bedis the primer scheme in primer.bed v3 format.input.bamis a sorted BAM of reads aligned to the scheme's reference. Leave out--samfileto read SAM/BAM from stdin.- The output format follows the extension (
.bamor.sam). Leave out--outputto write SAM to stdout.
Normalise to 200x per amplicon and write the genome coverage and amplicon QC reports:
align_trim primer.bed --samfile input.bam --output trimmed.bam \
--normalise 200 --qc-prefix sample1
Common options
| option | meaning |
|---|---|
--normalise N, -n |
keep reads until each amplicon reaches a depth of N fragments (a read pair counts once). 0 turns it off (default) |
--min-mapq, -m |
minimum mapping quality (default: 20) |
--primer-match-threshold, -p |
how far, in bases, a read end can be from a primer and still match it (default: 5) |
--allow-incorrect-pairs |
keep reads whose two ends match primers from different amplicons (reads inside two neighbouring amplicons are still removed) |
--require-full-length |
only keep reads spanning a whole amplicon (not for rapid barcoding or other fragmented libraries) |
--no-trim-primers |
assign reads but leave primers untrimmed |
--qc-prefix PREFIX |
write the genome coverage and amplicon QC reports as PREFIX.<name>.tsv |
Run align_trim --help for every option. Progress, coverage and QC summaries and warnings are printed to stderr; see terminal output.
Documentation
- Usage: every option, examples and output formats
- Report outputs:
--report,--amp-depth-reportand the genome coverage reports - QC reports: the
--qc-prefixreports and how to read them - Changelog: changes in each release, including behaviour changes in 2.0.0
Metadata
Release files for align-trim 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| align_trim-2.0.0.tar.gz | 6.7 MB | With provenance | Details for align_trim-2.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| align_trim-2.0.0-py3-none-any.whl | Python 3 | none | any | Details for align_trim-2.0.0-py3-none-any.whl |
Total release size: 6.7 MB
Release files / align_trim-2.0.0.tar.gz
| Download URL | align_trim-2.0.0.tar.gz |
|---|---|
| Size | 6.7 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b93551d4efd7e5c42f61980a7f5495dcfd82ffe79c49da55842e21b04142921f
|
|
BLAKE2b-256 checksum How to use checksums |
ddc9727ee8478febe36cf63561ebd76ef1c42547fbd64cfa8e5befb9e81365f0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.
Transparency logRelease files / align_trim-2.0.0-py3-none-any.whl
| Download URL | align_trim-2.0.0-py3-none-any.whl |
|---|---|
| Size | 29.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
aa47f9b549d4c971063863643efe4f98ee6d20f126d30e7db55758c28b2397c4
|
|
BLAKE2b-256 checksum How to use checksums |
1ec129591790c3d0bee20aa2188e184d156fb0e2391918473493679e0e156393
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.
Transparency logSecurity for align-trim 2.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for align_trim-2.0.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.