This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Given An Organism, Chromosome And Nucleotide Start And End...

Probably an easy question (because I think I'm doing it the hard way)...

Given a organism, chromosome number and nucleotide start and end coordinates, how do I find if there a gene name associated with that locus and, if there is, what is it?

What's the best way to do this from the command-line?

Thanks, -Rich

gene retrieval

I think his question is the other way around. He alreday has the position and wants to know what is there.

I think his question is the other way around. He already has the position and wants to know what is there.

@Chris, I agree. But the whole queries are here. Richard will just have to change one or two parameters...

2 answers

A non-command line interface to do this would be the UCSC table browser.

Choose your genome assembly and then the known genes table ( or refseq or other).

Click "define regions" options and load your locations.

Get output as fields or bed.

That will give you a list of genes and info of those in your chosen regions.

Bed tools will give some more flexibility.

You could also export the above output to galaxy www.usegalaxy.org) and use "join" function with your regions again to get an output that will give a more informative output (you'll see which regions have genes associated and which don't)

Thanks. I've been able to determine the gene name through the UCSC web site (the graphic is displayed which displays the gene name when you mouse over). I have to run this against thousands of results; I've considered parsing out HTML but a number of people say that's a bad plan. So, I've looked at the DAS routines but it's not clear to me how to get it to display (even in XML) the gene name. (I used type=RefGene) but there's no name in there.

You can use bedtools for this, if you have the annotation for your organism(s) in one of the supported formats e.g. BED, GFF/GTF.

perl -e 'print "chr1\t1000000\t1200000\n"' | intersectBed -a stdin -b annotation.bed

I'm trying to understand how to create the annotation file. Could you point me to something? I've tried downloading various files from UCSC but it's clear how to turn them into BED files.

Log in to answer this question.