Auth-class: Class Auth

Description Arguments Details Fields Methods Examples

Description

Auth token object

Arguments

auth_token

[character] your auth token.

api

[character using, by default it is sbg us platform.

url

[chracter] a URL for the API, default is NULL, will use api parameter to switch to the right one.

version

[character] default: 1.1 version used for api.

Details

Every object could be requested from this Auth object and any action could start from this object using cascading style. Please check vignette 'easy-api' for more information.

Fields

auth_token

[character] your auth token.

url

[character] basic url used for API, by default it's https://api.sbgenomics.com/1.1/

Methods

project(name = NULL, id = NULL, index = NULL, ignore.case = TRUE, exact = TRUE)

find project

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
## replace it with real token
token <- "aef7e9e3f6c54fb1b338ac4ecddf1a56"
a <- Auth(token)

## get billing info
b <- a$billing()
## create project
a$project_new(name = "API", description = "API tutorial",
              billing_group_id = b[[1]]$id)
p <- a$project("API")
## get data
fl <- system.file("extdata", "sample1.fastq", package = "sbgr")
## create meta data
fl.meta <- list(file_type = "fastq",
                seq_tech = "Illumina",
                sample = "sample1",
                author = "tengfei")
## upload data with metadata
p$upload(fl, metadata = fl.meta)
## check uploading success
f.file <- p$file(basename(fl))
## get the pipeline from public repos
f.pipe <- a$pipeline(pipeline_name = "FastQC")
## copy the pipeline to your project
p$pipeline_add(pipeline_name = f.pipe$name)
## get the pipeline from your project not public one
f.pipe <- p$pipeline(name = "FastQC")
## check the inputs needed for running tasks
f.pipe$details()
## Ready to run a task? go
f.task <- p$task_run(name = "my task",
                      description = "A text description",
                      pipeline_id = f.pipe$id,
                      inputs = list(
                          "177252" = list(f.file$id)
                          ))
f.task$run()
## or you can just run with Task constructor
f.task <- Task(auth = Auth(token),
               name = "my task",
               description = "A text description",
               pipeline_id = f.pipe$id,
               project_id = p$id,
               inputs = list(
                   "177252" = list(f.file$id)
                   ))
## Monitor you task
f.task$monitor(30)

## download a task output files
f.task <- p$task("my task")
f.task$download("~/Desktop/")

## Abort the task
f.task$abort()

road2stat/sbgr documentation built on March 9, 2021, 4:33 a.m.