Lists a set of files from an HCP bucket for a specific sub-folder
hcp_list_files(prefix = "", delimiter = NULL, query = NULL, ...)
fcp_list_files(prefix = "", delimiter = NULL, query = NULL, ...)
openneuro_list_files(prefix = "", delimiter = NULL, query = NULL, ...)
hcp_list_dirs(prefix = "HCP/", ...)
fcp_list_dirs(prefix = "data/Projects/", ...)
openneuro_list_dirs(prefix = NULL, ...)
prefix | directory folder to list files. If |
---|---|
delimiter | Delimiter to list files. For example |
query | Additional query arguments |
... | additional arguments passed to |
List with the result of the GET command, the parsed result, and the content from the result.
if (have_aws_key()){
x = hcp_list_files(prefix = "HCP/100307/unprocessed/3T/Diffusion",
delimiter="bval")
stopifnot(x$parsed_result$ListBucketResult$Name[[1]] == "hcp-openaccess")
t1_niis = hcp_list_files(prefix ="HCP/100307/T1w",
delimiter = ".nii.gz")
all_dirs = hcp_list_dirs("HCP/")
}
if (have_aws_key()){
res = hcp_list_dirs("HCP/")
projects = unlist(parse_list_files(res)$prefixes)
projects = unname(projects)
projects = unname(projects)
head(projects)
head(basename(projects))
stopifnot("100307" %in% basename(projects))
}
if (have_aws_key()){
res = fcp_list_dirs()
projects = unlist(parse_list_files(res)$prefixes)
projects = unname(projects)
head(projects)
head(basename(projects))
stopifnot("ABIDE" %in% basename(projects))
}
res = openneuro_list_dirs()
projects = unlist(parse_list_files(res)$prefixes)
projects = unname(projects)
head(projects)
#> [1] "ds000001/" "ds000002/" "ds000003/" "ds000005/" "ds000006/"
#> [6] "ds000006A/"
if (length(projects) > 0) {
head(basename(projects))
stopifnot("ds000002" %in% basename(projects))
}