Skip to content

rlichtenwalter/pg_genotype

Repository files navigation

pg_genotype

an efficient genotype representation type

Description

This type provides efficient, 1-byte packed storage of genotypes. It supports insertions and deletions as I and D, compatibility with some bioinformation software packages. Operators for I/O have been carefully selected based on benchmarking on recent x86_64 hardware. Allele order is preserved, so the type is suitable for haplotype storage. Invalid genotypes are rejected.

Installation

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

Usage

testuser=# SELECT 'AT'::genotype;
 genotype
----------
 AT
(1 row)

testuser=# SELECT 'TA'::genotype; genotype ---------- TA (1 row)

testuser=# SELECT 'ID'::genotype; genotype ---------- ID (1 row)

testuser=# SELECT 'TD'::genotype; genotype ---------- TD (1 row)

testuser=# SELECT 'BC'::genotype; ERROR: invalid input syntax for genotype: "BC" LINE 1: SELECT 'BC'::genotype;

About

an efficient genotype representation type

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published