Gdcprepare() error.
I’m really struggling with this and I need urgent help.
I keep running the following code but after the gdcprepare function, it either crashes my computer or freezes the console. I have no idea what to do, someone please help.
library("TCGAbiolinks", quietly = T)
library("limma", quietly = T)
library("edgeR", quietly = T)
library("glmnet", quietly = T)
library("factoextra", quietly = T)
library("FactoMineR", quietly = T)
library("caret", quietly = T)
library("SummarizedExperiment", quietly = T)
library("gplots", quietly = T)
library("survival", quietly = T)
library("survminer", quietly = T)
library("RColorBrewer", quietly = T)
library("gProfileR", quietly = T)
library("genefilter", quietly = T)
## Acess GDC and get info on projects
GDCprojects = getGDCprojects()
View(GDCprojects[c("project_id", "name")])
# get details of the Kidney cancer project
TCGAbiolinks:::getProjectSummary("TCGA-KIRC")
## Query GDC for RNAseq data from KIRC dataset for primary tumor and normal tissue
query_TCGA_KIRC = GDCquery(
project = "TCGA-KIRC",
data.category = "Transcriptome Profiling",
access = "open",
experimental.strategy = "RNA-Seq",
workflow.type = "HTSeq - Counts",
sample.type =c("Primary Tumor", "Solid Tissue Normal"))
# make results as table
all_res = getResults(query_TCGA_KIRC)
colnames(all_res)
# how many samples in each sample type
table(factor(all_res$sample_type))
## Download the files specified in the query.
GDCdownload(query = query_TCGA_KIRC) # rerun if download fails
### Prepare the downloaded data and other associated data into an object
## load the actual RNASeq data into R
## both clinical and expression data will be present in this object
tcga_data = GDCprepare(query_TCGA_KIRC)
View(tcga_data)
# Clinical data can be accessed using the colData() function
colnames(colData(tcga_data))
table(tcga_data@colData$primary_diagnosis)
table(tcga_data@colData$vital_status)
table(tcga_data@colData$definition)
# RNAseq data can be accessed using the assay() function
dim(assay(tcga_data)) # gene expression matrices.
head(assay(tcga_data)[,1:6]) # expression of first 6 genes and first 6 samples
head(rowData(tcga_data)) # ensembl id and gene id of the first 6 genes.
# Save the data as a file
saveRDS(object = tcga_data,
file = "tcga_data.RDS",
compress = FALSE)
• 1,677 views
•
link
0 answers
No answers yet.
Log in to answer this question.
Are you running this on RStudio? Does the GDCprepare run to completion or does the crash happen before it's done running?