Skip to main content

PyHGNC is a Python package to access and query data provided by HGNC-approved gene nomenclature, gene families and associated resources including links to genomic, proteomic and phenotypic information.

Data are installed in a (local or remote) RDBMS enabling bioinformatic algorithms very fast response times to sophisticated queries and high flexibility by using SOLAlchemy database layer.

PyHGNC is developed by the Department of Bioinformatics at the Fraunhofer Institute for Algorithms and Scientific Computing SCAI For more in for information about PyHGNC go to the documentation.

Entity relationship model

This development is supported by following IMI projects:

IMI project logo AETIONOMY project logo PHAGO project logo SCAI project logo

Supported databases

PyHGNC uses SQLAlchemy to cover a wide spectrum of RDMSs (Relational database management system). For best performance MySQL or MariaDB is recommended. But if you have no possibility to install software on your system SQLite - which needs no further installation - also works. Following RDMSs are supported (by SQLAlchemy):

  1. Firebird

  2. Microsoft SQL Server

  3. MySQL / MariaDB

  4. Oracle

  5. PostgreSQL

  6. SQLite

  7. Sybase

Getting Started

This is a quick start tutorial for impatient.

Installation

Current version on PyPI Stable Supported Python Versions

PyHGNC can be installed with pip.

pip install pyhgnc

If you fail because you have no rights to install use superuser (sudo on Linux before the commend) or …

pip install --user pyhgnc

If you want to make sure you are installing this under python3 use …

python3 -m pip install pyhgnc

SQLite

If you don’t know what all that means skip the section MySQL/MariaDB setup.

Don’t worry! You can always later change the configuration. For more information about changing database system later go to the subtitle Changing database configuration Changing database configuration in the documentation on readthedocs.

MySQL/MariaDB setup

Log in MySQL as root user and create a new database, create a user, assign the rights and flush privileges.

CREATE DATABASE pyhgnc CHARACTER SET utf8 COLLATE utf8_general_ci;
GRANT ALL PRIVILEGES ON pyhgnc.* TO 'pyhgnc_user'@'%' IDENTIFIED BY 'pyhgnc_passwd';
FLUSH PRIVILEGES;

There are two options to set the MySQL/MariaDB.

  1. The simplest is to start the command line tool

pyhgnc mysql

You will be guided with input prompts. Accept the default value in squared brackets with RETURN. You will see something like this

server name/ IP address database is hosted [localhost]:
MySQL/MariaDB user [pyhgnc_user]:
MySQL/MariaDB password [pyhgnc_passwd]:
database name [pyhgnc]:
character set [utf8]:

Connection will be tested and in case of success return Connection was successful. Otherwise you will see following hint

Test was NOT successful

Please use one of the following connection schemas
MySQL/MariaDB (strongly recommended):
        mysql+pymysql://user:passwd@localhost/database?charset=utf8

PostgreSQL:
        postgresql://user:passwd@localhost/database

MsSQL (pyodbc needed):
        mssql+pyodbc://user:passwd@database

SQLite (always works):

- Linux:
        sqlite:////absolute/path/to/database.db

- Windows:
        sqlite:///C:\absolute\path\to\database.db

Oracle:
        oracle://user:passwd@localhost:1521/database

2. The second option is to start a python shell and set the MySQL configuration. If you have not changed anything in the SQL statements above …

import pyhgnc
pyhgnc.set_mysql_connection()

If you have used you own settings, please adapt the following command to you requirements.

import pyhgnc
pyhgnc.set_mysql_connection(host='localhost', user='pyhgnc_user', passwd='pyhgnc_passwd', db='pyhgnc')

Updating

The updating process will download the complete HGNC json file and the HCOP file.

import pyhgnc
pyhgnc.manager.database.update()

This will use either the default connection settings of PyHGNC or the settings defined by the user. It is also possible to run the update process from shell.

pyhgnc update

Quick start with query functions

Initialize the query object

query = pyhgnc.query()

Get all HGNC entries:

all_entries = query.hgnc()

More information

See the installation documentation for more advanced instructions. Also, check the change log at CHANGELOG.rst.

HGNC tools

HGNC provides also online tools .

Metadata

Release files for PyHGNC 0.2.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for PyHGNC 0.2.4
File Size Uploaded
PyHGNC-0.2.4.tar.gz 494.4 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for PyHGNC 0.2.4
File Interpreter ABI Platform
PyHGNC-0.2.4-py3-none-any.whl Python 3 none any Details
PyHGNC-0.2.4-py2-none-any.whl Python 2 none any Details

Total release size: 656.1 kB

Release files / PyHGNC-0.2.4.tar.gz

Download URL PyHGNC-0.2.4.tar.gz
Size 494.4 kB
Tags Source
SHA-256 checksum
How to use checksums
fc25abf467263b79e458263a3a638f8d401034ab85113fe1c0b68f47f49ce6be
BLAKE2b-256 checksum
How to use checksums
c14b748d767fb133b016ce603987595279612d941e300516b4c489fb481c5a53
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / PyHGNC-0.2.4-py3-none-any.whl

Download URL PyHGNC-0.2.4-py3-none-any.whl
Size 80.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
39787827b3f88c1abbce2554f0e9667cc891b01a33861124cd2bce0432ba9135
BLAKE2b-256 checksum
How to use checksums
83ba3ed68badfbfb47f73a918d4d32b17acaca805e462fb662742ff749e92331
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / PyHGNC-0.2.4-py2-none-any.whl

Download URL PyHGNC-0.2.4-py2-none-any.whl
Size 80.8 kB
Tags Python 2
SHA-256 checksum
How to use checksums
c50374df4100cf15d61f94e672a5077da6023b9cf9a16f114d0f10248b4160b5
BLAKE2b-256 checksum
How to use checksums
00d365432064ab03d459243bf2b3ce0ae40c9d00bd8d59e8dd2368c69b90df27
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.2.4 This release

3 release files

0.2.3

3 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page