Yes, good point. Z-scores are also the only option when you go to download the data. It would be nice if the user could choose to download the raw expression values instead of z-scores.
Jordan
Hi, I've been working with TCGA data for a couple years now and I am the creator of OncoLnc. In this guide I'll help you navigate this complicated resource.
It's possible that an online tool will be sufficient for what you are looking for.
Some useful features of cBioPortal:
Some limitations of cBioPortal:
This tool allows for:
Single click statistical correlations between features such as:
MEXPRESS can be a little bit of a data overload at first, but once you see that the data gets sorted by whatever clinical feature you click on it is very fun to use. Unfortunately MEXPRESS does not allow for survival analysis.
Some facts about OncoLnc:
In addition to these tools for interactive analysis of Tier 3 TCGA data, some recent efforts have been made to reanalyze the TCGA data with a focus on lncRNAs.
Used an in-house assembly method to identify transcripts, and have made some of their data available for browsing and download.
Contains read counts for ensembl defined lncRNAs, but also allows users to define their own lncRNA by inputting genomic coordinates. TANRIC also includes various analyses including survival analyses and allows for download of their data.
Okay, so you've looked through the data portals above but they just aren't cutting it, you need to get your hands on some juicy data.
The next question you need to ask yourself is will Tier 3 data suffice (available to anyone), or do you need Tier 1 data (requires permission and some serious computing resources and technical know-how).
Tier 1 data includes BAM or unaligned files for:
Tier 3 data includes clinical data and processed files for:
The benefits of this approach are that you know the data will be as up-to-date as possible, and you don't have to worry about a third party introducing any errors.
Downsides to this approach are that you are put in a queue to download the data, and when downloading expression data you have to download ALL the files, which results in you downloading much more than you probably wanted or your computer can handle. If you want to download say all RNA-SEQ rsem.normalized files, you will also have to download the unnormalized files as well. And if you want to do this for every cancer you can easily spend a whole day just queuing and downloading.
Firehose contains minimally processed files, basically they take the files from https://tcga-data.nci.nih.gov/tcga/ and merge them into one file with a R friendly data structure. For example, all 1000 BRCA rsem.normalized files would be merged into one file.
There is no queue for downloading, and because you are not downloading data you don't want the download is much faster. Firehose is typically where I go for MAF files: interesting note, there doesn't seem to be a pan-cancer MAF file anywhere and a lot of people want one, someone with free time should get on this.
There are a lot of different clinical files, but the ones you are likely interested in are the ones that contain survival data. Yes, you read that correctly, ones as in plural.
There are two types of files that contain survival information, the "clinical_follow_up" files, and the "clinical_patient" file. And yes, I used the plural again.
The "clinical_follow_up" file with the largest version number typically contains the most survival data and the most recent data. If you are looking for information such as grade or smoking status, you want the "clinical_patient" file, but this file also contains survival data, which may or may not be the same as the data in the "clinical_follow_up" file or files.
For example, BRCA contains these four files with nonredundant clinical data:
To make matters worse, within a "clinical_follow_up" file a patient can be listed multiple times. Luckily the files appear to be sorted by patient identifier, and the most recent data for each patient is the last one listed.
Given this complexity, I do not know if Firehose is merging these files perfectly. I'm not saying the data in Firehose is incorrect, it just maybe isn't as perfect as it could be (I have not gone through to check the accuracy of their parsing).
But I am pretty sure I'm extracting all the data possible with my code available at https://github.com/OmnesRes/onco_lnc
Firehose and cBioPortal both offer APIs for downloading data. This may be the best method to get the expression level of your gene for every patient in every cancer study or get all observed mutations across cancers.
OncoLnc allows you to download expression data coupled to survival data one cancer, one gene at a time. Note: patients can have multiple expression files, and these are averaged in OncoLnc.
Here is an example of a patient barcode: TCGA-C5-A2LY-01A-31R-A18M-07
If you want to know what every part of the barcode is you can check out https://wiki.nci.nih.gov/display/TCGA/TCGA+barcode
But you most likely will only be interested in the start of the barcode: TCGA-C5-A2LY-01A
The TCGA-C5-A2LY will identify the patient and this is what will be in the clinical file. The "01" tells you what type of sample you are dealing with. You can find a list of codes here: https://tcga-data.nci.nih.gov/datareports/codeTablesReport.htm?codeTable=Sample%20type
You will likely be focused on samples that have "01" or "11". It is important to note that LAML samples will be designated "03" since that is a blood-derived cancer, and SKCM has a lot of metastatic samples so you be dealing with a lot of "06" in that case.
Ah yes, that is quite annoying, but nothing a Python dictionary won't solve ;)
When you download data from https://tcga-data.nci.nih.gov/tcga/ you also get a FILE_SAMPLE_MAP file which maps the patient barcodes to the files you downloaded. So a single patient in your clinical file might have an expression file for their normal tissue sample, one or more tumor samples, and maybe even a recurrent tumor or metastatic tumor.
This is one of the main problems with Tier 3 data. The same pipeline with the same gene annotations is used in every cancer study, including newer cancer studies. And the first cancer study was like a long time ago, making these gene annotations really old.
As a result, if you are studying a lncRNA it probably won't be in TCGA Tier 3 data, and you need to check out MiTranscriptome or TANRIC.
Okay, no problem, if you are associated with a university you can ask your advisor to apply for access.
Instructions are at https://cghub.ucsc.edu/access/get_access.html
Once you have the key file that you need, download GeneTorrent. This program has multiple dependencies, but I've seen it easily installed on a Mac and an Ubuntu server.
Once you've got that installed (preferably on a server with a good internet connection and a ton of memory and compute power), head over to https://browser.cghub.ucsc.edu.
Select the samples you want and add them to your cart (that's right, we're going shopping, and everything is free!). You will want to download the manifest file and the tsv file.
With your manifest file run this command on your server: gtdownload -v --max-children 1 -d manifest.xml -c cghub.key
#If you have a bunch of cores you can increase max-children
Download speed is fast, but for each file it takes some time to connect. So even if you are downloading a bunch of small files it might have to run overnight (make sure at the checkout you see how much data you are downloading so you don't fill your disk!).
With your TSV file you can map the analysis ids of the files you just downloaded to the patient barcodes.
Yeah...working with Tier 1 data is a huge pain. Luckily people have realized this and there are some pilot programs for analyzing TCGA data in the cloud that don't require downloading the raw files (but you will still need to save your processed files, which could be just as large or larger than the raw data). I haven't used any of these services yet so I can't recommend one or provide advice.
And that should get you started analyzing TCGA data. Anything important I missed?
Hi Jordan,
thanks for the overview. A small correction regarding "Expression is listed as z-scores instead of the raw values". This limitation is only related to the oncoprint view afaik. In other tabs of the query results page like "Plots" tab you should be able to plot log values of your expression data vs other molecular data or clinical attributes.
Best regards,
Pieter
Yes, good point. Z-scores are also the only option when you go to download the data. It would be nice if the user could choose to download the raw expression values instead of z-scores.
Jordan
It has come to my attention that Tier 3 TCGA data has been moved from https://tcga-data.nci.nih.gov/tcga/ to https://gdc.nci.nih.gov/.
great summary for those who are unfamiliar with how to fetch the data
Log in to answer this question.
Neat review of the 'TCGA toolbox'..
I think you might have missed out Cancer browser from Santa Cruz. Look like one can quite easily download the data from there
I can`t find sample type code list here, what should i do? https://tcga-data.nci.nih.gov/datareports/codeTablesReport.htm?codeTable=Sample%20type
Yeah, that link doesn't work anymore with the data portal no longer operational. I happened to copy that table to my blog a while back: http://www.omnesres.com/tools/tcga/
Hi
I'm new in this area. I honestly find TCGA complicated. Thanks so much for OncoLnc as it is a lot easier to use. However, I need to do some studies including a mutated EGFR (EGFRvIII) and this data is not available in OncoLnc. I basically need to do the survival analysis including the mutated receptor in GBM, but I have not idea of how to do it by getting the data from TCGA. Can someone please explain to me how to do it? thanks in advance.