Giter Site home page Giter Site logo

pg_variant_functions's Introduction

pg_variant_tools

efficient functions for variant analyses over TINYINT[] genotype representations

Description

This is a work-in-progress to develop functions for efficiently computing summary variant information over an array of genotypes stored in TINYINT[]. At the moment, it is little more than a collection of a couple of functions that I have used for this purpose and not the development of a function library per se.

Currently included are:

  • alternate_allele_frequency( TINYINT[], INTEGER[] ) - a function over an array of genotypes and a corresponding array of indices into that array we should use
  • summarize_variant( TINYINT[], INTEGER[], INTEGER[] )a function over an array of genotypes and two corresponding array of indices into that array we should use, both of which can be null

The output format for summarize_variant is as a variant_summary user-defined type, which has fields:

  • whole genotype array call rate
  • whole genotype array minor allele frequency
  • first subset call rate if first subset index array is not NULL, otherwise NULL
  • first subset minor allele frequency if first subset index array is not NULL, otherwise NULL
  • second sbuset call rate if second subset index array is not NULL, otherwise NULL
  • second subset minor allele frequency if second subset index array is not NULL, otherwise NULL

The interfaces beg for improvement with these functions. The summarize_variant function should be variadic on the number of subsets to accept. This I will perhaps do if there is not a large penalty to variadic argument construction with large arrays. It would be ideal for both functions to operate modularly with array_multi_index, but this requires additional scans of potentially very large arrays and sacrifices too much computational effort. Finally, returning an array would be more flexible than returning a tuple as a custom data type, which is particularly necessary if I develop a variadic function.

Installation

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

Usage


pg_variant_functions's People

Contributors

rlichtenwalter avatar

Stargazers

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.