Add your description here
Project description
sort-contigs
sort-contigs - Order genome assembly contigs by alignment to reference .fasta
Author: Paul Grablowitz
Source: Github
Description
This python program, sort-contigs, sorts contigs from a query FASTA file
based on their alignment to a target reference genome using a PAF
(Pairwise Alignments Format) file.
It determines the best matching target contig and optimal orientation (forward or reverse complement) for each query contig, then orders the query contigs along each target contig according to their alignment positions. Unaligned contigs are appended at the end.
Query contigs are assigned to target contigs by identifying the target contigs with the largest sum of aligned bases. Assigned query contigs are ordered along a target contig by identifying the location with the longest alignment. The same alignment is used to define optimal orientation of query contigs respective to assigned target contigs.
The sorted contigs are written to an output FASTA file, with an option to rename them sequentially.
The script uses BioPython for FASTA handling and
pandas for PAF file processing.
Usage
The program can be used as in following example:
Alignment
The first step consists of aligning the query genome to the target reference. The code below is a minimal example and may be required to be adjusted for certain conditions.
# Align query assembly to target genome
minimap2 \
-x asm5 \
target.fasta \
query.fasta \
> alignment.paf
Reordering
The following code shows an example, how to perform reordering of query contigs respective to alignment to target reference.
# Perform reordering steps based on supplied alignment
sort-contigs \
-p alignment.paf \
-q query.fasta \
-t target.fasta \
-o query-reordered.fasta
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sort_contigs-0.2.2.tar.gz.
File metadata
- Download URL: sort_contigs-0.2.2.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"NixOS","version":"25.11","id":"xantusia","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
93e4c6633ccc7460a8b4e3e7b535816fb79c40153cc234526d2be8394bb916eb
|
|
| MD5 |
8cf6df384ba8d3fec451ecabee6edc04
|
|
| BLAKE2b-256 |
2758d387bd8ca772f4417465b3293d57ab2ade36943bc883dec15eec2fd78b6b
|
File details
Details for the file sort_contigs-0.2.2-py3-none-any.whl.
File metadata
- Download URL: sort_contigs-0.2.2-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"NixOS","version":"25.11","id":"xantusia","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c464f6038a749f8e134dc5fcdf6531e56db11ae8f166be82c7df68b926825218
|
|
| MD5 |
9097388df14a73cadb51f1914a979f3e
|
|
| BLAKE2b-256 |
3b98e920b98a1c6df0f5a701bab70ad6339b69c602e91e984ef399b54d61babf
|