Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/scripts/setup_azurite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ tar xzvf $GITHUB_WORKSPACE/test/inputs/sanity.test.tgz -C oldstyle_dir
az storage blob upload-batch -d test/oldstyle-dir -s oldstyle_dir --connection-string $AZURE_CONNECTION_STRING
export OLDSTYLE_DIR=az://test/oldstyle-dir

cd $GITHUB_WORKSPACE/examples
cd $GITHUB_WORKSPACE/test/scripts
tar xzvf examples_ws.tgz
az storage blob upload-batch -d test/ws -s ws --connection-string $AZURE_CONNECTION_STRING
export WORKSPACE=az://test/ws
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/basic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,14 @@ jobs:
run: |
PYTHONPATH=. pytest
PYTHONPATH=. python test/test.py
PYTHONPATH=. examples/test.sh
PYTHONPATH=. test/scripts/test.sh

- name: Cloud Test - Azurite
run: |
source .github/scripts/setup_azurite.sh
echo "Testing on Azurite..."
echo "WORKSPACE=$WORKSPACE OLDSTYLE_DIR=$OLDSTYLE_DIR"
PYTHONPATH=. ./examples/test.sh
PYTHONPATH=. test/scripts/test.sh
ls -l /tmp/tiledb_bookkeeping
echo "Testing on Azurite DONE"

Expand Down
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ clean-test: ## remove test and coverage artifacts
rm -fr .pytest_cache

format: ## format files with black and isort
black --line-length 120 setup.py src test examples/genomicsdb_*
isort --profile black --line-length 120 setup.py src test examples/genomicsdb_*
black --line-length 120 setup.py src test genomicsdb/scripts
isort --profile black --line-length 120 setup.py src test genomicsdb/scripts

