Skip to main content

Library of Python utilities that I needed so many times

Project description

ddgen

Library of Python utilities that I needed so many times in the past

Select RefSeq transcript with the highest priority

RefSeq transcripts have following categories:

  • NM_, XM_, NR_, XR_

If we have transcripts from multiple sources, we want to select the one coming from the source with highest priority.

E.g. NM_ has higher priority than XM_.

If we have multiple transcripts from a single source, we want to select the one with smaller integer.

E.g. NM_123.4 has higher priority than NM_124.4.

from ddgen.utils import txs

# tx will be `NM_123.4`
tx = txs.prioritize_refseq_transcripts(['NM_123.4', 'NM_124.4', 'XM_100.1'])

Connect to H2 database

The H2 database is a pure Java SQL database, hence it is primarily meant to be used with Java. We can connect to the database from Python, if:

  • Java is installed on the local machine
  • the local machine runs UNIX-like OS (sorry, Windows users)

In that case:

from ddgen.db import H2DbManager

with H2DbManager("path/to/sv_database.mv.db", 
                 user="sa", 
                 password="sa") as h2:
    with h2.get_connection() as conn:
        with conn.cursor() as cur:
            # do whatever you want
            cur.execute('SELECT * FROM PBGA.CLINGEN_TRIPLOSENSITIVITY;')
            for i, x in zip(range(5), cur.fetchall()):
                # print first 5 lines 
                print(x)

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

ddgen-0.0.3.tar.gz (2.1 MB view details)

Uploaded Source

Built Distributions

ddgen-0.0.3-py3.6.egg (2.1 MB view details)

Uploaded Source

ddgen-0.0.3-py3-none-any.whl (2.1 MB view details)

Uploaded Python 3

File details

Details for the file ddgen-0.0.3.tar.gz.

File metadata

  • Download URL: ddgen-0.0.3.tar.gz
  • Upload date:
  • Size: 2.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

File hashes

Hashes for ddgen-0.0.3.tar.gz
Algorithm Hash digest
SHA256 8671c4a3a04e939ccca0aae4ba359d1de6839b110c5cff0ed9744b5a4224e841
MD5 face6661c43388a833c606af0132df0f
BLAKE2b-256 d9e004ffe752eb159f4d1818110824fd295808248baf2797303f8ef5f077a897

See more details on using hashes here.

File details

Details for the file ddgen-0.0.3-py3.6.egg.

File metadata

  • Download URL: ddgen-0.0.3-py3.6.egg
  • Upload date:
  • Size: 2.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

File hashes

Hashes for ddgen-0.0.3-py3.6.egg
Algorithm Hash digest
SHA256 fe1d8744e9c26a6fe6ff4ba437de7e24015d37d3425dbc51ef0cc9edba41e164
MD5 9ffb927127bc21a8ac8fd4a77b237704
BLAKE2b-256 23f76a1183d976e5de0e17c98df8a9bbb1c2c686f0d23e6ced9cdcfca0e1c9c5

See more details on using hashes here.

File details

Details for the file ddgen-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: ddgen-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 2.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

File hashes

Hashes for ddgen-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6bbebe6ffe181c0d30ed6966ac15d4f6b6c0e3059304de4a29b4301a1f508e91
MD5 72941ae820aacfca5057f97df9825b59
BLAKE2b-256 b5eae4601338503cf05bb554d69e660cf12bd9b221add39680ba89c8c50ba325

See more details on using hashes here.

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