Bioconductor / hca

Human Cell Atlas data discovery and retrieval
Other
3 stars 2 forks source link

files.download error #22

Closed cdiaz45 closed 3 years ago

cdiaz45 commented 3 years ago

Hello there, I am trying to use your package to download data from HCA but I seem to run into trouble when I hit the download section. I use some code posted by a scientists on the HCA slack channel. Code:

if (!requireNamespace("BiocManager", quietly = TRUE))
  install.packages("BiocManager")
BiocManager::install("hca")

library(hca)
library(dplyr)
filters <- filters(
  fileFormat = list(is = "loom"),
  fileSource = list(is = "DCP/2 Analysis")
)

columns <- c(
  uuid = "hits[*].files[*].uuid",
  name = "hits[*].files[*].name",
  size = "hits[*].files[*].size",
  version = "hits[*].files[*].version",
  projectTitle = "hits[*].projects[*].projectTitle[*]",
  donorCount = "hits[*].donorOrganisms[*].donorCount",
  genusSppecies = "hits[*].donorOrganisms[*].genusSpecies[*]",
  url = "hits[*].files[*].url"
)

file_tibble <- files(filters, columns = columns)
file_locations <- file_tibble %>% files_download()
#Error in files_download(.) : 'tbl=' must contain columns "url", "name"

loom = file_tibble %>% filter(uuid == 'c0ca89e6-04f5-5af9-8096-0bd58e6c89af') %>% files_download()
#Error in files_download(.) : 'tbl=' must contain columns "url", "name"

I always get the same error about the "url", "name" but file_tibble has the url and the name of the file:

file_tibble uuid name size version projectTitle donorCount genusSppecies url

1 5a606536-… pitx2-deve… 3.91e9 2021-02-1… A Cellular Atlas of Pit… 17 Mus musculus https://service.a… 2 54147d07-… thymic-dev… 5.12e8 2021-05-2… A cell atlas of human t… 2 Homo sapiens https://service.a…

Thank you in advance.

reed-mcdaniel-716 commented 3 years ago

Hello @cdiaz45, Apologies, this is a mistake in the error message. It should say 'tbl=' must contain columns "fileId", "url", and "name" because it is the lack of a fileId column that is actually causing the issue. A quick workaround would be to rename the uuid column as fileId. I will be updating the package to reflect this. Thank you for your patience!

cdiaz45 commented 3 years ago

Thank you!!