collections()
returns collections available to the
user.
my_collections()
is a convenience function to
identify collections belonging to the current user.
globus_ls()
lists the content of a collection.
mkdir()
creates a directory in a collection.
Usage
collections(
filter_fulltext = "",
filter_scope = "all",
...,
all_fields = FALSE
)
my_collections(filter_fulltext = "", ...)
globus_ls(
.data,
path = "",
show_hidden = FALSE,
filters = character(),
all_fields = FALSE
)
mkdir(.data, path)
Arguments
- filter_fulltext
character()
filter applied to fields associated with collections, including display name, description, user, etc.filter_fulltext
is required whenfilter_scope = "all"
.- filter_scope
character(1)
scope of search, e.g.,"all"
or"my-endpoints"
. See details.- ...
additional, less-common parameters influencing search. See details.
- all_fields
logical(1)
indicating whether abbreviated or full listing should be returned.- .data
a
tibble
with a single row, containing a columnid
identifying the collection, as returned bycollections()
ormy_collections()
.- path
character(1)
location in the collection for listing or directory creation.logical(1)
controls inclusion of 'hidden' (starting with '.') files in the return value ofglobus_ls()
.- filters
character()
of filter terms. See details.
Value
collections()
and my_collections()
return a tibble
containing
columns display_name
and (collection / endpoint) id
. Additional
fields returned when all_fields = TRUE
are described at
https://docs.globus.org/api/transfer/endpoints_and_collections/#endpoint_or_collection_fields.
globus_ls()
returns a tibble
with the name, last modified, size,
and type (directory or file) of each entry. Additional fields are
returned when all_fields = TRUE
, as described in
https://docs.globus.org/api/transfer/file_operations/#file_document
mkdir()
returns a tibble
of the directory listing of the
enclosing directory.
Details
filter_fulltext
follows rules defined at
https://docs.globus.org/api/transfer/endpoint_and_collection_search/#endpoint_search
Approximately, each word is treated as a separate term and matched
to the prefix of search fields. Thus "Public HuBMAP"
matches
collection mentioning both "Public"
AND "HuBMAP"
, appearing in
any order, e.g., "HuBMAP Public"
, "HuBMAP Dev Public"
, etc.
filter_scope
can take on values described in
https://docs.globus.org/api/transfer/endpoint_and_collection_search/#search_scope
...
arguments to collections()
and my_collections()
are
described in
https://docs.globus.org/api/transfer/endpoint_and_collection_search/#query_parameters
'offset' and 'limit' are used internally.
When used with 'Globus Connect Personal' (used to enable transfer
to and from a local computer), path
is either the full path on
the user system (starting with /
, e.g., /Users/mtmorgan/HuBMAP
)
or relative to the user home directory (starting without a /
,
e.g., '~/HuBMAP').
filters
for globus_ls()
are described at
https://docs.globus.org/api/transfer/file_operations/#dir_listing_filtering
Elements of filters
are treated as 'OR' operations, thus filters = "name:~*.csv/size:<200"
finds csv
files smaller than 200 bytes,
whereas filters = #' c("name:~*.csv", "size:<200")
finds csv
files of any size, or any file smaller than 200 bytes.
mkdir()
creates directory elements recursively.
Examples
##
## collections
##
collections <- collections("HuBMAP Public") # 'AND' words or elements
collections
#> # A tibble: 4 × 2
#> display_name id
#> <chr> <chr>
#> 1 HuBMAP Public af603d86-eab9-4eec-bb1d-9d26556741bb
#> 2 HuBMAP Dev Public 2b82f085-1d50-4c93-897e-cd79d77481ed
#> 3 HuBMAP Stage Public 4b383482-8c5c-48fb-8b80-a450338ca383
#> 4 HuBMAP Test Public 1e12c423-dd17-4095-a9f8-12555ee83345
hubmap <-
collections |>
dplyr::filter(display_name == "HuBMAP Public")
my_collection <- my_collections()
my_collection
#> # A tibble: 1 × 2
#> display_name id
#> <chr> <chr>
#> 1 Martin's HuBMAP 714ce2c4-3268-11ef-9629-453c3ae125a5
##
## Directories and files
##
globus_ls(hubmap) # same as `hubmap |> globus_ls()`
#> # A tibble: 2,308 × 4
#> name last_modified size type
#> <chr> <chr> <int> <chr>
#> 1 0008a49ac06f4afd886be81491a5a926 2024-07-26 13:35:21+00:00 4096 dir
#> 2 0027cb59bcb4a34d5db83acaf934a9d9 2024-07-26 13:19:12+00:00 4096 dir
#> 3 002e9747855eef1e69452b39713a7592 2024-08-13 19:04:13+00:00 4096 dir
#> 4 00318be0b7cfa3c6ed7fbeab08fe700b 2024-07-26 12:58:42+00:00 4096 dir
#> 5 004d4f157df4ba07356cd805131dfc04 2024-08-13 19:21:04+00:00 4096 dir
#> 6 0066713ca95c03c52cb40f90ce8bbdb8 2024-04-17 23:24:41+00:00 4096 dir
#> 7 007ae59344e7df0e398204ee40155cb0 2024-04-17 23:18:56+00:00 4096 dir
#> 8 007f3dfaaa287d5c7c227651f61a9c5b 2024-07-26 14:46:55+00:00 4096 dir
#> 9 00cc71c7e1cddac60e794044079faeee 2024-07-26 14:17:08+00:00 4096 dir
#> 10 00d1a3623dac388773bc7780fcb42797 2024-04-17 23:02:27+00:00 4096 dir
#> # ℹ 2,298 more rows
## hierarchical traversal
hubmap |>
globus_ls("0008a49ac06f4afd886be81491a5a926/sprm_outputs")
#> # A tibble: 84 × 4
#> name last_modified size type
#> <chr> <chr> <int> <chr>
#> 1 out.hdf5 2021-11-21 0… 4.46e8 file
#> 2 reg1_stitched_expressions.ome.tiff-Cluster_Shape.… 2021-11-21 0… 6.58e6 file
#> 3 reg1_stitched_expressions.ome.tiff-SNR.csv 2021-11-21 0… 4.85e2 file
#> 4 reg1_stitched_expressions.ome.tiff-SPRM_Image_Qua… 2021-11-21 0… 5.72e3 file
#> 5 reg1_stitched_expressions.ome.tiff-Superpixels.png 2021-11-21 0… 6.01e6 file
#> 6 reg1_stitched_expressions.ome.tiff-Top3ChannelPCA… 2021-11-21 0… 5.29e7 file
#> 7 reg1_stitched_expressions.ome.tiff-cell_1_texture… 2021-11-21 0… 2.10e7 file
#> 8 reg1_stitched_expressions.ome.tiff-cell_boundarie… 2021-11-21 0… 1.38e8 file
#> 9 reg1_stitched_expressions.ome.tiff-cell_boundarie… 2021-11-21 0… 1.30e7 file
#> 10 reg1_stitched_expressions.ome.tiff-cell_boundarie… 2021-11-21 0… 4.62e6 file
#> # ℹ 74 more rows
## filter files with name ending in 'csv', and with size < 200
hubmap |>
globus_ls(
"0008a49ac06f4afd886be81491a5a926/sprm_outputs",
filters = "name:~*.csv/size:<200"
)
#> # A tibble: 7 × 4
#> name last_modified size type
#> <chr> <chr> <int> <chr>
#> 1 reg1_stitched_expressions.ome.tiff-clustercell_boun… 2021-11-21 0… 196 file
#> 2 reg1_stitched_expressions.ome.tiff-clustercell_mean… 2021-11-21 0… 197 file
#> 3 reg1_stitched_expressions.ome.tiff-clustercell_tSNE… 2021-11-21 0… 110 file
#> 4 reg1_stitched_expressions.ome.tiff-clustercell_text… 2021-11-21 0… 36 file
#> 5 reg1_stitched_expressions.ome.tiff-clustercell_tota… 2021-11-21 0… 196 file
#> 6 reg1_stitched_expressions.ome.tiff-clusternuclei_to… 2021-11-21 0… 190 file
#> 7 reg1_stitched_expressions.ome.tiff-clusternucleus_b… 2021-11-21 0… 193 file
## filter files ending in 'json', or with size > 100000000
hubmap |>
globus_ls(
"0008a49ac06f4afd886be81491a5a926/sprm_outputs",
filters = c("name:~*.json", "size:>100000000")
)
#> # A tibble: 8 × 4
#> name last_modified size type
#> <chr> <chr> <int> <chr>
#> 1 out.hdf5 2021-11-21 0… 4.46e8 file
#> 2 reg1_stitched_expressions.ome.tiff-SPRM_Image_Qual… 2021-11-21 0… 5.72e3 file
#> 3 reg1_stitched_expressions.ome.tiff-cell_boundaries… 2021-11-21 0… 1.38e8 file
#> 4 reg1_stitched_expressions.ome.tiff-cell_channel_co… 2021-11-21 0… 1.45e8 file
#> 5 reg1_stitched_expressions.ome.tiff-cell_polygons_s… 2021-11-21 0… 1.30e8 file
#> 6 reg1_stitched_expressions.ome.tiff-cell_shape.csv 2021-11-21 0… 1.55e8 file
#> 7 reg1_stitched_expressions.ome.tiff-nuclei_channel_… 2021-11-21 0… 1.14e8 file
#> 8 reg1_stitched_expressions.ome.tiff-nucleus_boundar… 2021-11-21 0… 1.09e8 file
if (FALSE) { # \dontrun{
mkdir(my_collection, "tmp/HuBMAP/test")
} # }