This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How extract specific SNP position from the bed file-Bedtools

I have one bed file with start and end coordinate (range in bed format). I need to extract a specific position from this range bed (for example I need to extract "chr12 25392999" position from the below bed file). How can I do that? could you anyone please help? Appreciate your help! Thanks in advance!

my example bed file looks like this ------>

chr12   25392977    25393116    KRAS_Intron2_Amp7
bedtools

1 answer

awk -F '\t' '($1=="chr12" && int($2)<= 25392999 && 25392999 <= int($3))'

adjust < , and <= according to : Cheat Sheet For One-Based Vs Zero-Based Coordinate Systems

or

index your bed with tabix and

tabix your.bed.gz "chr12:25392999-25392999"

or

convert your query to bed and

bedtools intersect -wa -u -a database.bed -b query.bed

@Pierre Lindenbaum Thanks a lot! Its a great help! I will check and let you know.

Hi pierre.peterlongo, Thanks a lot for your help. It is really helpful. Really sorry, I was in vacation, after that, completely forgot to check your answer.

Please accept the answer so the question is marked solved on the website. To do that, click on the green check mark on the left side of the answer.

And I'm still not Pierre Peterlongo (hi )

Log in to answer this question.