A python package that takes an assembly result of a chloroplast genome and continues it by computing the scaffolding stage.
Project description
Khloraa: scaffolding stage
khloraascaf
is a Python3 package that implements a dedicated scaffolding method for chloroplast genomes.
From input data files, it computes combinations of Integer Linear Programming (ILP) programs and write the result of the best one in output files.
Please have a look to the documentation website for more details.
Quick installation
To install the khloraascaf
package from the PyPI repository, run the pip
command :
pip install khloraascaf
You can find more installation details in the docs/src/install.md file.
Quick usage example
from pathlib import Path
from khloraascaf import SOLVER_CBC, IOConfig, MetadataAllSolutions, scaffolding
# ---------------------------------------------------------------------------- #
# Run the example
# ---------------------------------------------------------------------------- #
#
# Prepare the scaffolding result directory
#
outdir = Path('scaffolding_result')
outdir.mkdir(exist_ok=True)
#
# Compute the scaffolding using the assembly data
#
outdir_gen = scaffolding(
Path('tests/data/ir_sc/contig_attrs.tsv'),
Path('tests/data/ir_sc/contig_links.tsv'),
'C0',
solver=SOLVER_CBC,
outdir=outdir,
)
#
# khloraascaf creates a directory with a unique name
# to put all the files it has created
#
assert outdir_gen in outdir.glob('*')
print(outdir_gen)
# ---------------------------------------------------------------------------- #
# Dive into the results
# ---------------------------------------------------------------------------- #
#
# Use metadata class to easily dive into the results
# (you can also see by hand the solutions.yaml file that has been produced)
#
all_solutions_metadata = MetadataAllSolutions.from_run_directory(outdir_gen)
#
# * How many solutions the scaffolding has produced?
#
print(len(all_solutions_metadata))
# = 1, let pick its metadata
sol_metadata = tuple(all_solutions_metadata)[0]
#
# See which files the scaffolding has produced:
#
files = set(outdir_gen.glob('*'))
assert len(files) == 4
#
# * The list of oriented contigs for each region
#
assert sol_metadata.contigs_of_regions() in files
#
# * The list of oriented regions
#
assert sol_metadata.map_of_regions() in files
#
# * YAML file containing all the arguments and options you used
# to run khloraascaf
#
assert outdir_gen / IOConfig.YAML_FILE in files
#
# * YAML file that contains metadata on the solutions
#
assert outdir_gen / MetadataAllSolutions.YAML_FILE in files
Changelog
You can refer to the docs/src/changelog.md file for details.
What next?
Find a list of ideas in the docs/src/todo.md file.
Contributing
- If you find any errors, missing documentation or test, or you want to discuss features you would like to have, please post an issue (with the corresponding predefined template) here.
- If you want to help me code, please post an issue or contact me. You can find coding convention in the docs/src/contributing.md file.
References
- A part of the scaffolding method is described in this preprint:
📰 Victor Epain, Dominique Lavenier, and Rumen Andonov, ‘Inverted Repeats Scaffolding for a Dedicated Chloroplast Genome Assembler’, 3 June 2022, https://doi.org/10.4230/LIPIcs.
Licence
This work is licensed under a GNU-GPLv3 licence.
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
File details
Details for the file khloraascaf-1.10.0.tar.gz
.
File metadata
- Download URL: khloraascaf-1.10.0.tar.gz
- Upload date:
- Size: 79.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a302d459ea1acd715962f5ad2a473e126b6058a427283ffd1e3ed1fb6244119a |
|
MD5 | 167e2db4d3ae1681d54608d1f87f4b0b |
|
BLAKE2b-256 | cef6b74201e31aa5448ffb5495acb1465e37e38200918f899297b8648054c592 |
File details
Details for the file khloraascaf-1.10.0-py3-none-any.whl
.
File metadata
- Download URL: khloraascaf-1.10.0-py3-none-any.whl
- Upload date:
- Size: 71.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | de33fa8f15d3a61733ed3d4cec06d8f304a9f08ae217995666b3df6647bce775 |
|
MD5 | 5414072a3dba115b3de8669fd6760104 |
|
BLAKE2b-256 | ce11456b1c19a489a5c17b992f5e180a5942e8831fba73716ead4ea5b67b4d0a |