Skip to main content

Calculate consensus sequences

Project description

accord-rs

To bring something into accord (/əˈkɔrd/) is to make it agree or correspond. The accord-rs library calculates a consensus from reads that where aligned against a reference sequence.

This library is in the early alpha stage, and its API may be subject to change without notice.

Python

Accord provides bindings for consensus calculation from Python code. Install with pip install accord-rs, and then use like so:

from accord import Calculator
from accord.data import AlnQualityReqs, Seq

# settings for consensus calculation
reqs = AlnQualityReqs(
    min_mapq=10,            # minimum mapping quality
    mandatory_flags=0,      # required SAM flags, see: https://broadinstitute.github.io/picard/explain-flags.html
    prohibited_flags=1540,  # no unmapped, failing quality or optical duplicate reads
    indel_cutoff=0.1,       # only indels contained in at least 10 % of reads covering that position are considered
    save_ends=0,            # this has no function yet - only relevant when using PCR fragments
    min_observations=50,    # base coverage needs to be at least 50
)

# generate the consensus and alignment statistics
calc = Calculator(reqs)
consensus = calc.calculate("/path/to/reference.fasta", "/path/to/aln.bam")

aln_path = "/home/fynn/Desktop/HIV/HIV-Pipeline/out/02_mapping/alignments/200626_20-07149_HIV20-00278_F483_9_MiS85_S1_L000_001.cyc01.bam"
ref_path = "/home/fynn/Desktop/HIV/HIV-Pipeline/tst/assets/references/HXB2_K03455.fasta"
# print the consensus as a FASTA record
print(consensus.consensus_seq.to_fasta())

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

accord_rs-0.0.5a1.tar.gz (25.2 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

accord_rs-0.0.5a1-cp313-cp313t-manylinux_2_34_x86_64.whl (3.1 MB view details)

Uploaded CPython 3.13tmanylinux: glibc 2.34+ x86-64

accord_rs-0.0.5a1-cp313-cp313-manylinux_2_34_x86_64.whl (3.1 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

accord_rs-0.0.5a1-cp312-cp312-manylinux_2_34_x86_64.whl (3.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

accord_rs-0.0.5a1-cp311-cp311-manylinux_2_34_x86_64.whl (3.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

accord_rs-0.0.5a1-cp310-cp310-manylinux_2_34_x86_64.whl (3.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

accord_rs-0.0.5a1-cp39-cp39-manylinux_2_34_x86_64.whl (3.1 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.34+ x86-64

accord_rs-0.0.5a1-cp38-cp38-manylinux_2_34_x86_64.whl (3.1 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.34+ x86-64

File details

Details for the file accord_rs-0.0.5a1.tar.gz.

File metadata

  • Download URL: accord_rs-0.0.5a1.tar.gz
  • Upload date:
  • Size: 25.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.8.2

File hashes

Hashes for accord_rs-0.0.5a1.tar.gz
Algorithm Hash digest
SHA256 35ab83d5a3561619a83e16dedf89a7bcb47aff7b29415f5410fff20d2ffb6252
MD5 222a0f6423feeb7273dab65b98e81c21
BLAKE2b-256 4a2a09c854a034ec9efda61f49ad1493cee04e7cd53dd9e06678f9ab47453443

See more details on using hashes here.

File details

Details for the file accord_rs-0.0.5a1-cp313-cp313t-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for accord_rs-0.0.5a1-cp313-cp313t-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 4af2b5f843a27739843a01c141fec7f93ddea3539b72abe93667f0b249dc5ea4
MD5 710dfa501c87f1893fd6ccd21e8c02cb
BLAKE2b-256 0f975c28863fd522d8c9da7cfa5e06f863f453eb071d98b329fb3bdfe2040c28

See more details on using hashes here.

File details

Details for the file accord_rs-0.0.5a1-cp313-cp313-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for accord_rs-0.0.5a1-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 7cc5b420da47ae3ed890f1dd04a3f90f9c5fab6b411b60d7cdc4796b5495d01f
MD5 2372a967bbaac6838e859f7467743585
BLAKE2b-256 37056dddf21b7aab7058d9e4f3700125ab70162214210c2ab07ccb1ad795c0a5

See more details on using hashes here.

File details

Details for the file accord_rs-0.0.5a1-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for accord_rs-0.0.5a1-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 59483d6e4dd56e49dbcb01ed9bd7e969d9b21cd1f0126042358011b2b91c1fac
MD5 b23df58ac355ad278dd49255e1801fee
BLAKE2b-256 bd9d6417c1d867f19155bd33a1853b4d11930f748bc84ce23b3a5d17b8e16faa

See more details on using hashes here.

File details

Details for the file accord_rs-0.0.5a1-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for accord_rs-0.0.5a1-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 3c54b71a1d59d2077758da1381c872527d5fe14e93a6e3e31c1d54b539342ac5
MD5 f4caa0d235633b2e087e6ccf895a7ecc
BLAKE2b-256 f021e8bae9f5cc58b667b422638e72226a3c8865dbd7206143bc54a525614780

See more details on using hashes here.

File details

Details for the file accord_rs-0.0.5a1-cp310-cp310-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for accord_rs-0.0.5a1-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 f28af6c2bf78597d84961dca8c99a38fe2ab69511a8bc254e5ab77ba95de2246
MD5 e7a65080115e552f6b331baf81f7f5b1
BLAKE2b-256 0aab717b4cdc270b4a7d4f8add9cfac7c79db6af6b4bfc8176521cba03af4789

See more details on using hashes here.

File details

Details for the file accord_rs-0.0.5a1-cp39-cp39-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for accord_rs-0.0.5a1-cp39-cp39-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 4b65518fec9c613a134bfa8107ff589235fbf39b85801d31831b60633a189981
MD5 fb392055f9fb8ff78286e4772861d4f0
BLAKE2b-256 88023ab40fe2045a7820272d609f5840c04a6cd6e905061fc6bd9b3565f8aedf

See more details on using hashes here.

File details

Details for the file accord_rs-0.0.5a1-cp38-cp38-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for accord_rs-0.0.5a1-cp38-cp38-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 7f88db2ab9eca3b584a47c2c5650ff892f05df65b299b2a7d7de1d99fe0f6fac
MD5 071dea388bb9534e998ad3ebaab7eff0
BLAKE2b-256 c1aeb2334b14c491649d3959959a391702114c09adddb3b66b10175953d7c3a9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page