lint: ## check style with flake8 and vulnerabilities with bandit
bandit -r setup.py src
flake8 --extend-ignore='E203, N803, N806, E402' --max-line-length=120 setup.py src test examples/genomicsdb_*
black --check --line-length 120 setup.py src test examples/genomicsdb_*
isort --profile black --line-length 120 -c setup.py src test examples/genomicsdb_*
flake8 --extend-ignore='E203, N803, N806, E402' --max-line-length=120 setup.py src test genomicsdb/scripts
black --check --line-length 120 setup.py src test genomicsdb/scripts
isort --profile black --line-length 120 -c setup.py src test genomicsdb/scripts
cython-lint --max-line-length 120 src/*.pyx

test: FORCE ## run tests quickly with the default Python
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[![pypi](https://img.shields.io/pypi/v/genomicsdb.svg)](https://pypi.org/project/genomicsdb/)

# GenomicsDB-Python
Experimental Python 3 Bindings to the native [GenomicsDB](https://github.com/GenomicsDB/GenomicsDB) library. Only queries are supported for now. For importing vcf files into GenomicsDB, use the command line tools - `vcf2genomicsdb` or `gatk GenomicsDBImport`.
Python 3 Bindings to the native [GenomicsDB](https://github.com/GenomicsDB/GenomicsDB) library. Only queries are supported for now. For importing vcf files into GenomicsDB, use the command line tools - `vcf2genomicsdb` or `gatk GenomicsDBImport`.

## Installation : Only Linux and MacOS are currently supported
Install `genomicsdb` binary wheels from PyPi with pip:
Expand All @@ -19,5 +19,8 @@ cd genomicsdb-<version>
python setup.py install
```

## GenomicsDB console scripts
See [GenomicsDB query tool](https://github.com/GenomicsDB/GenomicsDB-Python/blob/master/genomicsdb/scripts/README.md). The available scripts are `genomicsdb_query` and `genomicsdb_cache` with the supported output options being csv, json and parquet files.

## Development
See [instructions](https://github.com/GenomicsDB/GenomicsDB-Python/blob/master/INSTALL.md) for local builds and running tests.
File renamed without changes.
Empty file added genomicsdb/scripts/__init__.py
Empty file.
5 changes: 2 additions & 3 deletions examples/genomicsdb_cache → genomicsdb/scripts/genomicsdb_cache.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#
# The MIT License
#
# Copyright (c) 2024 dātma, inc™
# Copyright (c) 2024-2025 dātma, inc™
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand All @@ -29,9 +29,8 @@
import argparse
import json

import genomicsdb_common

import genomicsdb
from genomicsdb.scripts import genomicsdb_common


def is_cloud_path(path):
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions examples/genomicsdb_query → genomicsdb/scripts/genomicsdb_query.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#
# The MIT License
#
# Copyright (c) 2024 dātma, inc™
# Copyright (c) 2024-2025 dātma, inc™
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -35,14 +35,14 @@
import sys
from typing import List, NamedTuple

import genomicsdb_common
import pyarrow as pa
import pyarrow.parquet as pq

import genomicsdb
from genomicsdb import json_output_mode
from genomicsdb.protobuf import genomicsdb_coordinates_pb2 as query_coords
from genomicsdb.protobuf import genomicsdb_export_config_pb2 as query_pb
from genomicsdb.scripts import genomicsdb_common

logging.basicConfig(
format="%(asctime)s.%(msecs)03d %(levelname)-5s GenomicsDB Python - pid=%(process)d tid=%(thread)d %(message)s",
Expand Down
14 changes: 10 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# The MIT License (MIT)
#
# Copyright (c) 2023 dātma, inc™
# Copyright (c) 2023-2025 dātma, inc™
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
Expand Down Expand Up @@ -146,7 +146,7 @@ def run_cythonize(src):

setup(
name="genomicsdb",
description="Experimental Python Bindings for querying GenomicsDB",
description="Python Bindings for querying GenomicsDB",
long_description=long_description,
long_description_content_type="text/markdown",
author="GenomicsDB.org",
Expand All @@ -159,12 +159,18 @@ def run_cythonize(src):
setup_requires=["cython>=0.27"],
install_requires=install_requirements,
python_requires=">=3.9",
packages=find_packages(exclude=["package", "test"]),
packages=find_packages(include=["genomicsdb", "genomicsdb.*"], exclude=["package", "test"]),
keywords=["genomics", "genomicsdb", "variant", "vcf", "variant calls"],
include_package_data=True,
version=with_version,
entry_points={
"console_scripts": [
"genomicsdb_query=genomicsdb.scripts.genomicsdb_query:main",
"genomicsdb_cache=genomicsdb.scripts.genomicsdb_cache:main",
],
},
classifiers=[
"Development Status :: 3 - Alpha",
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Intended Audience :: Information Technology",
"Intended Audience :: Science/Research",
Expand Down
File renamed without changes.
34 changes: 34 additions & 0 deletions test/scripts/genomicsdb_cache
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/env python

#
# genomicsdb_cache wrappper
#
# The MIT License
#
# Copyright (c) 2025 dātma, inc™
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#

import sys

from genomicsdb.scripts.genomicsdb_cache import main

if __name__ == '__main__':
sys.exit(main())
34 changes: 34 additions & 0 deletions test/scripts/genomicsdb_query
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/env python

#
# genomicsdb_query wrapper
#
# The MIT License
#
# Copyright (c) 2025 dātma, inc™
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#

import sys

from genomicsdb.scripts.genomicsdb_query import main

if __name__ == '__main__':
sys.exit(main())
2 changes: 1 addition & 1 deletion examples/test.sh → test/scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ rm -f loader.json callset.json vidmap.json
if [[ -z $OLDSTYLE_DIR ]]; then
OLDSTYLE_DIR=$TEMP_DIR/old_style
mkdir -p $OLDSTYLE_DIR
tar xzf $(dirname $0)/../test/inputs/sanity.test.tgz -C $OLDSTYLE_DIR
tar xzf $(dirname $0)/../inputs/sanity.test.tgz -C $OLDSTYLE_DIR
fi
WORKSPACE=$OLDSTYLE_DIR/ws

Expand Down