Question: Cytogenic Location To Genome Coordinates In R
5
gravatar for Jimineep
8.1 years ago by
Jimineep60
Jimineep60 wrote:

Hey,

I often see cytogenic coordinates written as e.g.

3q26

If I put this into the UCSC genome browser I see this region corresponds to:

chr3:160,700,001-182,700,000

My question: Is there an easy was to jump between the two using R? Or a simple way to calculate one from the other I could implement?

Thanks!

genome R coordinates • 5.3k views
ADD COMMENTlink modified 5.2 years ago by Leandro Lima930 • written 8.1 years ago by Jimineep60

I should add that I have seen this, I wanted to ask if there was an easy way to do it in R without downloading files

http://biostar.stackexchange.com/questions/4363/how-to-obtain-chromosome-locus-from-coordinates

ADD REPLYlink modified 4 months ago by RamRS26k • written 8.1 years ago by Jimineep60
6
gravatar for brentp
8.1 years ago by
brentp23k
Salt Lake City, UT
brentp23k wrote:

You can use your favorite mysql wrapper in R.

From location to cytoband using the commandline:

mysql --user=genome --host=genome-mysql.cse.ucsc.edu -A -D hg19  -e 
"select name from cytoBand where chrom = 'chr3' AND chromStart <= 182700000
and chromEnd >= 160700001"

from cytoband to location:

mysql --user=genome --host=genome-mysql.cse.ucsc.edu -A -D hg19  -e 
"select chrom, min(chromStart), max(chromEnd) from cytoBand where 
name like 'q36%' group by chrom;"
ADD COMMENTlink written 8.1 years ago by brentp23k

Thanks! Although this can't be an uncommon task, if I can get it to work I might stick something on R-forge/CRAN

ADD REPLYlink written 8.0 years ago by Jimineep60

A note about the 'location to cytoband using the commandline' section. If you don't have a point, but an interval, you'll need to check for overlap.

In this case, check http://stackoverflow.com/questions/325933/determine-whether-two-date-ranges-overlap for the most efficient way to do this.

So, something like this (for finding gene names)

SELECT name2 FROM refGene WHERE chrom=$chr AND ( txStart<=$end AND txEND>=$start)";

or this (for finding cytoBands)

SELECT name FROM cytoBand WHERE chrom=$chr AND (chromStart <= $end and chromEnd >= $start)";
ADD REPLYlink modified 4 months ago by RamRS26k • written 7.3 years ago by Dan (findingdan)0

the SQL as written in the answer does check for overlap in location to cytoband

ADD REPLYlink written 5.4 years ago by brentp23k
4
gravatar for Stephwen
7.5 years ago by
Stephwen140
Belgium
Stephwen140 wrote:

You could also directly download the coordinates of the cytoBands:

http://hgdownload.cse.ucsc.edu/goldenPath/hg19/database/cytoBand.txt.gz

ADD COMMENTlink written 7.5 years ago by Stephwen140
0
gravatar for Leandro Lima
5.2 years ago by
Leandro Lima930
San Francisco, CA
Leandro Lima930 wrote:

Hi all.

Based on the hints given here, I created a script to do that.

https://github.com/lelimat/bioinfo/blob/master/region_to_cytoband.sh

The usage is

bash region_to_cytoband.sh chrom:start-end

or

bash region_to_cytoband.sh chrom  start  end

Please feel free to improve.

Regards,
Leandro

ADD COMMENTlink modified 4 months ago by RamRS26k • written 5.2 years ago by Leandro Lima930
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1297 users visited in the last hour