This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Genes near SNP within certain window frame and distance

Hi everyone, I have SNPs and genes in bed format in two files, I can see the genes that map to SNP within certain windoframe lets say 200Kb using the following command:

 windowBed -a SNPs.bed -b Gene.bed -w 200000 > snps.withGenesWithin.bed

This command identifies the set of genes within certain windowframe but doesn't provide a distance, whereas the following command provides the genes distance from SNP but wasn't able to find option to cannot specify the window frame.

closest-features --delim '\t' --dist SNPs.bed Genes.bed > answers.bed

Is there any command which I can use to specify the window frame as well as it estimates the genes distance from SNP.

bedops bedtools

Not sure if I am following the question, or what are you looking after, but maybe you could just combine both commands? Something like:

windowBed -a Gene.bed -b SNPs.bed -w 200000 -u > Genes_nearby_SNPs.bed

And then:

closest-features --delim '\t' --dist SNPs.bed Genes_nearby_SNPs.bed > answers.bed

0 answers

No answers yet.

Log in to answer this question.