Coder Social home page Coder Social logo

lightning-auriga / interpolate-genetic-position Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 214 KB

Use reference genetic map to interpolate genetic position for a query set of variants

Home Page: https://github.com/lightning-auriga/interpolate-genetic-position

License: MIT License

Makefile 1.02% M4 0.69% Shell 0.02% C++ 98.27%
gwas population-genetics recombination statistical-genetics

interpolate-genetic-position's People

Contributors

lightning-auriga avatar

Watchers

 avatar

interpolate-genetic-position's Issues

handle query bedfiles with non-contiguous regions

This program now needs to correctly emit output for input query bedfiles with non-contiguous regions, e.g.

chr22	17083846	17084000	thing1
chr22	17084050	17084145	thing2

Assuming an input genetic map (bedgraph format, base 0) like this:

chr22	17076254	17081023	0	0
chr22	17081023	17083846	0.137252	0
chr22	17083846	17084017	4.00811	0.000387462396
chr22	17084017	17084145	1.91398e-06	0.001072849206
chr22	17084145	17086809	0.925629	0.00107284945098944
chr22	17086809	17087057	7.31739e-12	0.00353872510698944

The bolt format genetic map would currently look something like (bolt format, base 1):

chr	position	COMBINED_rate(cM/Mb)	Genetic_Map(cM)
chr22	17083847	4.00811	0.000387462
chr22	17084051	1.91398e-06	0.00107285

This is incorrect. There needs to be an additional breakpoint in the output, corresponding to base-0 position 17084017, with rate 1.91398e-06. Otherwise, the first block incorrectly implies linearly interpolation with the first rate, 4.00811.

refactor file handling for unit tests

input file operations on variant query files have already been refactored into a derived class, whose base class can be mocked. this same modification needs to be performed for:

  • input file operations on variant query files (interpolate-genetic-position/input_variant_file)
  • input file operations on genetic maps (interpolate-genetic-position/input_genetic_map_file)
  • output file operations on (modified) variant query files

initial interpolation test fails at some point

it runs, but by the time you get to the mitochondrial variants of the test file, nonsense gpos numbers are emitted. by design, values on a chromosome absent from the genetic map should be uniformly 0.

unit tests

while the gtest infrastructure is now present (in branch), there need to be unit tests for primary functionality.

vcf support?

I think it would be cool for the program to accept vcf input and emit vcf output. That way, you could potentially add it to a pipe chain with bcftools.

vcf operations would happen via htslib, and the genetic position would presumably be annotated as a new INFO field.

in experimental mode, respect column 4 of input bedfile query

Part of the point of --region-step-interval was not to necessarily increment every query boundary, but only ones where the bed+4 column 4 fit some criterion. It seems like the criterion that's needed now is that the fourth column of two successive query regions are not the same, after trimming the suffix -.*$.

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.