I am trying to use TCGAbiolinks for the first time with R version 3.3.2 and Bioconductor version 3.4. I have so far encountered three problems of apparent different nature, which I show here (these are examples I found online):
library(TCGAbiolinks)
clin.gbm <- GDCquery_clinic("TCGA-LIHC", "clinical")
TCGAanalyze_survival(clin.gbm,
"gender",
main = "TCGA Set\n GBM",height = 10, width=10)
The data is downloaded fine (there are plenty of NAs but I imagine this is just how it is). However, the plot isn't shown and I get the error
Scale for 'colour' is already present. Adding another scale for 'colour', which will replace the existing scale.
I have also tried the following code
days_to_death <- floor(runif(200, 1, 1000))
vital_status <- c(rep("Dead",200))
groups <- c(rep(c("G1","G2"),c(100,100)))
df <- data.frame(days_to_death,vital_status,groups)
TCGAanalyze_survival(df,clusterCol="groups")
giving
Error in TCGAanalyze_survival(df, clusterCol = "groups") : Columns vital_status, days_to_death and days_to_last_follow_up should be in data frame
(which, of course, seem to me like they are!) and, finally,
mut <- GDCquery_Maf("ACC", pipelines = "muse")
clin <- GDCquery_clinic("TCGA-ACC","clinical")
clin <- clin[,c("bcr_patient_barcode","disease","gender","tumor_stage","race","vital_status")]
TCGAvisualize_oncoprint(mut = mut, genes = mut$Hugo_Symbol[1:20],
filename = "oncoprint.pdf",
annotation = clin,
color=c("background"="#CCCCCC","DEL"="purple","INS"="yellow","SNP"="brown"),
rows.font.size=10,
width = 5,
heatmap.legend.side = "right",
dist.col = 0,
label.font.size = 10)
which gives Aggregate function missing, defaulting to 'length' in the last function.
I would be grateful for any suggestions as to how to solve it. It seems to me that the functions TCGAanalyze_survival() and TCGAvisualize_oncoprint() are the problem whereas the rest works fine.
Update: I found it strange that it was asking for the column days_to_last_follow_up, which I had never specified, so I checked the function TCGAanalyze_survival and it requites it (perhaps there has been an important update of which I am unaware?). Once this new column was added to df I get, again,
Scale for 'colour' is already present. Adding another scale for 'colour', which will replace the existing scale.

Thank you - all solved now!