Skip to main content

A python package for finding genomic range overlaps

Project description

a python library for finding genomic range overlaps based on cgranges.

Installation

pygros is available on PyPi, to install it:

pip install pygros

Usage

>>> import pygros
>>> ranges = pygros.Ranges()
>>> ranges.add('chr1', 10, 20)
>>> ranges.add('chr1', 30, 50)
>>> ranges.add('chr1', 25, 40)
>>> ranges.index()
>>> ranges.overlap('chr1', 30, 40)
[(25, 40, -1), (30, 50, -1)]

API reference

pygros.Ranges(intervals=[])

create a Ranges object to store genomic ranges

@param intervals: a list or tuple containing multiple ranges

@return Ranges object

add(chrom, start, end, label=-1)

add genomic range into Ranges object

@param chrom: chromosome name or sequence name

@param start: start of range

@param end: end of range

@param label: an integer

index()

After add new genomic ranges, use this method to build index

overlap(chrom, start, end)

get genomic ranges that overlapped with your given range (start, end)

@param chrom: chromosome or sequence name

@param start: start of range

@param end: end of range

@return: a list of ranges

within(chrom, start, end)

get genomic ranges within given range (start, end)

@param chrom: chromosome or sequence name

@param start: start of range

@param end: end of range

@return: a list of ranges

contain(chrom, start, end)

get genomic ranges that contained in given range (start, end)

@param chrom: chromosome or sequence name

@param start: start of range

@param end: end of range

@return: a list of ranges

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

pygros-0.1.2.tar.gz (4.9 kB view hashes)

Uploaded Source

Built Distributions

pygros-0.1.2-cp312-cp312-win_amd64.whl (12.6 kB view hashes)

Uploaded CPython 3.12 Windows x86-64

pygros-0.1.2-cp312-cp312-musllinux_1_1_x86_64.whl (42.8 kB view hashes)

Uploaded CPython 3.12 musllinux: musl 1.1+ x86-64

pygros-0.1.2-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (36.2 kB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

pygros-0.1.2-cp312-cp312-macosx_10_9_x86_64.whl (11.9 kB view hashes)

Uploaded CPython 3.12 macOS 10.9+ x86-64

pygros-0.1.2-cp311-cp311-win_amd64.whl (12.6 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

pygros-0.1.2-cp311-cp311-musllinux_1_1_x86_64.whl (42.8 kB view hashes)

Uploaded CPython 3.11 musllinux: musl 1.1+ x86-64

pygros-0.1.2-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (36.1 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

pygros-0.1.2-cp311-cp311-macosx_10_9_x86_64.whl (11.9 kB view hashes)

Uploaded CPython 3.11 macOS 10.9+ x86-64

pygros-0.1.2-cp310-cp310-win_amd64.whl (12.6 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

pygros-0.1.2-cp310-cp310-musllinux_1_1_x86_64.whl (42.3 kB view hashes)

Uploaded CPython 3.10 musllinux: musl 1.1+ x86-64

pygros-0.1.2-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (36.0 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

pygros-0.1.2-cp310-cp310-macosx_10_9_x86_64.whl (11.9 kB view hashes)

Uploaded CPython 3.10 macOS 10.9+ x86-64

pygros-0.1.2-cp39-cp39-win_amd64.whl (12.6 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

pygros-0.1.2-cp39-cp39-musllinux_1_1_x86_64.whl (42.0 kB view hashes)

Uploaded CPython 3.9 musllinux: musl 1.1+ x86-64

pygros-0.1.2-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (35.7 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

pygros-0.1.2-cp39-cp39-macosx_10_9_x86_64.whl (11.9 kB view hashes)

Uploaded CPython 3.9 macOS 10.9+ x86-64

pygros-0.1.2-cp38-cp38-win_amd64.whl (12.6 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

pygros-0.1.2-cp38-cp38-musllinux_1_1_x86_64.whl (42.4 kB view hashes)

Uploaded CPython 3.8 musllinux: musl 1.1+ x86-64

pygros-0.1.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (36.6 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

pygros-0.1.2-cp38-cp38-macosx_10_9_x86_64.whl (11.9 kB view hashes)

Uploaded CPython 3.8 macOS 10.9+ x86-64

pygros-0.1.2-cp37-cp37m-win_amd64.whl (12.6 kB view hashes)

Uploaded CPython 3.7m Windows x86-64

pygros-0.1.2-cp37-cp37m-musllinux_1_1_x86_64.whl (43.8 kB view hashes)

Uploaded CPython 3.7m musllinux: musl 1.1+ x86-64

pygros-0.1.2-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (36.1 kB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

pygros-0.1.2-cp37-cp37m-macosx_10_9_x86_64.whl (11.8 kB view hashes)

Uploaded CPython 3.7m macOS 10.9+ x86-64

Supported by

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