Map genomic coordinate to specific chromosome region
1
0
Entering edit mode
2.2 years ago
Xiaofan ▴ 10

Hi there,

I wonder is there any R package can map a genomic coordinate to specific chromosome region?

For example, I have a genomic coordinate of chr4:19077912-75295480, is there any tool (R package would be perfect) that I can use to map this coordinate to 4p22.3 (I wrote it blindly) something like that.

Many thanks in advance.

coordinate R chromosome genomic region package • 1.5k views
ADD COMMENT
0
Entering edit mode

Thank you this is exactly what I want. However do you know is there any R package can do such convertion because it will be easy for me to concatenate other codes!

ADD REPLY
0
Entering edit mode
ADD REPLY
6
Entering edit mode
2.2 years ago

You can do this via the command line very easily, using the cytoband file published by UCSC on their Goldenpath service:

$ wget -qO- ftp://hgdownload.soe.ucsc.edu//apache/htdocs/goldenPath/hg38/database/cytoBand.txt.gz \
    | gunzip -c \
    | sort-bed - \
    | bedmap --echo --echo-map-id --delim '\t' <( sort-bed myCoordinates.bed ) - \
    > answer.bed

If you just want to do an ad-hoc search, replace myCoordinates.bed with a process substitution containing your region:

$ wget -qO- ftp://hgdownload.soe.ucsc.edu//apache/htdocs/goldenPath/hg38/database/cytoBand.txt.gz \
    | gunzip -c \
    | sort-bed - \
    | bedmap --echo --echo-map-id --delim '\t' <( echo -e 'chr4\t19077912\t75295480' ) - \
    > answer.bed

In the latter case, there are multiple bands overlapping that region:

$ more answer.bed 
chr4    19077912        75295480     p15.31;p15.2;p15.1;p14;p13;p12;p11;q11;q12;q13.1;q13.2;q13.3

The above cytoband file is for hg38. If you're working with a different genome assembly, you just have to dig around the similar path structure for that assembly on Goldenpath. UCSC hosts cytoband files for many organisms and assemblies, so this is a good way to find things.

ADD COMMENT

Login before adding your answer.

Traffic: 2567 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