How extract specific SNP position from the bed file-Bedtools
1
0
Entering edit mode
11 months ago
LionisOne • 0

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 • 981 views
ADD COMMENT
0
Entering edit mode
11 months ago
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
ADD COMMENT
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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.

ADD REPLY
0
Entering edit mode

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 )

ADD REPLY

Login before adding your answer.

Traffic: 2618 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6