Bioconductor / GenomicDataCommons

Provide R access to the NCI Genomic Data Commons portal.
http://bioconductor.github.io/GenomicDataCommons/
83 stars 23 forks source link

file_id not recognized as field for file endpoint. #29

Closed wwysoc2 closed 7 years ago

wwysoc2 commented 7 years ago

It doesn't seem to recognize 'file_id' as a valid field for the files endpoint. I know that as a workaround, the UUIDs can be retrieved with the bottom command, but it might be good to keep the fields consistent.


> fields <-c("file_id","file_name","cases.submitter_id")
> query2 = files(fields=fields,filters=make_filter("experimental_strategy"=="WXS"&"data_format"=="BAM"),size=20000)
> query2[[1]]
$file_name
[1] "C529.TCGA-HC-7737-11A-02D-2114-08.1_gdc_realn.bam"

$cases
  submitter_id 
"TCGA-HC-7737"
> names(query2[1])
[1] "164511a9-2f56-49e0-b5cf-9c4be32f8fc7"```
seandavi commented 7 years ago

Thanks for the report. There have been a significant changes made to the package (and more to come). The mechanism for constructing queries has been entirely revamped. However, I took your comment to heart and have left the "id" fields in the results. In addition, there is now an S3 generic called ids() that can return the ids of any result or query without having to dig into the actual object.

Your query would now look something like:

resp = files() %>% 
    select(fields=c('file_name','cases.submitter_id')) %>% 
    filter(~ experimental_strategy == "WXS" & data_format == "BAM") %>% 
    response_all()
count(resp)
# [1] 22893
head(ids(resp))

If you have further feedback, let me know.

seandavi commented 7 years ago

@wwysoc2, I added an ids method that works for annotations, cases, files, and projects response objects (working on documenting the classes). If this doesn't work for you or you have other ideas, let me know.