Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch/schematic api #156

Merged
merged 3 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: nfportalutils
Title: NF Portal Utilities
Version: 0.0.0.945
Version: 0.0.0.946
Authors@R: c(
person(given = "Robert", family = "Allaway", role = c("aut", "cre"),
email = "robert.allaway@sagebionetworks.org",
Expand Down
9 changes: 4 additions & 5 deletions R/annotation_qc.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#' Generate manifest via schematic service
#'
#' See [schematic manifest generation](https://schematic.api.sagebionetworks.org/v1/ui/#/Manifest%20Operations/schematic_api.api.routes.get_manifest_route).
#' Note that this uses the access token of user that should already by logged in with `syn_login`.
#' Note that this uses the access token of user that should already be logged in with `syn_login`.
#'
#' @param data_type Data type of the manifest to generate (aka Component).
#' @param dataset_id Optional, if given this fills out manifest for existing dataset instead of generating a blank manifest.
Expand All @@ -22,7 +22,7 @@ manifest_generate <- function(data_type,
use_annotations = TRUE,
service = "https://schematic.api.sagebionetworks.org/v1/manifest/generate") {

# yes, param has been re-encoded like this for 'dataframe'
# yes, param needs to be re-encoded like this for 'dataframe'
output_format_param <- if (output_format == "dataframe") "dataframe (only if getting existing manifests)" else output_format
access_token <- .syn$credentials$secret
use_annotations <- tolower(as.character(use_annotations))
Expand All @@ -35,9 +35,8 @@ manifest_generate <- function(data_type,
use_annotations = use_annotations,
dataset_id = dataset_id,
asset_view = asset_view,
output_format = output_format_param,
access_token = access_token
))
output_format = output_format_param),
httr::add_headers(Authorization = paste("Bearer", access_token)))

status <- httr::status_code(req)
if(status != 200L) stop("Unsuccessful request, received status code: ", status)
Expand Down
2 changes: 1 addition & 1 deletion man/manifest_generate.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.