Hello all,
I have a tab file with 700k SNPs (results from BayPass analysis of p-values for Genotype x environment association). I want to create 10k bp window intervals for each of the chromosome/contig and assign each SNP to its corresponding window.
This is the file I have (sample):
Chromosome SNP bf.db
Chr_1 2007 -22.5
Chr_1 7200 16.05
Chr_1 11500 12.05
Chr_1 18000 61.05
This is what I need:
Chromosome SNP bf.db. window
Chr_1 2007 -22.5 0-10000
Chr_1 7200 16.05 0-10000
Chr_1 11500 12.05 10001-20000
Chr_1 18000 61.05 10001-20000
I can create windows using bedtools makewindows, but I do not know how to assign each SNP to it's corresponding window.
TIA!
Pierre Lindenbaum im not ashamed to admit i came to this thread just so i could see how to do it in a one-liner with
awk