Ingest and query genomic intervals from multiple BED files

Overview

Region search with tileDB

Ingest and query genomic intervals from multiple BED files.

Ingest

>>> import glob
>>> import tiles
# Get paths to local BED files.
>>> files = sorted(glob.glob('/path/to/beds/*.bed.gz'))
>>> files[:5]
[
    'ENCFF001SOF.bed.gz',
    'ENCFF001SOH.bed.gz',
    'ENCFF001SOM.bed.gz',
    'ENCFF001SON.bed.gz',
    'ENCFF001SOO.bed.gz',
]
# Create chromosome by genomic position database.
>>> tiles.create_region_array('regions')
# Load first five BEDs into tileDB.
>>> tiles.load_local('regions', files[:5])
...
generating positions
writing data
done
...
# Save accession to file index maps.
>>> tiles.save_maps('regions')
# Consolidate and vacuum database.
>>> tiles.clean('regions')

Query

>>> import tiles
# Load accession to file index maps.
>> tiles.load_maps('regions')
# Get first five intervals around POMC gene on chromosome two.
>>> tiles.query_region('regions', 2, 25132492, 25192278, limit=5)
[
    ('ENCFF001SOF.bed.gz', 25139665, 25139815),
    ('ENCFF001SOF.bed.gz', 25141485, 25141635),
    ('ENCFF001SOF.bed.gz', 25141625, 25141775),
    ('ENCFF001SOF.bed.gz', 25142065, 25142215),
    ('ENCFF001SOF.bed.gz', 25142665, 25142815),
]
# Get total number of intervals in that region.
>>> len(tiles.query_region('regions', 2, 25132492, 25192278, limit=1000))
52
# Get files with intervals in that region.
>>> tiles.query_file('regions', 2, 25132492, 25192278)
[
    'ENCFF001SOF.bed.gz',
    'ENCFF001SOH.bed.gz',
    'ENCFF001SOM.bed.gz',
]
You might also like...
This repository contains the scripts to derivate the ENU and ECEF coordinates from the longitude, latitude, and altitude values encoded in the NAD83 coordinates.
This repository contains the scripts to derivate the ENU and ECEF coordinates from the longitude, latitude, and altitude values encoded in the NAD83 coordinates.

This repository contains the scripts to derivate the ENU and ECEF coordinates from the longitude, latitude, and altitude values encoded in the NAD83 coordinates.

Python bindings and utilities for GeoJSON

geojson This Python library contains: Functions for encoding and decoding GeoJSON formatted data Classes for all GeoJSON Objects An implementation of

Manipulation and analysis of geometric objects
Manipulation and analysis of geometric objects

Shapely Manipulation and analysis of geometric objects in the Cartesian plane. Shapely is a BSD-licensed Python package for manipulation and analysis

Python interface to PROJ (cartographic projections and coordinate transformations library)
Python interface to PROJ (cartographic projections and coordinate transformations library)

pyproj Python interface to PROJ (cartographic projections and coordinate transformations library). Documentation Stable: http://pyproj4.github.io/pypr

Rasterio reads and writes geospatial raster datasets
Rasterio reads and writes geospatial raster datasets

Rasterio Rasterio reads and writes geospatial raster data. Geographic information systems use GeoTIFF and other formats to organize and store gridded,

Python bindings and utilities for GeoJSON

geojson This Python library contains: Functions for encoding and decoding GeoJSON formatted data Classes for all GeoJSON Objects An implementation of

Documentation and samples for ArcGIS API for Python

ArcGIS API for Python ArcGIS API for Python is a Python library for working with maps and geospatial data, powered by web GIS. It provides simple and

Search and download Copernicus Sentinel satellite images

sentinelsat Sentinelsat makes searching, downloading and retrieving the metadata of Sentinel satellite images from the Copernicus Open Access Hub easy

python toolbox for visualizing geographical data and making maps

geoplotlib is a python toolbox for visualizing geographical data and making maps data = read_csv('data/bus.csv') geoplotlib.dot(data) geoplotlib.show(

Owner
null
Fiona reads and writes geographic data files

Fiona Fiona reads and writes geographic data files and thereby helps Python programmers integrate geographic information systems with other computer s

null 987 Jan 4, 2023
🌐 Local tile server for viewing geospatial raster files with ipyleaflet

?? Local Tile Server for Geospatial Rasters Need to visualize a rather large raster (gigabytes) you have locally? This is for you. A Flask application

Bane Sullivan 192 Jan 4, 2023
🌐 Local tile server for viewing geospatial raster files with ipyleaflet or folium

?? Local Tile Server for Geospatial Rasters Need to visualize a rather large (gigabytes) raster you have locally? This is for you. A Flask application

Bane Sullivan 192 Jan 4, 2023
Create Siege configuration files from Cloud Optimized GeoTIFF.

cogeo-siege Documentation: Source Code: https://github.com/developmentseed/cogeo-siege Description Create siege configuration files from Cloud Optimiz

Development Seed 3 Dec 1, 2022
OSMnx: Python for street networks. Retrieve, model, analyze, and visualize street networks and other spatial data from OpenStreetMap.

OSMnx OSMnx is a Python package that lets you download geospatial data from OpenStreetMap and model, project, visualize, and analyze real-world street

Geoff Boeing 4k Jan 8, 2023
Read and write rasters in parallel using Rasterio and Dask

dask-rasterio dask-rasterio provides some methods for reading and writing rasters in parallel using Rasterio and Dask arrays. Usage Read a multiband r

Dymaxion Labs 85 Aug 30, 2022
Location field and widget for Django. It supports Google Maps, OpenStreetMap and Mapbox

django-location-field Let users pick locations using a map widget and store its latitude and longitude. Stable version: django-location-field==2.1.0 D

Caio Ariede 481 Dec 29, 2022
Deal with Bing Maps Tiles and Pixels / WGS 84 coordinates conversions, and generate grid Shapefiles

PyBingTiles This is a small toolkit in order to deal with Bing Tiles, used i.e. by Facebook for their Data for Good datasets. Install Clone this repos

Shoichi 1 Dec 8, 2021
A short term landscape evolution using a path sampling method to solve water and sediment flow continuity equations and model mass flows over complex topographies.

r.sim.terrain A short-term landscape evolution model that simulates topographic change for both steady state and dynamic flow regimes across a range o

Brendan Harmon 7 Oct 21, 2022
Using Global fishing watch's data to build a machine learning model that can identify illegal fishing and poaching activities through satellite and geo-location data.

Using Global fishing watch's data to build a machine learning model that can identify illegal fishing and poaching activities through satellite and geo-location data.

Ayush Mishra 3 May 6, 2022