
Generate random dna positions for SNPs on the whole genome (except X/Y chromsomes, MT and unplaced scaffolds) taking into account trinucleotide context of mutations from VCF file.
Tested on mac, Windows and Linux systems. The runtime is 15 minutes for the demo files.
License: GNU General Public License as published by the Free Software Foundation
 INPUT:
  0 Folder with the reference genome in form of chr1..22 files. Each file contains a single line which represents a single chromosome sequence without additional symbols (not FASTA format)
  1 Bed file with the intervals of mappable genome regions (high alignability regions)
  2 A VCF file
 OUTPUT:
 stdout: nothing
 stderr: info

Steps with the demo files:

#1 Compile the files
javac fasta2string.java
javac genRD4Genome.java

#2 Download the reference genome
wget http://ftp.1000genomes.ebi.ac.uk/vol1/ftp/technical/reference/human_g1k_v37.fasta.gz
gzip -d human_g1k_v37.fasta.gz

#3 Rename the chromosomes to ">chr1..22"
sed 's/>/>chr/g' human_g1k_v37.fasta | sed 's/ .*//g' > human_g1k_v37.renamed.fasta

#4 Cut the reference genome to separate files for each chromosome
java fasta2string human_g1k_v37.renamed.fasta

#5 Put the files for autosomes (chr1..22) to the REFGENOMEDIR folder
mkdir REFGENOMEDIR
mv *chr[1-9]* REFGENOMEDIR/
rm chr*
#6 Calculate
java -Xmx8g genRD4Genome REFGENOMEDIR mapability_demo.bed vcf_file.vcf 1> genRD4Genome.out 2> genRD4Genome.err

genRD4Genome.dist  - file with the number of mutations for each inter-mutation distance (columns 0..200) for each iteration (rows)




