Skip to main content

bs-cpg

This is the main documentation homepage for bs-cpg. For comprehensive module-specific documentation, API references, and examples, see the sections below. For development guidance, see the Developer Guide.

Module Documentation

Detailed documentation for each module is available in separate notebooks:

Quick Start

Basic Workflow Example

Here’s a simple workflow to get started with bs-cpg:

from bs_cpg.setup import read_sample_cpg, get_base_data_path
from bs_cpg.liftover_ps import cpg_reads, cpg_percent, liftover_positions

# 1. Load sample CpG data
df = read_sample_cpg(["chromosome", "pos"])

# 2. Validate CpG sites
reads = cpg_reads(df["chromosome"], df["pos"], "hg19", index_base=1)
percent_valid = cpg_percent(reads)
print(f"Valid CpG sites: {percent_valid:.1f}%")

# 3. Perform liftover to hg38
new_chroms, new_pos = liftover_positions(
    chromosomes=df["chromosome"],
    positions=df["pos"],
    genome_from="hg19",
    genome_to="hg38",
    index_base_from=1,
    index_base_to=1
)

Installation & Setup

Installation

Install latest from the GitHub repository:

$ pip install git+https://github.com/magistak/bs-cpg.git

or from pypi

$ pip install bs_cpg

Note: Ensure you have htslib (specifically bgzip) installed and in your PATH for reference genome processing.

Documentation

Documentation can be found hosted on this GitHub repository’s pages. Package releases are available on pypi.

from bs_cpg.download_processed import Geofetcher
geo = Geofetcher(just_metadata=True)
projects = geo.get_projects('GSE51239')
2

Liftover & Validation (bs_cpg.liftover_ps)

Perform genomic liftover while explicitly handling 0-based or 1-based indexing:

from bs_cpg.liftover_ps import liftover_positions
new_chroms, new_pos = liftover_positions(
    chromosomes=["chr1"], 
    positions=[100001], 
    genome_from="hg19", 
    genome_to="hg38", 
    index_base_from=1
)

You can also validate CpG site integrity using cpg_percent(reads).

Metadata

Release files for bs-cpg 0.0.2

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

Source distribution (sdist)

Source distribution for bs-cpg 0.0.2
File Size Uploaded Provenance Actions
bs_cpg-0.0.2.tar.gz 18.8 kB Without provenance Details for bs_cpg-0.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bs-cpg 0.0.2
File Interpreter ABI Platform Actions
bs_cpg-0.0.2-py3-none-any.whl Python 3 none any Details for bs_cpg-0.0.2-py3-none-any.whl

Total release size: 36.7 kB

Release files / bs_cpg-0.0.2.tar.gz

Download URL bs_cpg-0.0.2.tar.gz
Size 18.8 kB
Tags Source
SHA-256 checksum
How to use checksums
27e0fc43eb9d8f90734864ba1a885fa2608362ccf5969f992ef932ecabfcbc83
BLAKE2b-256 checksum
How to use checksums
39683f9e399b2870a136654ca5b8229ddfd30b948396e59d48108f8bfd6406ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.11

Release files / bs_cpg-0.0.2-py3-none-any.whl

Download URL bs_cpg-0.0.2-py3-none-any.whl
Size 17.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ce6a51266c0238258acba0588ce84dda4bb499213e770b0482005a5063e2a0b9
BLAKE2b-256 checksum
How to use checksums
2d1a4d57eb3952920e00661bb9188c5639a06799e6fc61fb61b1afbf35eb31d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.11

Security for bs-cpg 0.0.2

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.

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files No provenance

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