gravatar for Hamid Ghaedi

1 hour ago by

Queens university

Always it is recommended to show what you have tried, your code and ....
Just to write something helpful, here are codes for downloading a cancer expression matrix and associated clinical data using TCGAbiolinks package.


query <- GDCquery(project = "TCGA-BLCA", # the TCGA name for your cancer 
                           data.category = "Gene expression",
                           data.type = "Gene expression quantification",
                           platform = "Illumina HiSeq", 
                           file.type  = "normalized_results",
                           experimental.strategy = "RNA-Seq",
                           legacy = TRUE)
GDCdownload(query, method = "api")
dat <- GDCprepare(query = query, save = TRUE, save.filename = "exp.rda")
rna <- # exp matrix
clinical <- data.frame([email protected]) # associated clinical data

You can get access to the S4 object using the package SummarizedExperiment, different functions. Here I used the assay function from this package to make a data frame out of the expression matrix.

Source link