Stage and load genomic ranges from disk.
Project description
Save and load genomic ranges objects to file
This package implements methods for saving and loading GenomicRanges and GenomicRangesList objects. It provides a language-agnostic method for serializing genomic coordinates in these objects, as well as data in related objects like sequence information. To get started, install the package from PyPI:
pip install dolomite-ranges
We can then save a GenomicRanges to a file, preserving its metadata and mcols:
import os
from tempfile import mkdtemp
from dolomite_base import read_object, save_object
from genomicranges import GenomicRanges
from iranges import IRanges
import dolomite_ranges
gr = GenomicRanges(
seqnames=["chrA", "chrB", "chrC"],
ranges=IRanges([10, 30, 2200], [20, 50, 30]),
strand=["*", "+", "-"],
)
dir = os.path.join(mkdtemp(), "granges")
save_object(gr, dir)
roundtrip = read_object(dir)
Similarly save and load a GenomicRangesList to a file,
import os
from tempfile import mkdtemp
from dolomite_base import read_object, save_object
from genomicranges import GenomicRanges, SeqInfo
from iranges import IRanges
import dolomite_ranges
a = GenomicRanges(
seqnames=["chr1", "chr2", "chr1", "chr3"],
ranges=IRanges([1, 3, 2, 4], [10, 30, 50, 60]),
strand=["-", "+", "*", "+"],
mcols=BiocFrame({"score": [1, 2, 3, 4]}),
)
b = GenomicRanges(
seqnames=["chr2", "chr4", "chr5"],
ranges=IRanges([3, 6, 4], [30, 50, 60]),
strand=["-", "+", "*"],
mcols=BiocFrame({"score": [2, 3, 4]}),
)
grl = GenomicRangesList(ranges=[a, b], names=["a", "b"])
dir = os.path.join(mkdtemp(), "granges_list")
save_object(gr, dir)
roundtrip = read_object(dir)
Note
This project has been set up using PyScaffold 4.5. For details and usage information on PyScaffold see https://pyscaffold.org/.
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 dolomite_ranges-0.4.1.tar.gz.
File metadata
- Download URL: dolomite_ranges-0.4.1.tar.gz
- Upload date:
- Size: 25.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
386d8e53d3e40f3b01d51636b07f025748489d7753649621f4e90c3c90dfff3c
|
|
| MD5 |
7f21f8620f5e4bca704e0f55ebfa9dc8
|
|
| BLAKE2b-256 |
11771bfe18a0830ca2ed77234df5d7d0963a5a390a5d3ec2d0e2a61a0ffdb70a
|
Provenance
The following attestation bundles were made for dolomite_ranges-0.4.1.tar.gz:
Publisher:
publish-pypi.yml on ArtifactDB/dolomite-ranges
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dolomite_ranges-0.4.1.tar.gz -
Subject digest:
386d8e53d3e40f3b01d51636b07f025748489d7753649621f4e90c3c90dfff3c - Sigstore transparency entry: 1530302778
- Sigstore integration time:
-
Permalink:
ArtifactDB/dolomite-ranges@ed7b61e0d2e2e7360ab244be708e7d694a635a02 -
Branch / Tag:
refs/tags/0.4.1 - Owner: https://github.com/ArtifactDB
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@ed7b61e0d2e2e7360ab244be708e7d694a635a02 -
Trigger Event:
push
-
Statement type:
File details
Details for the file dolomite_ranges-0.4.1-py3-none-any.whl.
File metadata
- Download URL: dolomite_ranges-0.4.1-py3-none-any.whl
- Upload date:
- Size: 11.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
73b9fd12cffcc135a6ccfe5355da9cfbaa088f7dd534f79d38404d09c7a68610
|
|
| MD5 |
3235a21f165a7dcb614e725e4476a8ae
|
|
| BLAKE2b-256 |
495a465a18229c42460b78ba190bd63ca760b4e5cc36162d1ade7da6d7a9b5aa
|
Provenance
The following attestation bundles were made for dolomite_ranges-0.4.1-py3-none-any.whl:
Publisher:
publish-pypi.yml on ArtifactDB/dolomite-ranges
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dolomite_ranges-0.4.1-py3-none-any.whl -
Subject digest:
73b9fd12cffcc135a6ccfe5355da9cfbaa088f7dd534f79d38404d09c7a68610 - Sigstore transparency entry: 1530302887
- Sigstore integration time:
-
Permalink:
ArtifactDB/dolomite-ranges@ed7b61e0d2e2e7360ab244be708e7d694a635a02 -
Branch / Tag:
refs/tags/0.4.1 - Owner: https://github.com/ArtifactDB
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@ed7b61e0d2e2e7360ab244be708e7d694a635a02 -
Trigger Event:
push
-
Statement type: