Package 'thermos'

Title: Interface with IonReporter from R
Description: thermos allows you to use the IonReporter API with R
Authors: Kai Aragaki [aut, cre]
Maintainer: Kai Aragaki <[email protected]>
License: MIT + file LICENSE
Version: 0.0.0.9000
Built: 2025-03-03 05:03:41 UTC
Source: https://github.com/KaiAragaki/thermos

Help Index


Get analysis details

Description

Get analysis details

Usage

analysis(
  type = c("sample", "analysis"),
  name = NULL,
  id = NULL,
  start_date = NULL,
  end_date = NULL,
  duration = NULL,
  exclude = NULL,
  view = NULL,
  tidy = TRUE
)

Arguments

type

character. Either "sample" (the default) or "analysis"

name

character. See details.

id

character. Optional. ID of analysis.

start_date, end_date

character. Optional. YYYY-MM-DD format.

duration

Optional. Parameter to filter the results by days/months. Valid value starts with "-" follow by a numeric value and ending with "d" or "m"

exclude

Optional. Can be "reports", "unfilteredvariants", "filteredvariants", or NULL. If NULL (default), downloads all.

view

Optional. Can be "summary", which will include a list of all analyses without links to the analyses (which can be faster to call)

tidy

boolean. Ignored if view is NULL. Should the results be presented as a tidy tibble?

Value

A JSON-like list or, if view = "summary" and tidy = TRUE, a tibble.


Download an IonReporter file

Description

Download an IonReporter file

Usage

download(file_path, type = NULL, dest = NULL)

Arguments

file_path

Path where the file is stored on the server. See details.

type

Format of file. By default, file will be downloaded enclosed in a .zip

dest

Location where the file should be saved. If NULL, will be downloaded to tempfile.

Value

Path to downloaded files


Download a BAM file

Description

In a typical workflow, this will be used with get_associated_bamfiles to obtain the file_path argument

Usage

download_bam(file_path, type = NULL)

Arguments

file_path

character. Typically the output of get_associated_bamfiles.

type

character. Honestly no idea what this does. If NULL (default), downloads a zip. Other options are "" and "pdf"


Get BAM files associated with samples or analyses

Description

Get BAM files associated with samples or analyses

Usage

get_associated_bamfiles(name, type = c("analysis", "sample"))

Arguments

name

character vector of either sample or analysis names

type

character, either "sample" or "analysis"

Details

You can get a list of analysis names using the list_analyses function. It's unclear if there's a way to get a list of sample names from the API.


Get a link to a VCF file

Description

If you want to download a VCF to a file, download_vcf is a better option.

Usage

getvcf(
  type = c("sample", "analysis"),
  name,
  id = NULL,
  start_date = NULL,
  end_date = NULL,
  duration = NULL,
  exclude = NULL
)

get_vcf(...)

download_vcf(dest = NULL, ...)

Arguments

type

character. Either "sample" (the default) or "analysis"

name

character. See details.

id

character. Optional. ID of analysis.

start_date, end_date

character. Optional. YYYY-MM-DD format.

duration

Optional. Parameter to filter the results by days/months. Valid value starts with "-" follow by a numeric value and ending with "d" or "m"

exclude

Optional. Can be "unfilteredvariants", "filteredvariants", or NULL. If NULL (default), downloads both.

...

Additional arguments passed to getvcf.

dest

Where the file should be saved. Should generally be a .zip. If null, will be saved as a tempfile with a .zip extension

Details

download_vcf provides a slightly more ergonomic way to directly download files, rather than just get links to them.

Sample names are the names in the 'Sample' field in under the 'Samples' tab on IonReporter. They are also under the 'samples' column in the output of get_analysis_details, not the 'name' column.

Analysis names can also be used to select a vcf to download/get links to download. They exist in the 'name' column in the output of get_analysis_details

Although the original API documentation seems to imply that the name argument isn't needed if type == "analysis", it appears that it is still needed.

All other arguments - except exclude - are further filters of the hits where type and name match.

I wish I could give a better explanation of "duration" but honestly the API documentation was sparse and gave no examples

Value

  • download_vcf: The path to the downloaded file

  • getvcf: A JSON-like list containing the link to download the file, the name, and the id of the analysis that the sample was in


Helper to set up IonReporter envvar

Description

Helper to set up IonReporter envvar

Usage

key_setup()

Value

boolean. Has key been set? Will return FALSE after setup since session hasn't been restarted