An HTS-specs compliant BED toolkit.
Project description
bedspec
An HTS-specs compliant BED toolkit.
Installation
The package can be installed with pip
:
pip install bedspec
Quickstart
Writing
from bedspec import BedWriter, Bed3
bed = Bed3("chr1", start=2, end=8)
with BedWriter(open("test.bed", "w")) as writer:
writer.write(bed)
Reading
from bedspec import BedReader, Bed3
with BedReader[Bed3](open("test.bed")) as reader:
for bed in reader:
print(bed)
Bed3(contig="chr1", start=2, start=8)
BED Types
This package provides pre-defined classes for the following BED formats:
from bedspec import Bed2
from bedspec import Bed3
from bedspec import Bed4
from bedspec import Bed5
from bedspec import Bed6
from bedspec import BedPE
Custom BED Types
To create a custom BED record, inherit from the relevent BED-type:
Type | Description |
---|---|
PointBed |
BED records that are a single point (1-length) only. |
SimpleBed |
BED records that are a single interval. |
PairBed |
BED records that are a pair of intervals. |
For example, to create a custom BED3+1 class:
from dataclasses import dataclass
from bedspec import SimpleBed
@dataclass
class MyCustomBed(SimpleBed):
contig: str
start: int
end: int
my_custom_field: float
Development and Testing
See the contributing guide for more information.
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
bedspec-0.2.0.tar.gz
(122.1 kB
view hashes)
Built Distributions
Close
Hashes for bedspec-0.2.0-cp312-cp312-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b8ba4a472f49f07c4fba32a30311b75cfca0abcdd6ad3bb3ac4fe83a0278fe9 |
|
MD5 | b6c7aa7fa43f57b6f7bb92a22c8e2b5c |
|
BLAKE2b-256 | 33d7da4d873f9af73a50e6fdc9ea2ef336dac036adf36a53b118a3b73f9888d8 |
Close
Hashes for bedspec-0.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux_2_5_x86_64.manylinux1_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 648c46739a69a865040eab7fb8a5553dd6d1ba545a56620e4e9f32d00cc41f51 |
|
MD5 | 4425b04b0efd0a069acb49ede3140eb2 |
|
BLAKE2b-256 | c41d3c155b9240b5205fb1754d1b93e7711d33f7b9df0ccd431c9e9b1a276ff7 |
Close
Hashes for bedspec-0.2.0-cp312-cp312-macosx_12_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c92367d10f95bba2de0c45b41fa5b5044620ca82947473ca077141d7df749732 |
|
MD5 | b64ed8409a3ea5e686dff4e285c9c8ae |
|
BLAKE2b-256 | 717aa1bfee7886d2940588c2e2918bf1f715f0da874aa998c7942677cb96529f |