Skip to main content

Find anchors in RNA/DNA sequences.

AnchoRNA is designed to find anchors, i.e. conserved regions, in coding sequences in a set of similar sequences. Anchors are stored as GFF files. Anchors can be viewed in JalView. You can cut out sequences relative to anchors for import into external tools.

AnchoRNA supports curation and iterative refinement of anchors. It can also be used to find anchors in non-coding sequences or amino acid sequences.

Installation

Use pip to install anchorna. It is best installed in a dedicated (conda) environment.

pip install anchorna

To install the latest development version, use:

pip install https://github.com/rnajena/anchorna/archive/refs/heads/master.zip

To install the package in editable mode, clone the repository and install with pip -e repo_path.

Usage & Tutorial

The motivation, algorithm and performance of AnchoRNA are described in the following preprint:

Tom Eulenfeld, Sandra Triebel, Manja Marz (2025), AnchoRNA: Full virus genome alignments through conserved anchor regions, doi:10.1101/2025.01.30.635689 [pdf]

A command line tool is provided, see anchorna -h and the help of subcommands. An example configuration file can be created with anchorna create. See the example configuration file for a description of AnchoRNA's options. Consult the API documentation for details.

Please first get an overview of the available commands with

anchorna -h

Help is available for each command, e.g. try anchorna go -h.

Start the tutorial with

anchorna create --tutorial

We provide here some CLI calls. Please run each of them separately and carefully try to understand what they do.

# Identify anchors, use 8 cores
anchorna go --njobs 8 anchors.gff

# Print anchors
anchorna print anchors.gff
anchorna print -v anchors.gff
anchorna print --mode nt anchors.gff

# View anchors in Jalview (amino acid sequences) and
# align with the second anchor
anchorna view anchors.gff --align A1
# For reference, the following commands are called under the hood
# by anchorna view
#anchorna export anchors.gff --fmt jalview -o jalview_fts.txt
#sugar translate --cds pesti_example.gff -o pestiaa.fasta
#jalview pestiaa.fasta --features jalview_fts.txt

# View anchors in Jalview (nucleotide sequences)
anchorna view --mode nt anchors.gff

# We are not satisfied with the anchor 8, remove it and check the resulting anchors in
# Jalview, afterwards save to new anchor file
anchorna combine "anchors.gff||a8" | anchorna view -
anchorna combine "anchors.gff||a8" -o anchors2.gff
# Note that anchors are renumbered, the anchor number is not a property of each anchor,
# it is just used as a simple reference later on
anchorna print anchors2.gff

# Cutout subsequences starting before start codon and ending 10 nucleotides
# after 3rd anchor (remember 0-based indexing) for usage in external tool
anchorna cutout anchors2.gff "ATG" "A2+10" -o pestiA3.fasta

# <, > can be used to specify left and right end of anchor, ^ to reference the middle position,
# by default the anchor is included in the cutout, therefore the above call is the same as
#anchorna cutout anchors2.gff "ATG<" "A2>+10" -o pestiA3.fasta



### Advanced
# Load anchors into IPython session
anchorna load anchors2.gff

# Run anchorna on subsequences and combine results into a single anchor file
# We are not satisfied with the long region (~ 2000 nt) without any anchors,
# find two anchors immediately before and after this "empty" region with
anchorna view anchors2.gff

# The following command is a bit long, but it does the job well.
# It cuts out sequences between the two anchors
# (please replace the ?? characters with the anchors around the "empty region")
# and writes the sequences to stdout, which is piped into the next command.
# --fmt sjson makes this work, because we need to preserve some metadata,
# which is not guaranteed by fasta, the default output format.
# anchorna go --fname - tells anchorna to run the algorithm with the subsequences from stdin.
# Also, some options are relaxed to find more anchors in this region.
anchorna cutout anchors2.gff "A??>" "A??<" --fmt sjson | anchorna go --fname - --thr-quota-add-anchor 0.9 anchors_sub.gff

# We found more anchors and investigate these
anchorna print anchors_sub.gff
anchorna view anchors_sub.gff
# Finally we merge the two anchor files
anchorna combine anchors2.gff anchors_sub.gff -o anchors_final.gff
anchorna print anchors_final.gff
anchorna view anchors_final.gff

Run tests

Clone or download this repository cd into tests folder and call pytest.

python_logo sugar_logo

Metadata

Release files for anchorna 2.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for anchorna 2.0.1
File Size Uploaded Provenance Actions
anchorna-2.0.1.tar.gz 269.9 kB Without provenance Details for anchorna-2.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for anchorna 2.0.1
File Interpreter ABI Platform Actions
anchorna-2.0.1-py3-none-any.whl Python 3 none any Details for anchorna-2.0.1-py3-none-any.whl

Total release size: 538.4 kB

Release files / anchorna-2.0.1.tar.gz

Download URL anchorna-2.0.1.tar.gz
Size 269.9 kB
Tags Source
SHA-256 checksum
How to use checksums
ff5fac62baa87ccb0e63c4f5ae7e827f4dc530dc7550b5ba2c8e298f764641e3
BLAKE2b-256 checksum
How to use checksums
2fe3a7573e94fb92133848a96e42d201bc1cbcbbd5023b9f8223af2986d140bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.0

Release files / anchorna-2.0.1-py3-none-any.whl

Download URL anchorna-2.0.1-py3-none-any.whl
Size 268.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
877a69a4a7bba1695b7980af9d494838c5abe8d408603854d886a367f3a73ea9
BLAKE2b-256 checksum
How to use checksums
251427b8885177dcf57b2cbc65f1cadd11bb73cad4ac5a72ba9c8bc3c196ef4e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.0

Security for anchorna 2.0.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page