<p>The GDC API user guide (<a href="https://docs.gdc.cancer.gov/API/PDF/API_UG.pdf" rel="nofollow noreferrer">https://docs.gdc.cancer.gov/API/PDF/API_UG.pdf</a>) provides some guidance on the structure of GDC data. So for getting RNA-Seq data from GDC, you would provide this filter to get the 551 text files with workflow_type set as "HTSeq - FPKM-UQ" and "TCGA-LUSC" for the project. There are other workflow types as well:</p>

<pre><code>cases.project.program.name in ["TCGA"]
and cases.project.project_id in ["TCGA-LUSC"]
and files.access in ["open"]
and files.analysis.workflow_type in ["HTSeq - FPKM-UQ"]
and files.data_format in ["txt"]
and files.data_type in ["Gene Expression Quantification"]
and files.experimental_strategy in ["RNA-Seq"]
</code></pre>

<p>(You don’t need all those filters to get the 551 files; I included them to show what is available.) The txt files are returned as gzipped tar files that hold text files with rows of the form:</p>

<p>ENSG00000158486.12  5341.21601153</p>

<p>The above filters provide all the FPKM-UQ files for TCGA-LUSC. If you wanted to just get the data for normal samples as controls, that would require filtering on sample type as well, adding in the additional filter:</p>

<pre><code>and cases.samples.sample_type in [“solid tissue normal”]
</code></pre>

<p>That will return 49 files. If you instead wished to get only the tumor files, the additional filter would instead be:</p>

<pre><code>and cases.samples.sample_type in [“primary tumor”] 
</code></pre>

<p>and that returns 502 files. Note that there are several different sample types for tumor and normal tissues; those just happen to be the ones used here.
(Note that if you are using the GDC Repository portal, adding that additional filter requires you to select “Add a Case/Biospecimen Filter” on the “Cases” filter tab.)</p>

<p>Since GDC is part of the NCI Cancer Research Data Commons (CRDC), instead of downloading the data, you can actually work with it in the cloud using the various CRDC Cloud Resources such as the ISB-CGC: <a href="https://www.isb-cgc.org/" rel="nofollow noreferrer">https://www.isb-cgc.org/</a>. In fact, all the RNA-Seq data for TCGA is in an ISB-CGC Google BigQuery table: (<a href="https://console.cloud.google.com/bigquery?p=isb-cgc&amp;d=TCGA_hg38_data_v0&amp;t=RNAseq_Gene_Expression&amp;page=table" rel="nofollow noreferrer">https://console.cloud.google.com/bigquery?p=isb-cgc&amp;d=TCGA_hg38_data_v0&amp;t=RNAseq_Gene_Expression&amp;page=table</a>)
And the above count data can be pulled using the query:</p>

<pre><code>SELECT HTSeq__FPKM_UQ
FROM `isb-cgc.TCGA_hg38_data_v0.RNAseq_Gene_Expression`
WHERE Ensembl_gene_id_v = "ENSG00000158486.12" AND project_short_name = "TCGA-LUSC"
</code></pre>

<p>If you want to discriminate between normal and tumor expression levels, the ISB-CGC BQ tables make it pretty easy to tag the expression values with the type of tissue involved. The sample type can be assigned by joining the previous query with the biospecimen table:</p>

<pre><code>WITH bio as (
SELECT sample_barcode, sample_type_name
FROM `isb-cgc.TCGA_bioclin_v0.Biospecimen`
),
expr as (SELECT sample_barcode, HTSeq__FPKM_UQ
FROM `isb-cgc.TCGA_hg38_data_v0.RNAseq_Gene_Expression`
WHERE Ensembl_gene_id_v = "ENSG00000158486.12" AND project_short_name = "TCGA-LUSC")
SELECT bio.sample_type_name, expr.HTSeq__FPKM_UQ
FROM expr
JOIN bio
ON bio.sample_barcode = expr.sample_barcode
</code></pre>

<p>The GDC has listed some of the available sample types on this page: <a href="https://gdc.cancer.gov/resources-tcga-users/tcga-code-tables/sample-type-codes" rel="nofollow noreferrer">https://gdc.cancer.gov/resources-tcga-users/tcga-code-tables/sample-type-codes</a>
Also, BigQuery has a user interface that makes exploring data sets and writing queries easy, but you need to log in with a Google ID, so the ISB-CGC has a BigQuery Table Search (<a href="https://isb-cgc.appspot.com/bq_meta_search/" rel="nofollow noreferrer">https://isb-cgc.appspot.com/bq_meta_search/</a>) that allows you to explore the available tables without logging in. If you want to run queries, Google offers a free tier that you can use to try things out and run small jobs (<a href="https://cloud.google.com/free/" rel="nofollow noreferrer">https://cloud.google.com/free/</a>) and ISB-CGC offers free credits too. ISB-CGC also has examples of working in R with BigQuery within the Community Notebook Repository (<a href="https://isb-cancer-genomics-cloud.readthedocs.io/en/latest/sections/HowTos.html" rel="nofollow noreferrer">https://isb-cancer-genomics-cloud.readthedocs.io/en/latest/sections/HowTos.html</a>). A few useful notebooks would be 'How do I create cohorts of patients?', 'How do I plot a heatmap using data in BigQuery?', and 'How do I get started fast?'.</p>

CC BY-SA 4.0
2020-02-20T22:05:58.283Z
thank you very much for your great feedback, Lauren. It seems an excellent option to work in the cloud. The only problem is that I only know how to program in R.
FPS
CC BY-SA 4.0
2020-02-20T22:19:04.370Z
and a little in Bash..
FPS
CC BY-SA 4.0
2020-02-21T23:18:27.940Z
Yeah, writing SQL can take some getting used to, but you can do quite a bit of stuff with simple queries. I added some more information to the answer for working in R with BigQuery.
Lauren H.
CC BY-SA 4.0
2020-02-22T07:03:13.400Z
many thanks, Lauren. great answers!
FPS
CC BY-SA 4.0
2020-02-27T06:46:31.163Z
Lauren, I' m having difficulties to find the healthy controls. As far as I know, the TCGA contains tumor samples and healthy tissue samples (tissue adjacent to the tumor that serves as a normal control). I need the normal controls to know if my gene is up regulated or down regulated. Where these controls are located?
FPS
CC BY-SA 4.0
2020-02-29T01:21:45.207Z
The tissue type labels are in the biospecimen table. I updated the answer to include a query for joining the biospecimen table with the RNA sequencing table. Also, I changed the original project ID from TCGA-OV to TCGA-LUSC in the answer, since it turns out that TCGA-OV has no RNA-Seq data for normal samples.
Lauren H.
CC BY-SA 4.0
2020-02-20T21:26:17.393Z
2020-02-29T01:21:18.073Z
2020-02-29T01:21:18.073Z
Lauren H.
<p>I find UCSC Xena to be well-organized and easy to use: <a href="https://xenabrowser.net/datapages/" rel="nofollow noreferrer">https://xenabrowser.net/datapages/</a></p>

<p>Plain text files that are clearly labeled for all TCGA data (that is not protected).</p>

CC BY-SA 4.0
2020-02-22T21:07:52.063Z
2020-02-22T21:14:26.100Z
2020-02-22T21:14:26.100Z
burger
<p>I want to compare RNA-Seq datasets obtained from the TCGA to investigate how my gene of interest is implicated in different types of cancer.</p>

<p>I'm trying to download the data from the GDC Data Portal (<a href="https://portal.gdc.cancer.gov" rel="nofollow noreferrer">https://portal.gdc.cancer.gov</a>), but it is not user-friendly.</p>

<p>Can somebody give me some initial directions? I found a bioconductor package that facilitates access to the TCGA (<a href="https://bioconductor.org/packages/release/bioc/html/TCGAbiolinks.html" rel="nofollow noreferrer">https://bioconductor.org/packages/release/bioc/html/TCGAbiolinks.html</a>), but first of all, I would like to understand how the files are organized, the nomenclature and how to inspect them.</p>

<p>thank you very much, Fabiano</p>

CC BY-SA 4.0
2020-02-19T11:44:18.163Z
When it comes to user-friendliness, I found the FireBrowse portal (http://firebrowse.org/) much easier to navigate than the GDC one.
vuzun
CC BY-SA 4.0
2020-02-20T05:14:54.670Z
thank you very much, vuzun. In my opinion, firebrowse is interesting to have some preliminary results, but for a deeper analysis and a high-quality publication TCGAbiolinks is still the best option.
FPS
<rna-seq>
How to initiate RNA-Seq analysis of TCGA files?
# How to initiate RNA-Seq analysis of TCGA files?

(Asked by: username_0 on 2020-02-17)

I want to compare RNA-Seq datasets obtained from the TCGA to investigate how my gene of interest is implicated in different types of cancer.

I'm trying to download the data from the GDC Data Portal (<https://portal.gdc.cancer.gov>), but it is not user-friendly.

Can somebody give me some initial directions? I found a bioconductor package that facilitates access to the TCGA (<https://bioconductor.org/packages/release/bioc/html/TCGAbiolinks.html>), but first of all, I would like to understand how the files are organized, the nomenclature and how to inspect them.

thank you very much, Fabiano

**Tags:** rna-seq
> **Comments:**
> **username_1**: When it comes to user-friendliness, I found the FireBrowse portal (http://firebrowse.org/) much easier to navigate than the GDC one.  
> **username_0**: thank you very much, vuzun. In my opinion, firebrowse is interesting to have some preliminary results, but for a deeper analysis and a high-quality publication TCGAbiolinks is still the best option.  

---

## 2 answers

### Answer by username_2 on 2020-02-20. Score: 3 | Accepted answer

The GDC API user guide (https://docs.gdc.cancer.gov/API/PDF/API_UG.pdf) provides some guidance on the structure of GDC data. So for getting RNA-Seq data from GDC, you would provide this filter to get the 551 text files with workflow_type set as "HTSeq - FPKM-UQ" and "TCGA-LUSC" for the project. There are other workflow types as well:
cases.project.program.name in ["TCGA"]
and cases.project.project_id in ["TCGA-LUSC"]
and files.access in ["open"]
and files.analysis.workflow_type in ["HTSeq - FPKM-UQ"]
and files.data_format in ["txt"]
and files.data_type in ["Gene Expression Quantification"]
and files.experimental_strategy in ["RNA-Seq"]

(You don’t need all those filters to get the 551 files; I included them to show what is available.) The txt files are returned as gzipped tar files that hold text files with rows of the form:
ENSG00000158486.12  5341.21601153
The above filters provide all the FPKM-UQ files for TCGA-LUSC. If you wanted to just get the data for normal samples as controls, that would require filtering on sample type as well, adding in the additional filter:
and cases.samples.sample_type in [“solid tissue normal”]

That will return 49 files. If you instead wished to get only the tumor files, the additional filter would instead be:
and cases.samples.sample_type in [“primary tumor”] 

and that returns 502 files. Note that there are several different sample types for tumor and normal tissues; those just happen to be the ones used here.
(Note that if you are using the GDC Repository portal, adding that additional filter requires you to select “Add a Case/Biospecimen Filter” on the “Cases” filter tab.)
Since GDC is part of the NCI Cancer Research Data Commons (CRDC), instead of downloading the data, you can actually work with it in the cloud using the various CRDC Cloud Resources such as the ISB-CGC: https://www.isb-cgc.org/. In fact, all the RNA-Seq data for TCGA is in an ISB-CGC Google BigQuery table: (https://console.cloud.google.com/bigquery?p=isb-cgc&d=TCGA_hg38_data_v0&t=RNAseq_Gene_Expression&page=table)
And the above count data can be pulled using the query:
SELECT HTSeq__FPKM_UQ
FROM `isb-cgc.TCGA_hg38_data_v0.RNAseq_Gene_Expression`
WHERE Ensembl_gene_id_v = "ENSG00000158486.12" AND project_short_name = "TCGA-LUSC"

If you want to discriminate between normal and tumor expression levels, the ISB-CGC BQ tables make it pretty easy to tag the expression values with the type of tissue involved. The sample type can be assigned by joining the previous query with the biospecimen table:
WITH bio as (
SELECT sample_barcode, sample_type_name
FROM `isb-cgc.TCGA_bioclin_v0.Biospecimen`
),
expr as (SELECT sample_barcode, HTSeq__FPKM_UQ
FROM `isb-cgc.TCGA_hg38_data_v0.RNAseq_Gene_Expression`
WHERE Ensembl_gene_id_v = "ENSG00000158486.12" AND project_short_name = "TCGA-LUSC")
SELECT bio.sample_type_name, expr.HTSeq__FPKM_UQ
FROM expr
JOIN bio
ON bio.sample_barcode = expr.sample_barcode

The GDC has listed some of the available sample types on this page: https://gdc.cancer.gov/resources-tcga-users/tcga-code-tables/sample-type-codes
Also, BigQuery has a user interface that makes exploring data sets and writing queries easy, but you need to log in with a Google ID, so the ISB-CGC has a BigQuery Table Search (https://isb-cgc.appspot.com/bq_meta_search/) that allows you to explore the available tables without logging in. If you want to run queries, Google offers a free tier that you can use to try things out and run small jobs (https://cloud.google.com/free/) and ISB-CGC offers free credits too. ISB-CGC also has examples of working in R with BigQuery within the Community Notebook Repository (https://isb-cancer-genomics-cloud.readthedocs.io/en/latest/sections/HowTos.html). A few useful notebooks would be 'How do I create cohorts of patients?', 'How do I plot a heatmap using data in BigQuery?', and 'How do I get started fast?'.

> **Comments:**
> **username_0**: thank you very much for your great feedback, Lauren. It seems an excellent option to work in the cloud. The only problem is that I only know how to program in R.  
> **username_0**: and a little in Bash..  
> **username_2**: Yeah, writing SQL can take some getting used to, but you can do quite a bit of stuff with simple queries. I added some more information to the answer for working in R with BigQuery.  
> **username_0**: many thanks, Lauren. great answers!  
> **username_0**: Lauren, I' m having difficulties to find the healthy controls. As far as I know, the TCGA contains tumor samples and healthy tissue samples (tissue adjacent to the tumor that serves as a normal control). I need the normal controls to know if my gene is up regulated or down regulated. Where these controls are located?  
> **username_2**: The tissue type labels are in the biospecimen table. I updated the answer to include a query for joining the biospecimen table with the RNA sequencing table. Also, I changed the original project ID from TCGA-OV to TCGA-LUSC in the answer, since it turns out that TCGA-OV has no RNA-Seq data for normal samples.  

---

### Answer by username_3 on 2020-02-22. Score: 0

I find UCSC Xena to be well-organized and easy to use: <https://xenabrowser.net/datapages/>

Plain text files that are clearly labeled for all TCGA data (that is not protected).


---

