Hi, I tried to calculate LD from ensembl-variation database with perl-api. I want a LD from entire chromosome for SNP with at most 200k for others.
The output is something like this
Output.chr1
rsid,rsid,r_square
10045830,10036350,0.8
10045830,10076494,0.4
Here's my current code http://pastebin.com/F0xNJwA6. I partition chromosome into chunk and calculate SNP on each chunk.
The code run ok, but a little bit of problem 1. I got some error on "segmentation fault". My guess from google is storable in perl. 2. It use alot of memory. Around 6-7GB.
Is there any better way to do this ? I'm pretty new to perl and these api.
thanks for a tip about de-reference, I didn't knew that. I will try that.
Ok, I tried that, but dereference a hash seems to be like 100x faster.