Entering edit mode
6.4 years ago
user31888
▴
150
Is there a way to convert a GDCResults
object (i.e. nested lists) obtained with the R package GenomicDataCommons
into a data frame?
test sample:
library(GenomicDataCommons)
test = cases() %>% filter(~ project.project_id=='TCGA-CHOL') %>% results(n=10)
I tried to convert into a data frame using the codes mentioned here and here, but they return a 2 column data frame of hundreds of lines (not very handy). Plus, I lose the column names when converting to a matrix:
df <- as.data.frame(matrix(unlist(test), nrow=length(unlist(test[1]))), stringsAsFactors=F)
copy/pasted from webpage:
No luck.
@OP: Try this. tagging the author: Sean Davis
Unfortunately, I am not able to connect to gdc server.
I've just reinstalled GenomicDataCommons and all the dependencies. I cannot connect to the server anymore neither.
The version available from Bioconductor (installed on my system) is 1.2.0. The version of GenomicDataCommons describing the
as.data.frame.GDCResults
function here is 1.3.1. Maybe the function was added recently. Where can we get version 1.3.1 or 1.3.4?Installed
GenomicDataCommons v1.5.4
on macOS WITHOUT updating dependencies. I can connect to the GDC server. But the functionas.data.frame
still not working (note thatas.data.frame.GDCResults
does not seem to exist).GenomicDataCommons v1.2.0 has
as.data.frame.GDCResults
function. Tryhelp(package = GenomicDataCommons)
to see the functions. I think there is basic functionality issue. TryGenomicDataCommons::status()
Correct.
as.data.frame.GDCResults
appears in the v1.2.0 and 1.5.4 helpers. But still:Also tried on Linux (v1.2.0 new install + dependencies update):
On macOS (v.1.5.4 new install without dependencies update):