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 |
Get analysis details
analysis( type = c("sample", "analysis"), name = NULL, id = NULL, start_date = NULL, end_date = NULL, duration = NULL, exclude = NULL, view = NULL, tidy = TRUE )
analysis( type = c("sample", "analysis"), name = NULL, id = NULL, start_date = NULL, end_date = NULL, duration = NULL, exclude = NULL, view = NULL, tidy = TRUE )
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 |
A JSON-like list or, if view = "summary"
and tidy = TRUE
, a
tibble
.
Download an IonReporter file
download(file_path, type = NULL, dest = NULL)
download(file_path, type = NULL, dest = NULL)
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. |
Path to downloaded files
In a typical workflow, this will be used with get_associated_bamfiles
to
obtain the file_path
argument
download_bam(file_path, type = NULL)
download_bam(file_path, type = NULL)
file_path |
character. Typically the output of
|
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
get_associated_bamfiles(name, type = c("analysis", "sample"))
get_associated_bamfiles(name, type = c("analysis", "sample"))
name |
character vector of either sample or analysis names |
type |
character, either "sample" or "analysis" |
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.
If you want to download a VCF to a file, download_vcf
is a better option.
getvcf( type = c("sample", "analysis"), name, id = NULL, start_date = NULL, end_date = NULL, duration = NULL, exclude = NULL ) get_vcf(...) download_vcf(dest = NULL, ...)
getvcf( type = c("sample", "analysis"), name, id = NULL, start_date = NULL, end_date = NULL, duration = NULL, exclude = NULL ) get_vcf(...) download_vcf(dest = NULL, ...)
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 |
dest |
Where the file should be saved. Should generally be a .zip. If
null, will be saved as a tempfile with a |
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
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
key_setup()
key_setup()
boolean. Has key been set? Will return FALSE after setup since session hasn't been restarted