Giter Site home page Giter Site logo

pg_imputed_genotype's Introduction

pg_imputed_genotype

an efficient, packed probability tuple suitable for imputed genotypes

Description

The general functionality of this type is to support a probability-triple stored in 4 bytes. Each probability is recorded in 10-bits as a positive integer ranging from 0 to 1000. Operators for I/O have been carefully selected based on benchmarking on recent x86_64 hardware. The storage of a probability triple with 10-bits of precision per probability makes this type ideal for storing imputed genotype data in PostgreSQL arrays.

Installation

curl -s -S -L https://github.com/rlichtenwalter/pg_imputed_genotype/archive/master.zip > pg_imputed_genotype.zip
unzip pg_imputed_genotype.zip
(cd pg_imputed_genotype-master && make PG_CONFIG=<optional custom pg_config path>)
(cd pg_imputed_genotype-master && make PG_CONFIG=<optional custom pg_config path> install)
(cd ~postgres && sudo -u postgres psql -c 'CREATE EXTENSION pg_imputed_genotype;')

Usage

testuser=# SELECT '{0.5,0.5,0.0}'::imputed_genotype;
 imputed_genotype
------------------
 {0.500,0.500,0}
(1 row)

testuser=# SELECT '{0.5,0.5,0.1}'::imputed_genotype; ERROR: imputed_genotype probabilities must sum to <= 1.0: "{0.5,0.5,0.1}" LINE 1: SELECT '{0.5,0.5,0.1}'::imputed_genotype; ^

testuser=# SELECT '{0.2,0.5,0.1}'::imputed_genotype; imputed_genotype --------------------- {0.200,0.500,0.100} (1 row)

pg_imputed_genotype's People

Contributors

rlichtenwalter avatar

Stargazers

Павел "Malo" Скрылёв  avatar Georgy Shelkovy avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.