Create 10,000bp windows for a SNP file and assign each SNP to its respective window

Create 10,000bp windows for a SNP file and assign each SNP to its respective window

2

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!


genome


snp


vcf

• 38 views

Read more here: Source link