## 4 Use Case Examples
### Use Case 1: for Kidney Cancers, Find Mutations and Their Number in Each Exon
Use Case 3: in a Comparative Study, For Both Normal and Tumoral Tissue Samples of Each Patient Affected by Cholangiocarcinoma Extract the Expression and Average Promotorial Methylation Levels of Each Gene  
In the OpenGDC standardized data of TCGA, using with value \"normal\" our _manually_curated_tissue_status metadata attribute, added with respect to the original GDC data, we can select normal samples of five different types at once (i.e., Blood Derived Normal, Solid Tissue Normal, Buccal Cell Normal, EBV immortalized Normal, Bone Marrow Normal--corresponding to sample type codes 10-14 [[https://gdc.cancer.gov/resources-tcga-users/tcga-code-tables/sample-type-codes](https://gdc.cancer.gov/resources-tcga-users/tcga-code-tables/sample-type-codes)]([https://gdc.cancer.gov/resources-tcga-users/tcga-code-tables/sample-type-codes](https://gdc.cancer.gov/resources-tcga-users/tcga-code-tables/sample-type-codes))). Similarly, the value \"tumoral\" of the same attribute refers to ten different types of cancer samples (corresponding to sample type codes 01-09 and 40). Since methylation sites of interest for gene expression regulation are typically located in the surroundings of a gene TSS, we consider methylation values only in the promotorial region of each gene, extracted around the gene TSS from 2000 bases upstream to 1000 bases downstream (lines 5 and 19 in Listing 3); for gene expression data we only keep the _fpkm_ values and the _gene_symbol_ (line 5 in Listing 3), while for methylation data only the _beta_values_ (line 10 in Listing 3). Note that the code described in Listing 3 lines 1-13 for normal samples is repeated in lines 15-27 for tumoral samples. For methylation data, we compute the average _beta_value_ in each gene promoter. With the MAP at line 13 we associate each gene expression and promotorial region (in each sample of the normal N_EXPR dataset) with the average of the methylation _beta_values_ in the gene promotorial region (in a sample of the normal N_METH dataset); N_EXPR and N_METH samples are matched only if belonging to the same tissue sample (uniquely identified by the _gdc_samples_sample_id_). At Listing 3 line 30 the datasets resulting from line 13 and line 27 are combined using a JOIN operation, which allows associating each gene promotorial region with the _gene_symbol_ and the gene expression _fpkm_ value and methylation _avg_beta_value_ from both the normal and tumoral samples of a patient. Note that the equi predicate on_attributes can only be applied thanks to the addition of the _gene_symbol_ attribute in the OpenGDC gene expression data (as original GDC data did not include it). Lines 33-38 in Listing 3 are only needed for shaping results into a convenient format, as it can be appreciated in Table 4, which contains an excerpt from the result dataset (in the column names of Table 4 we use the subscripts \(n\) and \(t\) for _normal_ and _tumoral_, respectively). \begin{table}
\begin{tabular}{l r r r r r r r r} \hline \hline
**Chr** & **Left** & **Right** & **Strand** & **Gene\_symbol** & **Fpkm\({}_{a}\)** & **avg\_beta\_value\({}_{n}\)** & **fpkm\({}_{a}\)** & **avg\_beta\_value\({}_{n}\)** \\ \hline chr1 & 166971581 & 166976581 & + & MAEL & 0.27401479 & 0.07428182 & 0.19981536 & 0.06583118 \\ chr1 & 166974482 & 166979482 & - & ILDR2 & 0.13031929 & 0.11815327 & 0.06208503 & 0.13756338 \\ chr3 & 38949561 & 38954561 & - & SCN11A & 0.04643162 & 0.88310268 & 0.01814642 & 0.73347131 \\ chr6 & 152746797 & 152751797 & + & VIP & 0.50472323 & 0.13604175 & 0.11766157 & 0.35010738 \\ chr11 & 114558895 & 114563895 & - & NXPE1 & 0 & 0.80843122 & 0.01618970 & 0.82677058 \\ chr4 & 8955627 & 8960627 & + & UNC9388 & 0 & null & 0 & null \\ chr12 & 126615554 & 126620554 & - & RP11-407A16.8 & 0 & 0.96168949 & 0 & 0.97617533 \\ chr1 & 154205333 & 154210333 & - & Clorf189 & 0.16309294 & 0.89600850 & 0 & 0.90502790 \\ chr10 & 88786061 & 88791061 & - & RCBTB2P1 & 0 & null & 0 & null \\... &... &... &... &... &... &... &... \\ \hline \hline \end{tabular}
\end{table}