knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

Intro

This quick makes use of some functions to survey files in the portal and their access.

Set up

The usual setup:

library(nfportalutils)
syn_login()

Files downloadable for Synapse registered users

When talking about "public" files, this usually means files that are viewable and downloadable to Synapse users. This group has id 273948, so we use in the query below:

public_access <- summarize_file_access(principal_id = 273948, "DOWNLOAD", "syn16858331")
public_access

Breakdown as absolute number and as proportions:

public_access[, .(n_files = sum(N)), by = access][, .(access, n_files, proportion = n_files / sum(n_files))]

Some Nuances

While it would be nice to see the file access restrictions at different points in time, note that the underlying API only returns access control info at present. A file may have inherited from a benefactor at an earlier point, but then becomes its own benefactor later (i.e. more granular access control), so queries based on a past state will likely not work. Don't try something like:

public_access_q3_2022 <- summarize_file_access(principal_id = 273948, "DOWNLOAD", "syn16858331.47")


nf-osi/nfportalutils documentation built on Feb. 26, 2024, 1:05 p.m.