Problem in using TCGAvisualize_meanMethylation() function?
0
0
Entering edit mode
@mahmoodamiri225-15213
Last seen 5.8 years ago

Hi, I used ‘TCGAbiolinks’ version 2.6.12. I have just tried to plot using TCGAvisualize_meanMethylation function, using flowing codes, but the R script didn't work well and flowing error came out. how can I solve this problem?

Thanks in advance!

R version 3.4.3 (2017-11-30) -- "Kite-Eating Tree"

Copyright (C) 2017 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)

> library(TCGAbiolinks)
> library(stringr)
> library("SummarizedExperiment")

> # Samples
> matched_met_exp <- function(project, n = NULL){
+ # get primary solid tumor samples: DNA methylation
+ message("Download DNA methylation information")
+ met450k <- GDCquery(project = project,
+                     data.category = "DNA methylation",
+                     platform = "Illumina Human Methylation 450",
+                     legacy = TRUE,
+                     sample.type = c("Primary solid Tumor"))
+ met450k.tp <- met450k$results[[1]]$cases
+ # get primary solid tumor samples: RNAseq
+ message("Download gene expression information")
+ exp <- GDCquery(project = project,
+                 data.category = "Gene expression",
+                 data.type = "Gene expression quantification",
+                 platform = "Illumina HiSeq",
+                 file.type = "results",
+                 sample.type = c("Primary solid Tumor"),
+ legacy = TRUE)
+ exp.tp <- exp$results[[1]]$cases
+ print(exp.tp[1:10])
+ # Get patients with samples in both platforms
+ patients <- unique(substr(exp.tp,1,15)[substr(exp.tp,1,12) %in% substr(met450k.tp,1,12)])
+ if(!is.null(n)) patients <- patients[1:n] # get only n samples
+ return(patients)
+ }
> lgg.samples <- matched_met_exp("TCGA-LGG", n = 10)
Download DNA methylation information
--------------------------------------
o GDCquery: Searching in GDC database
--------------------------------------
Genome of reference: hg19
--------------------------------------------
oo Accessing GDC. This might take a while...
--------------------------------------------
ooo Project: TCGA-LGG
--------------------
oo Filtering results
--------------------
ooo By platform
ooo By sample.type
----------------
oo Checking data
----------------
ooo Check if there are duplicated cases
ooo Check if there results for the query
-------------------
o Preparing output
-------------------
Download gene expression information
--------------------------------------
o GDCquery: Searching in GDC database
--------------------------------------
Genome of reference: hg19
--------------------------------------------
oo Accessing GDC. This might take a while...
--------------------------------------------
ooo Project: TCGA-LGG
--------------------
oo Filtering results
--------------------
ooo By platform
ooo By data.type
ooo By file.type
ooo By sample.type
----------------
oo Checking data
----------------
ooo Check if there are duplicated cases
ooo Check if there results for the query
-------------------
o Preparing output
-------------------
 [1] "TCGA-HT-7480-01A-11R-2090-07" "TCGA-QH-A6XC-01A-12R-A32Q-07"
 [3] "TCGA-HT-A614-01A-11R-A29R-07" "TCGA-HT-8104-01A-11R-2404-07"
 [5] "TCGA-TQ-A7RG-01A-11R-A33Z-07" "TCGA-HW-7487-01A-11R-2027-07"
 [7] "TCGA-FG-8186-01A-11R-2256-07" "TCGA-P5-A5EX-01A-12R-A28M-07"
 [9] "TCGA-CS-6667-01A-12R-2027-07" "TCGA-DU-7304-01A-12R-2090-07"
