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.
require(TCGAbiolinks)
require(SummarizedExperiment)
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 <- as.data.frame(SummarizedExperiment::assay(dat)) # exp matrix
clinical <- data.frame(dat@colData) # 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.
Please show all commands that you have used, and indicate the R version and operating system that you are using. Show samples of your data where possible and feasible. Thank you.
I am working with windows 10-64 bit. R version 4. 0.2 I want only primary tumor data as a table. my code: