Skip to main content

CODX

codx is a Python package that allows retrieval of exon data from the NCBI RefSeqGene database.

Installation

pip install codx

Usage Python Package

The package uses gene IDs to retrieve exon data from the NCBI RefSeqGene database. Gene IDs can be obtained from the UniProt database using the accession ID of the gene. The get_geneids_from_uniprot function can be used to obtain the gene ID from the RefSeqGene database of NCBI.

Example Usage

Retrieve Gene IDs from UniProt

from codx.components import get_geneids_from_uniprot

# Example UniProt accession IDs
accession_ids = ["P35568", "P05019", "Q99490", "Q8NEJ0", "Q13322", "Q15323"]
gene_ids = get_geneids_from_uniprot(accession_ids)
print(gene_ids)  # Output: Set of gene IDs

Create a Database and Retrieve Gene Data

from codx.components import create_db

# Create a database with gene and exon data from NCBI
db = create_db(["120892"], entrez_email="your@email.com")  # Provide an email address for NCBI API

# Retrieve a gene object using its gene name
gene = db.get_gene("LRRK2")

# Retrieve exon data from the gene object
for exon in gene.blocks:
    print(exon.start, exon.end, exon.sequence)

# Generate all possible ordered combinations of exons
for exon_combination in gene.shuffle_blocks():
    print(exon_combination)

Six-Frame Translation of Sequences

from codx.components import three_frame_translation

# Generate six-frame translation of exon combinations
for exon_combination in gene.shuffle_blocks():
    three_frame = three_frame_translation(exon_combination.seq, only_start_with_codons=["ATG"])
    three_frame_complement = three_frame_translation(exon_combination.seq, only_start_with_codons=["ATG"], reverse=True)
    print(three_frame)
    print(three_frame_complement)

Usage Command Line

In addition to the Python API, the package provides a CLI interface for the same purpose.

CLI Usage

Usage: codx [OPTIONS] IDS

Options:
  -o, --output TEXT              Output file
  -i, --include-intron           Include intron
  -u, --uniprot                  Input is UniProt accession IDs
  -t, --translate                Translate to protein
  -3, --three-frame-translation  Translate to protein in 3 frames
  -6, --six-frame-translation    Translate to protein in 6 frames (3 forward and 3 reverse complement)
  --help                         Show this message and exit.

Example CLI Usage

Retrieve data using UniProt accession IDs:

codx -o output.fasta -u P35568,P05019,Q99490,Q8NEJ0,Q13322,Q15323

Retrieve data using gene IDs:

codx -o output.fasta 1190,120892

Metadata

Release files for codx 0.1.4

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

Source distribution (sdist)

Source distribution for codx 0.1.4
File Size Uploaded Provenance Actions
codx-0.1.4.tar.gz 8.8 kB Without provenance Details for codx-0.1.4.tar.gz

Built distribution (wheel)

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

Total release size: 19.1 kB

Release files / codx-0.1.4.tar.gz

Download URL codx-0.1.4.tar.gz
Size 8.8 kB
Tags Source
SHA-256 checksum
How to use checksums
166652b54e57db052225a960df2fb3909452f676e6e4cd816a1da7a942d812c9
BLAKE2b-256 checksum
How to use checksums
3f62bb3d4ab3279184a5d2c5855020031cbb58acd01734c4da9e75dccb12ea97
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.10.11 Windows/10

Release files / codx-0.1.4-py3-none-any.whl

Download URL codx-0.1.4-py3-none-any.whl
Size 10.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
077b9b4af895e49ba7c4d99b2fab608864e06c8cd501f8e6b11c9925b25a888b
BLAKE2b-256 checksum
How to use checksums
32d826c8e61ddac1be4445aa1ee0456265b0690dfd5be824ddd4076db0c273b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.10.11 Windows/10

Security for codx 0.1.4

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