> gbm.samples <- matched_met_exp("TCGA-GBM", n = 10)
Download DNA methylation information
--------------------------------------
o GDCquery: Searching in GDC database
--------------------------------------
Genome of reference: hg19
--------------------------------------------
oo Accessing GDC. This might take a while...
--------------------------------------------
ooo Project: TCGA-GBM
--------------------
oo Filtering results
--------------------
ooo By platform
ooo By sample.type
----------------
oo Checking data
----------------
ooo Check if there are duplicated cases
ooo Check if there results for the query
-------------------
o Preparing output
-------------------
Download gene expression information
--------------------------------------
o GDCquery: Searching in GDC database
--------------------------------------
Genome of reference: hg19
--------------------------------------------
oo Accessing GDC. This might take a while...
--------------------------------------------
ooo Project: TCGA-GBM
--------------------
oo Filtering results
--------------------
ooo By platform
ooo By data.type
ooo By file.type
ooo By sample.type
----------------
oo Checking data
----------------
ooo Check if there are duplicated cases
ooo Check if there results for the query
-------------------
o Preparing output
-------------------
 [1] "TCGA-06-0184-01A-01R-1849-01" "TCGA-06-0649-01B-01R-1849-01"
 [3] "TCGA-02-2485-01A-01R-1849-01" "TCGA-26-5136-01B-01R-1850-01"
 [5] "TCGA-76-4925-01A-01R-1850-01" "TCGA-32-2632-01A-01R-1850-01"
 [7] "TCGA-06-5858-01A-01R-1849-01" "TCGA-28-5213-01A-01R-1850-01"
 [9] "TCGA-06-0157-01A-01R-1849-01" "TCGA-16-0846-01A-01R-1850-01"
> samples <- c(lgg.samples,gbm.samples)
> query.lgg <- GDCquery(project = "TCGA-LGG",
+                       data.category = "DNA methylation",
+                       platform = "Illumina Human Methylation 450",
+                       legacy = TRUE, barcode = lgg.samples)
--------------------------------------
o GDCquery: Searching in GDC database
--------------------------------------
Genome of reference: hg19
--------------------------------------------
oo Accessing GDC. This might take a while...
--------------------------------------------
ooo Project: TCGA-LGG
--------------------
oo Filtering results
--------------------
ooo By platform
ooo By barcode
----------------
oo Checking data
----------------
ooo Check if there are duplicated cases
ooo Check if there results for the query
-------------------
o Preparing output
-------------------
> met.lgg <-GDCprepare(query.lgg, save = FALSE)
  |====================================================================================| 100%Downloading genome information (try:0) Using: Homo sapiens genes (GRCh37.p13)
Loading from disk
Starting to add information to samples
 => Add clinical information to samples
Add FFPE information. More information at: 
=> https://cancergenome.nih.gov/cancersselected/biospeccriteria 
=> http://gdac.broadinstitute.org/runs/sampleReports/latest/FPPP_FFPE_Cases.html
 => Adding subtype information to samples
lgg subtype information from:doi:10.1016/j.cell.2015.12.028
> query.gbm <- GDCquery(project = "TCGA-GBM",
+                       data.category = "DNA methylation",
+                       platform = "Illumina Human Methylation 450",
+                       legacy = TRUE, barcode = gbm.samples)
--------------------------------------
o GDCquery: Searching in GDC database
--------------------------------------
Genome of reference: hg19
--------------------------------------------
oo Accessing GDC. This might take a while...
--------------------------------------------
ooo Project: TCGA-GBM
--------------------
oo Filtering results
--------------------
ooo By platform
ooo By barcode
----------------
oo Checking data
----------------
ooo Check if there are duplicated cases
ooo Check if there results for the query
-------------------
o Preparing output
-------------------
> met.gbm <- GDCprepare(query.gbm, save = FALSE)
  |====================================================================================| 100%Downloading genome information (try:0) Using: Homo sapiens genes (GRCh37.p13)
Loading from disk
Starting to add information to samples
 => Add clinical information to samples
Add FFPE information. More information at: 
=> https://cancergenome.nih.gov/cancersselected/biospeccriteria 
=> http://gdac.broadinstitute.org/runs/sampleReports/latest/FPPP_FFPE_Cases.html
 => Adding subtype information to samples
gbm subtype information from:doi:10.1016/j.cell.2015.12.028
> met <- SummarizedExperiment::cbind(met.lgg, met.gbm)
> met <- subset(met,subset = (rowSums(is.na(assay(met))) == 0))
> met <- subset(met,subset = !as.character(seqnames(met)) %in% c("chrNA","chrX","chrY"))
> TCGAvisualize_meanMethylation(met,
+                                  groupCol = "disease_type",
+                                  group.legend = "Groups",
+                                  filename = "mean_lgg_gbm.png",
+                                  print.pvalue = TRUE)
==================== DATA Summary ====================
Error in sort.int(x, na.last = na.last, decreasing = decreasing, ...) : 
  'x' must be atomic

 

tcgabiolinks • 673 views
ADD COMMENT

Login before adding your answer.

Traffic: 674 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6