Entering edit mode
3.3 years ago
Rob
▴
170
Hi friends I downloaded RNA seq and its related clinical data from biolink. with this code I get clinical data but when I use write.csv(clinical, clinical) the result file is messy and columns data are mixed. How can I get the clinical file correctly? this is my code:
library(TCGAbiolinks)
library(SummarizedExperiment)
BiocManager::install("BioinformaticsFMRP/TCGAbiolinks")
CancerProject <- "TCGA-KIRC"
query <- GDCquery(project = CancerProject,
data.category = "Transcriptome Profiling",
data.type = "Gene Expression Quantification",
sample.type = c("Primary Tumor"),
workflow.type = "HTSeq - Counts")
#download raw counts for DESEq2
GDCdownload(query)
data <- GDCprepare(query, save = TRUE, save.filename = "expression.rda")
rna <- as.data.frame(SummarizedExperiment::assay(data)) # exp matrix
write.csv(rna, "htseqRNA.csv")
clinical <- data.frame(data@colData) # associated clinical data
write.csv(clinical, "clinical.csv")