Hi guys, I have got a CNV data from TCGA as shown below and my goal to extract the list of the genes by using GISTIC 
Could anyone plz told me how can i deal with this data by using GISTIC and how to apply GISTIC.


     


                  

 - TCGA-2A-A8VL-10A-01D-A379-01	               1	       51598	             1500664	     226	       0.1646
 - TCGA-2A-A8VL-10A-01D-A379-01	               1	    1617778	             1653196	      12	      -0.4115
 - TCGA-2A-A8VL-10A-01D-A379-01	               1	     1653256	             15362197         7748	       0.0056
 - TCGA-2A-A8VL-10A-01D-A379-01	               1	     15362212	             15362449	        6	       0.7626

https://postimg.cc/image/g4kusd56j/
Credits to Tiago Silva; https://f1000research.com/articles/5-1542

**Update April 5, 2020:**

To be clear, this pipeline has little to do with GISTIC. Here, the segmented copy number data that is obtained from Broad Institute is processed via an R package, *gaia*, which performs the same function as GISTIC, i.e., given a cohort of samples, identifies recurrent copy number events.

**Update October 14, 2018:**

This thread has become a sort of focal point, so, I wanted to make it absolutely clear the process to follow. If your goal is to obtain **somatic copy number alterations (sCNA)** for a group of TCGA patients and/or identify **recurrent sCNA** in these patients, then follow these steps:

 - <a href="https://www.biostars.org/p/311199/#311746">Part I</a> - download segmented sCNA data for any TCGA cohort from Broad Institute's FireBrowse server and identify recurrent sCNA regions in these with *gaia* (R)
 - <a href="https://www.biostars.org/p/341792/#341805">Part II</a> - plot recurrent sCNA gains and losses from GAIA
 - **<a href="https://www.biostars.org/p/311199/#311444">Part III</a> - annotate the recurrent sCNA regions (this post, just below)**
 - <a href="https://www.biostars.org/p/343204/#343217">Part IV</a> -
   generate heatmap of recurrent sCNA regions over your cohort

----------------------
---------------

.

#Part III

#A
Create a reference dataset of all genes and save it as a GenomicRanges object

    library(biomaRt)
    library(GenomicRanges)
    
    #Set up an gene annotation template to use
    mart <- useMart(biomart="ensembl", dataset="hsapiens_gene_ensembl")
    mart <- useMart(biomart="ENSEMBL_MART_ENSEMBL", host="grch37.ensembl.org", path="/biomart/martservice", dataset="hsapiens_gene_ensembl")
    genes <- getBM(attributes=c("hgnc_symbol","chromosome_name","start_position","end_position"), mart=mart)
    genes <- genes[genes[,1]!="" & genes[,2] %in% c(1:22,"X","Y"),]
    xidx <- which(genes[,2]=="X")
    yidx <- which(genes[,2]=="Y")
    genes[xidx, 2] <- 23
    genes[yidx, 2] <- 24
    genes[,2] <- sapply(genes[,2],as.integer)
    genes <- genes[order(genes[,3]),]
    genes <- genes[order(genes[,2]),]
    colnames(genes) <- c("GeneSymbol","Chr","Start","End")
    genes_GR <- makeGRangesFromDataFrame(genes,keep.extra.columns = TRUE)

#B
Store your own data as a GenomicRanges object:

**NB - if following from Part II, the `df` used here is the `RecCNV` object, produced in Part II**

    colnames(df) <- c("chr", "start", "end", "extra1", "extra2")
    df
    chr    start      end extra1  extra2
      1    51598  1500664    226  0.1646
      1  1617778  1653196     12 -0.4115
      1  1653256 15362197   7748  0.0056
    
    df_GR <- makeGRangesFromDataFrame(df, keep.extra.columns = TRUE)
    df_GR
    GRanges object with 4 ranges and 3 metadata columns:
          seqnames               ranges strand |                      
             <Rle>            <IRanges>  <Rle> | 
      [1]        1 [   51598,  1500664]      * | 
      [2]        1 [ 1617778,  1653196]      * | 
      [3]        1 [ 1653256, 15362197]      * | 
             extra1    extra2
          <integer> <numeric>
      [1]       226    0.1646
      [2]        12   -0.4115
      [3]      7748    0.0056
      -------

#C
Overlap your regions with the reference dataset that you created

    hits <- findOverlaps(genes_GR, df_GR, type="within")
    df_ann <- cbind(df[subjectHits(hits),],genes[queryHits(hits),])
    head(df_ann)
    chr   start     end extra1 extra2 GeneSymbol Chr
      1   51598 1500664    226 0.1646     OR4G4P   1
      1   51598 1500664    226 0.1646    OR4G11P   1
      1   51598 1500664    226 0.1646      OR4F5   1
    Start    End
    52473  54936
    62948  63887
    69091  70008

#D
To make filtering easier, we can further manipulate the data to show the precise co-ordinates of each gene and the region co-ordinates in which it was found to have CNA / CNV:

    AberrantRegion <- paste0(df_ann[,1],":", df_ann[,3],"-", df_ann[,4])
    GeneRegion <- paste0(df_ann[,7],":", df_ann[,8],"-", df_ann[,9])
    Final_regions <- cbind(df_ann[,c(6,2,5)], AberrantRegion, GeneRegion)
    Final_regions[seq(1, nrow(Final_regions), 20),]
    extra2 chr extra1     AberrantRegion
    0.1646   1    226    1:51598-1500664
    0.1646   1    226    1:51598-1500664
    0.1646   1    226    1:51598-1500664
    0.1646   1    226    1:51598-1500664

           GeneRegion
       OR4G4P:1-52473
    TUBB8P11:1-808672
    FAM132A:1-1177826
    TMEM240:1-1470554