Gene id conversion: Difference between revisions

From genomewiki
Jump to navigationJump to search
(changed cse to soe)
 
Line 63: Line 63:
* e.g.
* e.g.


     mysql --no-defaults -h genome-mysql.cse.ucsc.edu -u genome -A hg19 -NB -e 'select geneSymbol, txEnd-txStart AS Size from knownGene, kgXref where kgXref.kgId=knownGene.name'
     mysql --no-defaults -h genome-mysql.soe.ucsc.edu -u genome -A hg19 -NB -e 'select geneSymbol, txEnd-txStart AS Size from knownGene, kgXref where kgXref.kgId=knownGene.name'


== With the UCSC Browser FTP text files ==
== With the UCSC Browser FTP text files ==

Latest revision as of 07:58, 1 September 2018

This page describes various ways how to convert gene IDs from one format to another, e.g. if you have RefSeq identifiers but need gene symbols (e.g. "BRCA2"), or have NCBI Entrez Genes identifiers and need Ensembl identifiers.

With the UCSC Browser

(from the mailing list)

There are three options for extracting the data.

  1. merge/download data from the Table browser
  2. query the public mySQL database
  3. ftp text files

Merge/download data from the Table browser http://genome.ucsc.edu/cgi-bin/hgTables

  1. set the clade, genome, assembly
  2. set the group to Genes and Gene Prediction Tracks,
  3. for the query use UCSC Genes default table is knownGene. Click on "View table schema" to see field contents/order.
  4. set region: genomic for entire dataset or filter by region or identifiers.
    1. You can upload a list of Entrez Gene names (or other identifiers) at this point to limit the output, but it is not necessary, you can filter the file later. For identifiers, either upload your list of gene IDs, or paste them in
    2. This primary table (knownGene) does not contain alternate gene names. To link those in:
      1. set output format: selected fields from primary table and related tables
      2. name output file so that it will download
      3. add in the linked table kgXref and check columns to download, then submit
  5. Starting again at step c, do the same for the Ensembl Genes track. Do the same steps until step g, where you will first need link in the table knownToEnsembl, then the table kgXref.

Table Browser Help/FAQ: http://genome.ucsc.edu/cgi-bin/hgTables#Help http://genome.ucsc.edu/goldenPath/help/hgTablesHelp.html

You can convert gene IDs into gene names using the Table Browser (Tables). Here are the steps:

- Select clade, genome, assembly of interest - Select group: Genes and Gene Prediction Tracks - Select track: UCSC Genes


- Select output format: selected fields from primary and related tables - Click Get Output

On the resulting screen: - Check kgID and geneSymbol - click "get output"

You should get out put that looks like:

  1. kgID geneSymbol

uc001aal.1 OR4F5 uc001aaq.1 DQ599874 uc001aar.1 DQ599768 uc001aax.1 BC036251 uc001aba.1 X64709 uc001abv.1 SAMD11 uc001abw.1 SAMD11 uc001abx.1 SAMD11 uc001aca.1 KLHL17 uc001acb.1 KLHL17 uc001acc.1 KLHL17 uc009vjh.1 OR4F5 uc009vjn.1 LOC643837 uc009vjo.1 LOC643837

With the UCSC Browser public mySQL database

  • Using the Table Browser to help you understand the database and table

names/format, write your own SQL query to extract data.

  • Public mySQL FAQ:

http://genome.ucsc.edu/FAQ/FAQdownloads#download29

  • e.g.
   mysql --no-defaults -h genome-mysql.soe.ucsc.edu -u genome -A hg19 -NB -e 'select geneSymbol, txEnd-txStart AS Size from knownGene, kgXref where kgXref.kgId=knownGene.name'

With the UCSC Browser FTP text files

  • Use ftp to get the complete tables in text file format and perform data merges to link the aligned transcripts in the primary tables to the gene names (such as Entrez)
  • You would need to use your own shell, perl, or other tools to do the merges. Again, first use the Table Browser navigation tools to help you understand the database and table names/format.
  • Download ftp FAQ: http://genome.ucsc.edu/FAQ/FAQdownloads#download1

All annotation tracks are mapped using the same coordinate system to the genomic assembly and so are directly comparable. Be aware that we use a zero-based start coordinate and a 1-based stop coordinate. We also record all alignments with respect to the positive strand, so if an alignment is on the negative strand, the start and stop will be reversed if compared to the file/table headers. These links describe in detail our file format conventions: http://genome.ucsc.edu/FAQ/FAQformat http://genome.ucsc.edu/FAQ/FAQtracks#tracks1 http://genome.ucsc.edu/FAQ/FAQtracks#tracks17

A final option is to send the data to Galaxy (from the Table Browser or uploaded text files). The functions for Interval format data are very useful and could aid in grouping the various mapped transcripts together into genes/clusters. It may be worth comparing which transcripts the Interval functions will group versus which the Entrez gene name will group. Link to Galaxy FAQ: http://g2.trac.bx.psu.edu/wiki/GopsDesc

With Biomart (for Ensembl IDs)

Biomart http://www.biomart.org is probably the best solution if your source ids are from Ensembl:

Click-Path:

    1. martview (top-right of screen)
    2. ensembl56 genes
    3. (select your species)
    4. "filters"
    5. "gene"
    6. paste your ids into "id list limit"
    7. "attributes"
    8. "GENE"
    9. uncheck "ensembl transcript id"
    10. uncheck "ensembl gene id" if you want to get rid of it
    11. "EXTERNAL"
    12. check "HGNC symbol" (or "HGNC automatic gene name" if not human)
    13. "results"

With external tools

List of some external tools and comparison