Auth token object
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 |
version | [character] default: 1.1 version used for api. |
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.
auth_token
[character] your auth token.
url
[character] basic url used for API, by default it's https://api.sbgenomics.com/1.1/
project(name = NULL, id = NULL, index = NULL, ignore.case = TRUE, exact = TRUE)
find project
## replace it with real token token <- "aef7e9e3f6c54fb1b338ac4ecddf1a56" a <- Auth(token) # \donttest{ ## get billing info b <- a$billing()#> Error: HTTP Status 404: /1.1/billing not found## create project a$project_new(name = "API", description = "API tutorial", billing_group_id = b[[1]]$id)#> Error in sbgr::project_new(auth_token, name = name, base_url = url, description = description, billing_group_id = billing_group_id): object 'b' not foundp <- a$project("API")#> Error: HTTP Status 404: /1.1/project not found## 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)#> Error in eval(expr, envir, enclos): object 'p' not found#> Error in eval(expr, envir, enclos): object 'p' not found## get the pipeline from public repos f.pipe <- a$pipeline(pipeline_name = "FastQC")#> Error: HTTP Status 404: /1.1/pipeline/public not found## copy the pipeline to your project p$pipeline_add(pipeline_name = f.pipe$name)#> Error in eval(expr, envir, enclos): object 'p' not found## get the pipeline from your project not public one f.pipe <- p$pipeline(name = "FastQC")#> Error in eval(expr, envir, enclos): object 'p' not found## check the inputs needed for running tasks f.pipe$details()#> Error in eval(expr, envir, enclos): object 'f.pipe' not found## 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) ))#> Error in eval(expr, envir, enclos): object 'p' not foundf.task$run()#> Error in eval(expr, envir, enclos): object 'f.task' not found## 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) ))#> Error in initRefFields(.self, .refClassDef, as.environment(.self), list(...)): object 'f.pipe' not found## Monitor you task f.task$monitor(30)#> Error in eval(expr, envir, enclos): object 'f.task' not found## download a task output files f.task <- p$task("my task")#> Error in eval(expr, envir, enclos): object 'p' not foundf.task$download("~/Desktop/")#> Error in eval(expr, envir, enclos): object 'f.task' not found## Abort the task f.task$abort()#> Error in eval(expr, envir, enclos): object 'f.task' not found# }