├── .Rbuildignore ├── .circleci └── config.yml ├── .editorconfig ├── .gitignore ├── BioInstaller.Rproj ├── ChangeLog ├── DESCRIPTION ├── Dockerfile ├── LICENSE ├── Makefile ├── NAMESPACE ├── NEWS.md ├── R ├── BioInstaller.R ├── active.R ├── conda.R ├── config.R ├── crawl.R ├── docker.R ├── info.R ├── install.R ├── install_utils.R ├── meta.R ├── spack.R ├── utils_function.R └── versions.R ├── README.md ├── _pkgdown.yml ├── inst └── extdata │ ├── config │ ├── db │ │ ├── db_annovar.toml │ │ ├── db_blast.toml │ │ ├── db_main.toml │ │ ├── db_meta.toml │ │ └── db_ucsc.toml.gz │ ├── docker │ │ └── docker.toml │ ├── github │ │ ├── github.toml │ │ └── github_meta.toml │ ├── nongithub │ │ ├── nongithub.toml │ │ └── nongithub_meta.toml │ └── web │ │ └── web_meta.toml │ ├── demo │ └── softwares_db_demo.yaml │ ├── files │ └── sedb_files │ ├── scripts │ ├── echo_root_env.sh │ ├── install.R │ ├── install_tvc.sh │ └── parse_version.R │ └── sql │ ├── output_file_table.sql │ ├── task_table.sql │ └── upload_table.sql ├── man ├── BioInstaller.Rd ├── change.info.Rd ├── conda.Rd ├── conda.env.create.Rd ├── conda.env.list.Rd ├── conda.list.Rd ├── crawl.all.versions.Rd ├── del.info.Rd ├── docker.pull.Rd ├── docker.search.Rd ├── figures │ ├── design_of_bioInstaller.jpg │ ├── logo.png │ └── logo.svg ├── get.info.Rd ├── get.meta.Rd ├── get.meta.files.Rd ├── install.bioinfo.Rd ├── install.github.Rd ├── install.nongithub.Rd ├── is.biosoftwares.db.active.Rd ├── new.bioinfo.Rd ├── set.biosoftwares.db.Rd ├── show.installed.Rd ├── spack.Rd └── spack.list.Rd ├── tests ├── testthat.R └── testthat │ ├── test_active.R │ ├── test_docker.R │ ├── test_info.R │ ├── test_install.R │ ├── test_install_utils.R │ ├── test_meta.R │ ├── test_utils.R │ └── test_versions.R └── vignettes ├── BioInstaller.Rmd ├── download.Rmd ├── items_description.Rmd ├── plugins_of_bioshiny.Rmd ├── start_bioshiny.Rmd └── write_configuration_file.Rmd /.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^.*\.Rproj$ 2 | ^.*\.Rbuildignore$ 3 | ^\.Rproj\.user$ 4 | ^.*\.test 5 | ^data-raw$ 6 | .travis.yml 7 | _pkgdown.yml 8 | README.Rmd 9 | Makefile 10 | Dockerfile 11 | .circleci 12 | .editorconfig 13 | -------------------------------------------------------------------------------- /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | # Javascript Node CircleCI 2.0 configuration file 2 | # 3 | # Check https://circleci.com/docs/2.0/language-javascript/ for more details 4 | # 5 | version: 2 6 | jobs: 7 | build: 8 | docker: 9 | # specify the version you desire here 10 | - image: bioinstaller/bioinstaller:latest 11 | 12 | working_directory: /tmp/bioinstaller 13 | 14 | steps: 15 | - checkout 16 | 17 | # run tests! 18 | - run: source /etc/profile && make && Rscript -e "pacman::p_load(covr);codecov()" 19 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # History files 2 | .Rhistory 3 | .Rapp.history 4 | 5 | # Session Data files 6 | .RData 7 | # Example code in package build process 8 | *-Ex.R 9 | # Output files from R CMD build 10 | /*.tar.gz 11 | # Output files from R CMD check 12 | /*.Rcheck/ 13 | # RStudio files 14 | .Rproj.user/ 15 | # produced vignettes 16 | vignettes/*.html 17 | vignettes/*.pdf 18 | # OAuth2 token, see https://github.com/hadley/httr/releases/tag/v0.3 19 | .httr-oauth 20 | # knitr and R markdown default cache directories 21 | /*_cache/ 22 | /cache/ 23 | # Temporary files created by R markdown 24 | *.utf8.md 25 | *.knit.md 26 | inst/extdata/softwares_db_demo.yaml 27 | .Rproj.user 28 | inst/doc 29 | .DS_Store 30 | -------------------------------------------------------------------------------- /BioInstaller.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: No 4 | SaveWorkspace: No 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 2 10 | Encoding: UTF-8 11 | 12 | RnwWeave: Sweave 13 | LaTeX: pdfLaTeX 14 | 15 | AutoAppendNewline: Yes 16 | StripTrailingWhitespace: Yes 17 | 18 | BuildType: Package 19 | PackageUseDevtools: Yes 20 | PackageInstallArgs: --no-multiarch --with-keep.source 21 | PackageCheckArgs: --as-cran 22 | PackageRoxygenize: rd,collate,namespace 23 | -------------------------------------------------------------------------------- /ChangeLog: -------------------------------------------------------------------------------- 1 | 2019-6-19 Li Jianfeng 2 | 3 | * add tryCatch in conda.env.list 4 | 5 | 2019-1-20 Li Jianfeng 6 | 7 | * update HMDB 8 | 9 | 2018-11-20 Li Jianfeng 10 | 11 | * fix "version_avaliable" to "version_available" 12 | 13 | 2018-11-13 Li Jianfeng 14 | 15 | * change samtools and htslib source_url t codeload 16 | * add the second source url of gridss 17 | 18 | 2018-11-11 Li Jianfeng 19 | 20 | * improve the sort method of versions 21 | * remove check_shiny_dep 22 | * use pacman to install the shiny application required packages 23 | * add shiny/deps.R to install the Shiny application dependences 24 | 25 | 2018-10-29 Li Jianfeng 26 | 27 | * support bitbucket repo 28 | * add workflow tools and databases 29 | 30 | 2018-09-23 Li Jianfeng 31 | 32 | * update ANNOVAR dbnsfp versions 33 | 34 | 2018-09-04 Li Jianfeng 35 | 36 | * add fill = TRUE in conda.list read.table 37 | 38 | 2018-08-22 Li Jianfeng 39 | 40 | * add copy_plugins and copy_configs functions in R/web.R 41 | * replace getURL by fromJSON to access the Github APIs 42 | 43 | 2018-08-18 Li Jianfeng 44 | 45 | * add miniconda and spack in docker image 46 | * add table output box in instant spack 47 | 48 | 2018-08-16 Li Jianfeng 49 | 50 | * add pubmed search tool 51 | * add geoquery instant plugin 52 | * improve instant spack and code plugins 53 | 54 | 2018-08-15 Li Jianfeng 55 | 56 | * add datasets2tools plugin 57 | 58 | 2018-08-13 Li Jianfeng 59 | 60 | * add wrapper functions, conda and spack 61 | * add new function new.bioinfo 62 | 63 | 2018-08-03 Li Jianfeng 64 | 65 | * use editor in pipeline 66 | * add instant page 67 | * plugins dir could change 68 | 69 | 2018-08-02 Li Jianfeng 70 | 71 | * Improve the setting function 72 | * Use codemirror editor 73 | 74 | 2018-08-01 Li Jianfeng 75 | 76 | * Add setting UI in Shiny 77 | * rename craw.all.versions to crawl.all.versions 78 | 79 | 2018-07-22 Li Jianfeng 80 | 81 | * Add easy_project plugin in pipeline 82 | * Add files_of_path_monitor plugin in dashbord 83 | 84 | 2018-07-21 Li Jianfeng 85 | 86 | * Initial Shiny application 87 | 88 | 2018-05-04 Li Jianfeng 89 | 90 | * design the BioInstaller logo 91 | * use pkgdown to generate document html site 92 | * update README.md and improve vignettes 93 | 94 | 2018-04-29 Li Jianfeng 95 | 96 | * add picky, freec, oncodriveclust, sequenza, taxmaps, 97 | svaba, rop in github.toml 98 | * add jaffa_reffa in nongithub.toml 99 | 100 | 2018-04-29 Li Jianfeng 101 | 102 | * change db_annovar sql2sqlite parameter names 103 | * add manta and JAFFA in github.toml 104 | * add JAFFA reffa in nongithub.toml 105 | * update vignettes theme using prettydoc 106 | 107 | 2018-03-13 Li Jianfeng 108 | 109 | * add db_annovar_abraom 110 | 111 | 2018-01-20 Li Jianfeng 112 | 113 | * added mutsig in nongithub 114 | 115 | 2018-01-19 Li Jianfeng 116 | 117 | * added db_annovar_docm, db_annovar_intogen, 118 | db_annovar_disgenet, db_annovar_cancer_hotspots in db 119 | * rename db_cancer_hotspot to db_cancer_hotspots 120 | * added RESM, radia in github 121 | * added rMATS, PARADA, IGV, Marina, PARADIGM, Meerkat, 122 | vadir, in nongithub 123 | * source parse_version.R in local env 124 | 125 | 2018-01-10 Li Jianfeng 126 | 127 | * added facets, GIGGLE (genomic search engine) in github 128 | * added absolute, hapseg, atlas2, beagle, contest 129 | in nongithub 130 | 131 | 2018-01-09 Li Jianfeng 132 | 133 | * added olego, chronqc and rHAT 134 | * set.biosoftwares.db(tempfile()) in vignettes/BioInstaller.Rmd 135 | 136 | 2018-01-05 Li Jianfeng 137 | 138 | * fix CRAN warning, demo source_url modified 139 | 140 | 2018-01-03 Li Jianfeng 141 | 142 | * added db_rbp_var, db_docm, db_cancer_hotspot, 143 | db_intogen, db_disgenet, db_cgi 144 | 145 | 2017-12-19 Li Jianfeng 146 | 147 | * fix a bug if set save.to.db to FALSE 148 | 149 | 2017-12-15 Li Jianfeng 150 | 151 | * reduce blank rows in config files 152 | 153 | 2017-12-13 Li Jianfeng 154 | 155 | * update bcl2fastq source_url 156 | * add db_annovar_dbscsnv_sqlite 157 | 158 | 2017-12-12 Li Jianfeng 159 | 160 | * add vcfanno 161 | 162 | 2017-12-06 Li Jianfeng 163 | 164 | * add db_annovar_tall_somatic_genes 165 | * add db_eggnog 166 | 167 | 2017-12-05 Li Jianfeng 168 | 169 | * fix a bug in craw.all.versions 170 | * db_rddpred, db_lncediting and its sqlite version be added 171 | * rename licence to license, add license paramter 172 | 173 | 2017-12-04 Li Jianfeng 174 | 175 | * db_snipa3 be added 176 | * db_annovar_seeqtl be added 177 | * db_annovar_eqtl_egenes be added 178 | 179 | 2017-12-03 Li Jianfeng 180 | 181 | * db_annovar_rediportal_sqlite, db_annovar_gme_sqlite, 182 | db_annovar_hrcr1_sqlite, db_annovar_revel_sqlite, 183 | db_annovar_mcap_sqlite, db_annovar_exac03_sqlite, 184 | db_annovar_gnomad_sqlite, db_annovar_popfreq_sqlite, 185 | db_annovar_gwava_sqlite, db_annovar_eigen_sqlite be added 186 | * db_exsnp, db_rvarbase and db_seeqtl be added 187 | * rename source_is.dir to source_is_dir 188 | * add dir download support for html page (previous only for ftp) 189 | 190 | 2017-12-02 Li Jianfeng 191 | 192 | * db_annovar_loftool_score, db_annovar_rvis_esv_score, 193 | db_annovar_gdi_score and db_annovar_tmcsnpdb be added 194 | 195 | 2017-12-01 Li Jianfeng 196 | 197 | * db_atcircdb, db_circnet, db_circbase, db_circrnadb, 198 | and db_exorbase be added 199 | 200 | 2017-11-30 Li Jianfeng 201 | 202 | * 1285 cases B-ALL RNA-seq variants database be added (resource not 203 | available) 204 | 205 | 2017-11-29 Li Jianfeng 206 | 207 | * db_hgnc and db_annovar_hgnc be added 208 | 209 | 2017-11-27 Li Jianfeng 210 | 211 | * db_annovar_varcards_sqlite be added 212 | 213 | 2017-11-26 Li Jianfeng 214 | 215 | * db_tumorfusions and db_gtex be added 216 | 217 | 2017-11-24 Li Jianfeng 218 | 219 | * db_expression_atlas,db_remap and db_remap2 be added 220 | * db_annovar_epi_genes, db_annovar_cscd be added 221 | * fix undecompressed filetype not move to destdir if set decompress to 222 | TRUE 223 | * interproscan be added 224 | * db_funcoup, db_proteinatlas, db_dgidb, db_drugbank, db_interpro, 225 | db_inbiomap, db_omim, db_biosystems, db_denovo_db and db_hpo be added 226 | 227 | 2017-11-22 Li Jianfeng 228 | 229 | * use configr fetch.config to merge multiple github.cfg and 230 | nongithub.cfg 231 | 232 | 2017-11-21 Li Jianfeng 233 | 234 | * db_ecodrug, db_medreaders, db_superdrug2, db_varcards be added 235 | * db_civic be added (only nightly) 236 | 237 | 2017-11-08 Li Jianfeng 238 | 239 | * fix a bug in R/utils_function.R drop_redundance_dir 240 | * db_msdd, db_mndr be added in db/db_main.toml 241 | 242 | 2017-11-07 Li Jianfeng 243 | 244 | * use_git_versions can be used in nongithub.toml to use github 245 | release versions 246 | * gridss, db_pancanqtl, db_seecancer and db_diseaseenhancer be supported 247 | * fix cfg_dir and prefix_url in inst/config/ meta files 248 | * JhuangLab provide ANNOVAR database sqlite files in db_annovar.toml 249 | * update avsnp150 and clinvar_20170905 be added in db_annovar.toml 250 | 251 | 2017-11-03 Li Jianfeng 252 | 253 | * big change on path of toml files 254 | * move files from inst/extdata to inst/extdata/config, demo, scripts 255 | 256 | 2017-11-02 Li Jianfeng 257 | 258 | * inst/extdata/web/web_meta.toml be added 259 | * Function get.meta.files and get.meta be added in 260 | R/meta.R 261 | * Makefile be added 262 | * blast be supported 263 | 264 | 2017-11-01 Li Jianfeng 265 | 266 | * URLencode be used 267 | * filenames in inst/extdata/databases changed, ANNOVAR.toml => db_annovar.toml, blast.toml => 268 | db_blast.toml, meta.toml => db_meta.toml, main.toml => db_main.toml 269 | * prefix of database rename to db_.*, e.g. raw_ucsc_refseq => 270 | db_ucsc_refseq in inst/extdata/databases/db_annovar.toml 271 | * inst/extdata/databases/CSCD.toml merged with db_main.toml 272 | * sRNAnalyzer, db_sRNAnalyzer, db_differentialnet be supported 273 | in db_main.toml 274 | 275 | 2017-10-31 Li Jianfeng 276 | 277 | * aRNApipe, trim_galore, multiqc, ngs_qc_toolkit be supported 278 | 279 | 2017-10-12 Li Jianfeng 280 | 281 | * CSCD database be supported 282 | (/inst/extdata/databases/cscd.toml) 283 | 284 | 2017-10-09 Li Jianfeng 285 | 286 | * strelka be added 287 | * mm9/mm10 be added in ucsc_reffa 288 | * fix samtools-1.6 fail 289 | 290 | 2017-09-18 Li Jianfeng 291 | 292 | * fix invalid test link 293 | * ANNOVAR databases can be download use 294 | inst/extdata/databases/ANNOVAR.toml 295 | * Move databases toml file to inst/extdata/databases/ 296 | * DRAT and fastq-tools be added 297 | 298 | 2017-07-24 Li Jianfeng 299 | 300 | * picard/mutect be added in inst/extdata/docker.toml 301 | 302 | 2017-07-24 Li Jianfeng 303 | 304 | * craw.all.versions be add in R/craw.R 305 | * local.source be supported 306 | 307 | 2017-07-22 Li Jianfeng 308 | 309 | * docker.pull and docker.search be added in R/docker.R 310 | * miniconda be supported 311 | 312 | 2017-06-25 Li Jianfeng 313 | 314 | * oncotator be supported 315 | * VEP be supported 316 | * `decompress` in configuration file be processed by as.logical 317 | 318 | 2017-06-24 Li Jianfeng 319 | 320 | * Fix windows install status 321 | * 'Meta Infmation of Softwares and Databases' project initial 322 | 323 | 2017-06-23 Li Jianfeng 324 | 325 | * Cancel windows install step (Download still work) 326 | 327 | 2017-06-22 Li Jianfeng 328 | 329 | * Use v0.3.0 configr: glue parse be supported 330 | * inst/extdata/nongithub_databases_blast.toml be added 331 | * inst/extdata/nongithub_databases_meta.toml be added 332 | 333 | 2017-06-09 Li Jianfeng 334 | 335 | * Reduce the redundant step of extra files copy 336 | 337 | 2017-06-08 Li Jianfeng 338 | 339 | * multiple line of #R# CMD can be parsed 340 | 341 | 2017-06-07 Li Jianfeng 342 | 343 | * sleuth be supported (Differential analysis of RNA-Seq data) 344 | * add no.need.download option in github.toml to control no download 345 | from github url (e.g. use devtools to install) 346 | 347 | 2017-06-07 Li Jianfeng 348 | 349 | * #R# RCMD #R# can be run in configuration file 350 | 351 | 2017-06-03 Li Jianfeng 352 | 353 | * extra.list, rcmd.parse and bash.parse, save.to.db parameters be added in 354 | R/install.R install.bioinfo, install.github, install.nongithub 355 | * show.all.versions be improved 356 | 357 | 2017-06-01 Li Jianfeng 358 | 359 | * Non-Github softwares versions can be parsed from cfg or a parse function 360 | * version_newest_fixed can be added 361 | 362 | 2017-05-24 Li Jianfeng 363 | 364 | * Github softwares fetching versions by github API 365 | 366 | 2017-05-19 Li Jianfeng 367 | 368 | * Unittest be added 369 | * verbose default set TRUE, and log infomation be improved 370 | 371 | 2017-05-09 Li Jianfeng 372 | 373 | * Use environment variable BIO_DEPENDENCE_DIR to set the download.dir and 374 | destdir of dependence softwares 375 | 376 | 2017-05-07 Li Jianfeng 377 | 378 | * pcre URL FTP => HTTPS 379 | * Update R-3.4.0 install and download 380 | 381 | 2017-05-04 Li Jianfeng 382 | 383 | * dependence.need parameters be added 384 | 385 | 2017-05-03 Li Jianfeng 386 | 387 | * download.dir be supported 388 | * install.dir be saved in softwares info configuration file 389 | 390 | 2017-04-30 Li Jianfeng 391 | 392 | * cnvkit be supported 393 | * eval.config.groups replaced by eval.config.sections 394 | 395 | 2017-04-27 Li Jianfeng 396 | 397 | * bwa@0.7.2a => name.saved="bwa_0.7.2a" 398 | * ROOT/cnvnator/svtoolkit be supported download 399 | 400 | 2017-04-24 Li Jianfeng 401 | 402 | * Update FastQC URL 403 | * Update Version newest 404 | * Change dependece install dir in the {{destdir}}/dependence/some_dependence 405 | * Add "softwares_version" format name recognition, eg. bwa@0.7.2a, 406 | name.saved="bwa@0.7.2a", version=0.7.2a 407 | * Release 0.1.0 408 | 409 | 2017-04-11 Li Jianfeng 410 | 411 | * bcl2fastq2 be supported 412 | 413 | 2017-04-09 Li Jianfeng 414 | 415 | * samstat, PRINSEQ, SolexaQA, fastx_toolkit be supported 416 | 417 | 2017-03-19 Li Jianfeng 418 | 419 | * GATK, Mutect, SSAHA2, NovoAlign be supported 420 | -------------------------------------------------------------------------------- /DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: BioInstaller 2 | Title: Integrator of Bioinformatics Resources 3 | Version: 0.4.0-1 4 | Authors@R: person("Jianfeng", "Li", email = "lee_jianfeng@sjtu.edu.cn", role = c("aut", "cre"), comment = c(ORCID = "0000-0003-2349-208X")) 5 | Maintainer: Jianfeng Li 6 | Description: 7 | Can be used to integrate massive bioinformatics resources, such as tool/script and database. It provides the R functions and Shiny web application. Hundreds of bioinformatics tool/script and database have been included. 8 | Depends: 9 | R (>= 3.3.0) 10 | URL: https://github.com/JhuangLab/BioInstaller 11 | BugReports: https://github.com/JhuangLab/BioInstaller/issues 12 | License: MIT + file LICENSE 13 | Encoding: UTF-8 14 | LazyData: true 15 | Imports: 16 | stringr (>= 1.2.0), 17 | futile.logger (>= 1.4.1), 18 | configr (>= 0.3.3), 19 | jsonlite, 20 | git2r (>= 0.0.3), 21 | R.utils (>= 2.5.0), 22 | RCurl (>= 1.95-4.8), 23 | rvest (>= 0.3.2), 24 | devtools (>= 1.13.2), 25 | stringi (>= 1.1.5), 26 | liteq 27 | RoxygenNote: 6.1.1 28 | Suggests: knitr, 29 | rmarkdown, 30 | testthat, 31 | prettydoc, 32 | DT 33 | VignetteBuilder: knitr 34 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM bioinstaller/opencpu:latest 2 | 3 | ## This handle reaches Jianfeng 4 | MAINTAINER "Jianfeng Li" lee_jianfeng@life2cloud.com 5 | 6 | ADD . /tmp/BioInstaller 7 | 8 | ADD https://raw.githubusercontent.com/JhuangLab/annovarR/master/inst/docker/shiny-server.conf /etc/shiny-server/shiny-server.conf 9 | ADD https://raw.githubusercontent.com/JhuangLab/annovarR/master/inst/docker/shiny-apache.conf /etc/apache2/sites-enabled/000-default.conf 10 | 11 | Run apt update && apt install -y lmodern openssl tcl environment-modules qpdf \ 12 | && Rscript -e "install.packages('prettydoc')" \ 13 | && Rscript -e "devtools::install('/tmp/BioInstaller')" \ 14 | && Rscript -e "devtools::install_github('openbiox/bioshiny/src/bioshiny')" \ 15 | && ln -s /usr/local/lib/R/site-library/bioshiny/extdata/shiny /srv/shiny-server/bioshiny \ 16 | && mkdir /home/opencpu/.bioshiny \ 17 | && chown -R opencpu /home/opencpu/.bioshiny \ 18 | && runuser -s /bin/bash -l opencpu -c "Rscript -e 'bioshiny::copy_configs()'" \ 19 | && chown -R opencpu /etc/shiny-server/shiny-server.conf \ 20 | && chmod a+r /etc/apache2/sites-enabled/000-default.conf \ 21 | && echo 'LC_ALL="en_US.UTF-8"\nLANG="en_US.UTF-8"' >> /etc/R/Renviron \ 22 | && Rscript -e "source(system.file('extdata', 'shiny/deps.R', package = 'bioshiny'))" \ 23 | && runuser -s /bin/bash -l opencpu -c "export BIO_SOFTWARES_DB_ACTIVE=/home/opencpu/.bioshiny/info.yaml" \ 24 | && export BIO_SOFTWARES_DB_ACTIVE="/home/opencpu/.bioshiny/info.yaml" \ 25 | && export BIOSHINY_CONFIG="/home/opencpu/.bioshiny/shiny.config.yaml" \ 26 | && echo 'source /usr/share/modules/init/bash\n' >> /etc/profile \ 27 | && echo 'export BIO_SOFTWARES_DB_ACTIVE="/home/opencpu/.bioshiny/info.yaml"\n' >> /home/opencpu/.bashrc \ 28 | && echo 'BIOSHINY_CONFIG="/home/opencpu/.bioshiny/shiny.config.yaml"\n' >> /home/opencpu/.Renviron \ 29 | && echo 'export BIO_SOFTWARES_DB_ACTIVE="/home/opencpu/.bioshiny/info.yaml"\n' >> /home/opencpu/.bashrc \ 30 | && echo 'BIOSHINY_CONFIG="/home/opencpu/.bioshiny/shiny.config.yaml"\n' >> /home/opencpu/.Renviron \ 31 | && runuser -s /bin/bash -l opencpu -c "export AUTO_CREATE_BIOSHINY_DIR=TRUE" \ 32 | && chown -R opencpu /home/opencpu/ \ 33 | && chown -R opencpu /usr/local/lib/R/site-library \ 34 | && chown -R opencpu /usr/lib/R/library \ 35 | && echo 'file=`ls /usr/local/lib/R/site-library/`; cd /usr/lib/R/library; for i in ${file}; do rm -rf ${i};done' >> /tmp/rm_script \ 36 | && sh /tmp/rm_script \ 37 | && ln -sf /usr/local/lib/R/site-library/* /usr/lib/R/library/ \ 38 | && rm /tmp/rm_script \ 39 | && rm -rf /tmo/BioInstaller \ 40 | && rm -rf /var/lib/apt/lists/* \ 41 | && rm -rf /tmp/downloaded_packages/ /tmp/*.rds 42 | 43 | Run runuser -s /bin/bash -l opencpu -c "Rscript -e \"BioInstaller::install.bioinfo('miniconda2', destdir = '/home/opencpu/opt/')\"" \ 44 | && rm /home/opencpu/opt/*.sh \ 45 | && runuser -s /bin/bash -l opencpu -c "Rscript -e \"BioInstaller::install.bioinfo('spack', version = 'master', destdir = '/home/opencpu/opt/spack')\"" 46 | 47 | Run echo 'source /etc/profile' >> /home/opencpu/.bashrc \ 48 | && echo 'source /etc/profile' >> /root/.bashrc \ 49 | && echo 'export SPACK_ROOT=/home/opencpu/opt/spack;source $SPACK_ROOT/share/spack/setup-env.sh;' >> /etc/profile \ 50 | && echo 'export PATH=/home/opencpu/opt/miniconda2/bin:$PATH\n' >> /etc/profile \ 51 | && echo "options('repos' = c(CRAN='https://mirrors.tuna.tsinghua.edu.cn/CRAN/'))" >> /home/opencpu/.Rprofile \ 52 | && echo "options(BioC_mirror='https://mirrors.tuna.tsinghua.edu.cn/bioconductor')" >> /home/opencpu/.Rprofile \ 53 | && echo "options('repos' = c(CRAN='https://mirrors.tuna.tsinghua.edu.cn/CRAN/'))" >> /root/.Rprofile \ 54 | && echo "options(BioC_mirror='https://mirrors.tuna.tsinghua.edu.cn/bioconductor')" >> /root/.Rprofile 55 | 56 | CMD service cron start && runuser -s /bin/bash -l opencpu -c '. ~/.bashrc; export AUTO_CREATE_BIOSHINY_DIR="TRUE";Rscript -e "bioshiny::set_shiny_workers(3, auto_create = TRUE)" &' && runuser -s /bin/bash -l opencpu -c '. ~/.bashrc; sh /usr/bin/start_shiny_server' && . /etc/profile; /usr/lib/rstudio-server/bin/rserver && apachectl -DFOREGROUND 57 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | YEAR: 2017 2 | COPYRIGHT HOLDER: Li Jianfeng 3 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | PKGNAME := $(shell sed -n "s/Package: *\([^ ]*\)/\1/p" DESCRIPTION) 2 | PKGVERS := $(shell sed -n "s/Version: *\([^ ]*\)/\1/p" DESCRIPTION) 3 | PKGSRC := $(shell basename `pwd`) 4 | DOWNLOAD_DIR := "/tmp/test_BioInstaller" 5 | DEST_DIR := "/tmp/test_src" 6 | 7 | all: doc build check_cran 8 | 9 | doc: 10 | Rscript -e "devtools::document()" 11 | 12 | build: 13 | cd ..;\ 14 | R CMD build $(PKGSRC) 15 | 16 | build2: 17 | cd ..;\ 18 | R CMD build --no-build-vignettes $(PKGSRC) 19 | 20 | install: 21 | cd ..;\ 22 | R CMD INSTALL $(PKGNAME)_$(PKGVERS).tar.gz 23 | 24 | check: build 25 | cd ..;\ 26 | R CMD check $(PKGNAME)_$(PKGVERS).tar.gz 27 | 28 | check_cran: build 29 | cd ..;\ 30 | R CMD check --as-cran $(PKGNAME)_$(PKGVERS).tar.gz 31 | 32 | clean: 33 | cd ..;\ 34 | $(RM) -r $(PKGNAME).Rcheck/;\ 35 | 36 | cleanall: 37 | cd ..;\ 38 | $(RM) -r $(PKGNAME).Rcheck/;\ 39 | $(RM) -ri $(DOWNLOAD_DIR);\ 40 | $(RM) -ri $(DEST_DIR) 41 | 42 | show_names: 43 | cd .;\ 44 | Rscript -e "cat(BioInstaller::install.bioinfo(show.all.names=T), sep = '\n')" 45 | 46 | show_db_names: 47 | cd .;\ 48 | Rscript -e "cat(BioInstaller::install.bioinfo(nongithub='./inst/extdata/databases/db_main.toml', \ 49 | show.all.names=T), sep = '\n')" 50 | 51 | show_meta: 52 | cd .;\ 53 | Rscript -e "BioInstaller::get.meta()" 54 | 55 | show_versions: 56 | @echo "name:$(name)" 57 | cd .;\ 58 | Rscript -e "BioInstaller::install.bioinfo(name='$(name)',show.all.versions = TRUE)"; 59 | 60 | test: 61 | cd .;\ 62 | Rscript -e "devtools::test(reporter = 'summary')" 63 | 64 | test2: 65 | @echo "name:$(name), version:$(version)" 66 | cd .;\ 67 | Rscript -e "BioInstaller::install.bioinfo(name='$(name)', download.dir=sprintf('$(DOWNLOAD_DIR)/%s/%s', basename(tempdir()), '$(name)'), dest.dir='$(DEST_DIR)', version='$(version)')"; 68 | 69 | test3: 70 | @echo "name:$(name), version:$(version)" 71 | cd .;\ 72 | Rscript -e "BioInstaller::install.bioinfo(name='$(name)', download.dir=sprintf('$(DOWNLOAD_DIR)/%s/%s', basename(tempdir()), '$(name)'), dest.dir='$(DEST_DIR)', version='$(version)', nongithub.cfg = './inst/extdata/config/db/db_main.toml')"; 73 | 74 | format: 75 | cd .;\ 76 | Rscript -e "library(formatR);options('formatR.indent'=2);tidy_dir('./R');tidy_dir('./BioInstaller/inst/extdata/')" 77 | -------------------------------------------------------------------------------- /NAMESPACE: -------------------------------------------------------------------------------- 1 | # Generated by roxygen2: do not edit by hand 2 | 3 | export(change.info) 4 | export(conda) 5 | export(conda.env.create) 6 | export(conda.env.list) 7 | export(conda.list) 8 | export(crawl.all.versions) 9 | export(del.info) 10 | export(docker.pull) 11 | export(docker.search) 12 | export(get.info) 13 | export(get.meta) 14 | export(get.meta.files) 15 | export(install.bioinfo) 16 | export(install.github) 17 | export(install.nongithub) 18 | export(is.biosoftwares.db.active) 19 | export(new.bioinfo) 20 | export(set.biosoftwares.db) 21 | export(show.installed) 22 | export(spack) 23 | export(spack.list) 24 | import(configr) 25 | import(futile.logger) 26 | import(liteq) 27 | import(rvest) 28 | import(stringr) 29 | importFrom(R.utils,gunzip) 30 | importFrom(R.utils,gzip) 31 | importFrom(RCurl,basicTextGatherer) 32 | importFrom(RCurl,getURL) 33 | importFrom(devtools,install_github) 34 | importFrom(devtools,install_url) 35 | importFrom(git2r,checkout) 36 | importFrom(git2r,clone) 37 | importFrom(jsonlite,fromJSON) 38 | importFrom(stringi,stri_rand_strings) 39 | importFrom(utils,URLencode) 40 | importFrom(utils,compareVersion) 41 | importFrom(utils,download.file) 42 | importFrom(utils,install.packages) 43 | importFrom(utils,installed.packages) 44 | importFrom(utils,read.table) 45 | importFrom(utils,untar) 46 | importFrom(utils,unzip) 47 | -------------------------------------------------------------------------------- /NEWS.md: -------------------------------------------------------------------------------- 1 | # BioInstaller 0.3.7 2 | 3 | ## New features 4 | 5 | * support bitbucket repo 6 | * remove function "check_shiny_dep" use pacman install dependences 7 | * add new databases and tools (meta and files) 8 | 9 | ## Minor bugs fixed 10 | 11 | * fix "version\_avaliable" to "version\_available" in ~10 item 12 | 13 | # BioInstaller 0.3.6 14 | 15 | ## New features 16 | 17 | * add copy\_plugins and copy\_configs functions to restore 18 | the plugins and config 19 | * use fromJSON to access the github APIs, 20 | which can avoid the SSL problem on windows platform 21 | 22 | # BioInstaller 0.3.5.7000 23 | 24 | ## Minor bugs fixed 25 | 26 | * Add conda and spack in the Docker image 27 | 28 | # BioInstaller 0.3.5.6000 29 | 30 | ## New features 31 | 32 | * Shiny application supported 33 | 34 | * Numbers increased of included items, especialy the databases 35 | 36 | * Use github [forum](https://github.com/JhuangLab/BioInstaller/issues) 37 | 38 | * Add parameter `overwrite` in `install.bioinfo` 39 | 40 | * Add Opencpu, Shiny and Rstudio service in Docker container 41 | 42 | * Use 'Setting' module in Shiny application to manage the variables 43 | 44 | ## Minor bugs fixed 45 | 46 | * Check and confirm delete the existing dir only when clone a github project 47 | 48 | # BioInstaller 0.3.3 49 | 50 | ## New features 51 | 52 | * Multiple resources file be supported 53 | 54 | * Adjust and set db, github, nongithub, web and docker in inst/extdata/config 55 | 56 | * Meta information of software and database be added in newly supported items 57 | 58 | * Decompress can be auto-recognized 59 | 60 | * Docker supported 61 | 62 | 63 | ## Minor bugs fixed 64 | 65 | * change.info default is to write tempfile() now 66 | 67 | * Fixed a bug when set save.to.db to FALSE. It can raise installed fail 68 | 69 | # BioInstaller 0.2.1 70 | 71 | ## New features 72 | 73 | * ANNOVAR databases can be download using inst/extdata/databases/ANNOVAR.toml 74 | 75 | * Move databases toml file to inst/extdata/databases/ 76 | 77 | * `local.source` be supported (Don't need download the source code again when it were download already) 78 | 79 | * Function `docker.pull` and `docker.search` be added to download and search docker repo 80 | 81 | * Function `craw.all.versions` be added to crawl source code of all version (Sotwares or databases) 82 | 83 | # BioInstaller 0.1.2 84 | 85 | ## New features 86 | 87 | * #R# CMD #R# marked the R CMD need to be runed 88 | 89 | * glue parse be supported 90 | 91 | * Softwares versions of github.cfg be fetched from github API 92 | 93 | * destdir and download.dir can be setted respectively 94 | 95 | * `verbose` default is TRUE, show log infomation 96 | 97 | ## Minor bugs fixed 98 | 99 | * Fix `unlink()` clean tests files fail on windows (force = TRUE) 100 | -------------------------------------------------------------------------------- /R/BioInstaller.R: -------------------------------------------------------------------------------- 1 | #' This package is a new platform to construct interactive and reproducible biological 2 | #' data analysis applications based on R language, which includes the R functions and R 3 | #' Shiny application, REST APIs. 4 | #' 5 | #' @author 6 | #' Li Jianfeng \url{lee_jianfeng@sjtu.edu.cn} 7 | #' @seealso 8 | #' Useful links: 9 | #' 10 | #' \url{https://github.com/JhuangLab/BioInstaller} 11 | #' 12 | #' Report bugs at \url{https://github.com/JhuangLab/BioInstaller/issues} 13 | #' 14 | #' @docType package 15 | #' @name BioInstaller 16 | #' @import configr stringr futile.logger rvest liteq 17 | #' @importFrom jsonlite fromJSON 18 | #' @importFrom git2r clone checkout 19 | #' @importFrom stringi stri_rand_strings 20 | #' @importFrom RCurl getURL basicTextGatherer 21 | #' @importFrom R.utils gunzip gzip 22 | #' @importFrom utils unzip untar download.file URLencode read.table 23 | #' @importFrom utils compareVersion install.packages installed.packages 24 | #' @importFrom devtools install_github install_url 25 | NULL 26 | -------------------------------------------------------------------------------- /R/active.R: -------------------------------------------------------------------------------- 1 | #' Test active configuration file 2 | #' 3 | #' Check whether a Bio Softwares DB is active 4 | #' 5 | #' @param biosoftwares.db Configuration filename of bio-softwares db 6 | #' @return 7 | #' Logical indicating whether the specified configuration file is active 8 | #' 9 | #' @examples 10 | #' is.biosoftwares.db.active('config.cfg') 11 | #' @export 12 | is.biosoftwares.db.active <- function(biosoftwares.db) { 13 | biosoftwares.db <- normalizePath(biosoftwares.db, "/", mustWork = FALSE) 14 | default <- system.file("extdata", "demo/softwares_db_demo.yaml", package = "BioInstaller") 15 | default <- normalizePath(default, "/", mustWork = FALSE) 16 | identical(biosoftwares.db, Sys.getenv("BIO_SOFTWARES_DB_ACTIVE", default)) 17 | } 18 | 19 | #' Set BIO_SOFWARES_DB_ACTIVE as the BioInstaller db 20 | #' 21 | #' @param biosoftwares.db Configuration filename of bio-softwares db 22 | #' @return 23 | #' Logical indicate wheather set db successful 24 | #' @examples 25 | #' set.biosoftwares.db(sprintf('%s/.BioInstaller', tempdir())) 26 | #' @export 27 | set.biosoftwares.db <- function(biosoftwares.db) { 28 | biosoftwares.db <- normalizePath(biosoftwares.db, "/", mustWork = FALSE) 29 | if (!dir.exists(dirname(biosoftwares.db))) { 30 | dir.create(dirname(biosoftwares.db), recursive = TRUE) 31 | } 32 | if (!file.exists(biosoftwares.db)) { 33 | file.create(biosoftwares.db) 34 | } 35 | Sys.setenv(BIO_SOFTWARES_DB_ACTIVE = biosoftwares.db) 36 | } 37 | -------------------------------------------------------------------------------- /R/conda.R: -------------------------------------------------------------------------------- 1 | #' Wrapper function of conda 2 | #' 3 | #' @param suffix_params Command line parameters of conda 4 | #' @param prefix_params Command line parameters of conda 5 | #' @param conda Default is Sys.which('conda') 6 | #' @param ... Parameters pass to 'system' 7 | #' @export 8 | #' 9 | #' @examples 10 | #' \dontrun{ 11 | #' conda() 12 | #' } 13 | conda <- function(suffix_params = "", prefix_params = "", conda = Sys.which("conda"), 14 | ...) { 15 | conda <- unname(conda) 16 | if (conda == "") { 17 | warning("Executable 'conda' Not Found.") 18 | return(FALSE) 19 | } 20 | objs <- system(sprintf("%s%s %s", prefix_params, conda, suffix_params), intern = TRUE, 21 | ...) 22 | x <- paste0(objs, collapse = "\n") 23 | return(x) 24 | } 25 | 26 | #' Wrapper function of 'conda list', list linked packages in a conda environment. 27 | #' 28 | #' @param env_name Name of environment, default is current 29 | #' @param ... Parameters pass to \code{\link{conda}} 30 | #' @export 31 | #' 32 | #' @examples 33 | #' \dontrun{ 34 | #' conda.list() 35 | #' conda.list(env_name = 'your_env') 36 | #' } 37 | conda.list <- function(env_name = "base", ...) { 38 | if (!is.null(env_name) && env_name != "") 39 | objs <- conda("list", prefix_params = sprintf("source activate %s;", env_name), 40 | ...) 41 | if (is.null(env_name) || env_name == "") 42 | objs <- conda("list", ...) 43 | if (is.logical(objs) && !objs) { 44 | return(FALSE) 45 | } 46 | text <- paste0(objs, collapse = "\n") 47 | x <- tryCatch(read.table(text = text, fill = TRUE), error = function(e) { 48 | data.frame() 49 | }) 50 | if (nrow(x) == 0) 51 | return(x) 52 | colnames(x)[1:3] <- c("Name", "Version", "Build") 53 | if (ncol(x) == 4) 54 | colnames(x)[4] <- "Channel" 55 | return(x) 56 | } 57 | 58 | #' Wrapper function of 'conda env list', list the Conda environments 59 | #' 60 | #' @param ... Parameters pass to \code{\link{conda}} 61 | #' @export 62 | #' 63 | #' @examples 64 | #' \dontrun{ 65 | #' conda.env.list() 66 | #' } 67 | conda.env.list <- function(...) { 68 | objs <- conda("env list", ...) 69 | if (is.logical(objs) && !objs) { 70 | return(FALSE) 71 | } 72 | text <- paste0(objs, collapse = "\n") 73 | x <- tryCatch(read.table(text = str_replace(text, " [*] ", ""), skip = 2), error=function(e) { 74 | read.table(text = str_replace(text, " [*] ", ""), skip = 2, fill = TRUE, 75 | colClasses = c('character', 'character'), header = F) 76 | }) 77 | colnames(x) <- c("env_name", "env_path") 78 | return(x) 79 | } 80 | 81 | #' Wrapper function of 'conda env create', create an environment based on an environment file 82 | #' 83 | #' @param env_name Name of environment 84 | #' @param env_file Environment definition file (default: environment.yml) 85 | #' @param env_path Full path to environment prefix 86 | #' @param params Extra command line parameters of conda 87 | #' @param ... Parameters pass to \code{\link{conda}} 88 | #' @export 89 | #' 90 | #' @examples 91 | #' \dontrun{ 92 | #' conda.env.create(params = 'vader/deathstar') 93 | #' conda.env.create(env_name = 'name') 94 | #' conda.env.create(env_file = '/path/to/environment.yml') 95 | #' conda.env.create(env_name = 'deathstar', 96 | #' env_file = '/path/to/requirements.txt') 97 | #' conda.env.create(env_file = '/path/to/requirements.txt', 98 | #' env_path = '/home/user/software/deathstar') 99 | #' } 100 | conda.env.create <- function(env_name = "", env_file = "", env_path = "", params = "", 101 | ...) { 102 | if (env_name != "") 103 | env_name <- paste0("-n ", env_name, " ") 104 | if (env_file != "") 105 | env_file <- paste0("-f=", env_file, " ") 106 | if (env_path != "") 107 | env_path <- paste0("-p ", env_path, " ") 108 | conda(sprintf("env create %s%s%s%s", env_name, env_file, env_path, params), ...) 109 | } 110 | -------------------------------------------------------------------------------- /R/config.R: -------------------------------------------------------------------------------- 1 | #' Create new BioInstaller items to github forum 2 | #' @param config.file github.toml, nongithub.toml, db_annovar.toml, db_main.toml, or new 3 | #' @param title Name of new item 4 | #' @param description Description of new item 5 | #' @param publication Publication of new item 6 | #' @export 7 | #' @examples 8 | #' new.bioinfo('db_main.toml', 'test_item', 'Just is a test item', 'NA') 9 | new.bioinfo <- function(config.file = "github.toml", title = "", description = "", 10 | publication = "") { 11 | text <- sprintf("**Configuration file**:%s\n**title**:%s\n**description**:%s\n**publication**:%s\n", 12 | config.file, title, description, publication) 13 | cat(text) 14 | } 15 | -------------------------------------------------------------------------------- /R/crawl.R: -------------------------------------------------------------------------------- 1 | #' A function can be used to craw all source code from nongithub.cfg stored information 2 | #' @param name Software name 3 | #' @param download.dir Download destdir 4 | #' @param nongithub.cfg Configuration file of installed by non github url, 5 | #' default is system.file('extdata', 'config/nongithub/nongithub.toml', package='BioInstaller') 6 | #' @param parse.extra.params Other parameters pass to \code{\link[configr]{parse.extra}} 7 | #' @param license The BioInstaller download license code. 8 | #' @export 9 | #' @examples 10 | #' crawl.all.versions('demo') 11 | crawl.all.versions <- function(name, download.dir = "./", nongithub.cfg = c(system.file("extdata", 12 | "config/nongithub/nongithub.toml", package = "BioInstaller"), system.file("extdata", 13 | "config/db/db_main.toml", package = "BioInstaller"), system.file("extdata", "config/db/db_annovar.toml", 14 | package = "BioInstaller"), system.file("extdata", "config/db/db_blast.toml", 15 | package = "BioInstaller")), parse.extra.params = list(extra.list = list(), rcmd.parse = TRUE, 16 | bash.parse = TRUE, glue.parse = TRUE), license = "") { 17 | 18 | name <- tolower(name) 19 | versions <- install.bioinfo(name, show.all.versions = TRUE) 20 | if (!dir.exists(download.dir)) { 21 | dir.create(download.dir, recursive = TRUE) 22 | } 23 | parse.extra.params$extra.list <- config.list.merge(parse.extra.params$extra.list, 24 | list(license = license)) 25 | for (i in versions) { 26 | config <- fetch.config(nongithub.cfg)[[name]] 27 | parse.extra.params <- config.list.merge(parse.extra.params, list(config = config)) 28 | parse.extra.params$extra.list$version = i 29 | config <- do.call(configr::parse.extra, parse.extra.params) 30 | urls <- config$source_url 31 | if (is.download.all.urls(config$url_all_download)) { 32 | urls <- lapply(urls, function(x) return(x[1])) 33 | } 34 | urls <- unlist(urls) 35 | for (j in urls) { 36 | dest.name = basename(j) 37 | if (!file.exists(dest.name) || file.size(dest.name) == 0) { 38 | tryCatch({ 39 | fn <- sprintf("%s/%s", download.dir, dest.name) 40 | download.file(j, fn) 41 | }, error = function(e) { 42 | }, warning = function(w) { 43 | if (file.size(fn) == 0) { 44 | file.remove(fn) 45 | } 46 | }) 47 | } 48 | } 49 | } 50 | } 51 | 52 | is.download.all.urls <- function(url_all_download) { 53 | !is.null(url_all_download) && url_all_download == FALSE 54 | } 55 | -------------------------------------------------------------------------------- /R/docker.R: -------------------------------------------------------------------------------- 1 | #' Search softwares docker infomation in BioInstaller docker database 2 | #' 3 | #' @param name Software name, e.g bwa 4 | #' @param docker.db A list including docker repo infomation, 5 | #' default to use built-in config/docker/docker.toml 6 | #' @export 7 | #' @return A list 8 | #' @examples 9 | #' docker.search('bwa') 10 | docker.search <- function(name, docker.db = system.file("extdata", "config/docker/docker.toml", 11 | package = "BioInstaller")) { 12 | docker.db.dat <- configr::read.config(file = docker.db) 13 | docker.db.dat.names <- names(docker.db.dat) 14 | candidates <- docker.db.dat.names[str_detect(docker.db.dat.names, name)] 15 | return(docker.db.dat[candidates]) 16 | } 17 | 18 | 19 | #' Use docker to pull image 20 | #' 21 | #' @param repo, Repository name of docker hub, e.g life2cloud 22 | #' @param name Software name, e.g bwa 23 | #' @param version Image version 24 | #' @param all.tags Download all tagged images in the repository 25 | #' @param disable.content.trust Skip image verification (default true) 26 | #' @param docker.bin Docker executable file, default is 'docker' in $PATH 27 | #' @param verbose Ligical indicating wheather show the log message 28 | #' @export 29 | #' @return Bool Value 30 | #' @examples 31 | #' docker.bin <- unname(Sys.which('docker')) 32 | #' if (docker.bin != '') { 33 | #' docker.pull(repo = 'learn', name = 'tutorial') 34 | #' } 35 | docker.pull <- function(repo, name, version = NULL, docker.bin = NULL, all.tags = FALSE, 36 | disable.content.trust = TRUE, verbose = TRUE) { 37 | if (is.null(docker.bin)) { 38 | docker.bin <- unname(Sys.which("docker")) 39 | if (docker.bin == "") { 40 | stop("Docker executable file were not be specified.") 41 | } 42 | } 43 | if (!is.null(version)) { 44 | image <- sprintf("%s/%s", repo, name) 45 | msg <- sprintf("Now start to pull docker image %s.", image) 46 | info.msg(msg, verbose = verbose) 47 | cmd <- sprintf("%s pull %s", docker.bin, image) 48 | } else { 49 | image <- sprintf("%s/%s:%s", repo, name, version) 50 | msg <- sprintf("Now start to pull docker image %s.", image) 51 | info.msg(msg, verbose = verbose) 52 | cmd <- sprintf("%s pull %s", docker.bin, image) 53 | } 54 | if (all.tags) { 55 | cmd <- str_replace(cmd, " pull ", " -a pull ") 56 | } 57 | if (!disable.content.trust) { 58 | cmd <- str_replace(cmd, " pull ", " --disable-content-trust pull ") 59 | } 60 | for_runcmd(cmd, verbose = verbose) 61 | } 62 | -------------------------------------------------------------------------------- /R/info.R: -------------------------------------------------------------------------------- 1 | #' Update biologly softwares infomation of system 2 | #' 3 | #' @param name Software name 4 | #' @param installed Wheather be installed successful in system 5 | #' @param source.dir Directorie of softwares source code 6 | #' @param bin.dir Directorie of softwares bin 7 | #' @param executable.files Executable files in bin.dir 8 | #' @param db File saving softwares infomation 9 | #' @param ... Other key and value paired need be saved in BioInstaller 10 | #' @param verbose Ligical indicating wheather show the log message 11 | #' @export 12 | #' @return Bool Value 13 | #' @examples 14 | #' db <- sprintf('%s/.BioInstaller', tempdir()) 15 | #' set.biosoftwares.db(db) 16 | #' change.info(name = 'demo', installed = 'yes', source.dir = '', 17 | #' bin.dir = '', excutable.files = c('demo'), others.customer = 'demo') 18 | #' unlink(db) 19 | change.info <- function(name = "", installed = TRUE, source.dir = "", bin.dir = "", 20 | executable.files = "", db = Sys.getenv("BIO_SOFTWARES_DB_ACTIVE", tempfile()), 21 | ..., verbose = TRUE) { 22 | msg <- sprintf("Running change.info for %s and be saved to %s", name, db) 23 | info.msg(msg, verbose = verbose) 24 | source.dir <- normalizePath(source.dir, mustWork = F) 25 | bin.dir <- normalizePath(bin.dir, mustWork = F) 26 | db <- normalizePath(db, mustWork = F) 27 | if (!db.check(db)) { 28 | return(FALSE) 29 | } 30 | config.cfg <- db 31 | if (!file.exists(config.cfg)) { 32 | file.create(config.cfg) 33 | } 34 | config <- configr::read.config(file = config.cfg) 35 | config[[name]] = list(installed = installed, source.dir = source.dir, bin_dir = bin.dir, 36 | executable_files = executable.files, ...) 37 | configr::write.config(config.dat = config, file = config.cfg, write.type = "yaml") 38 | } 39 | 40 | #' Show biologly softwares infomation of system 41 | #' 42 | #' @param name Software name 43 | #' @param db File saving softwares infomation 44 | #' @param verbose Ligical indicating wheather show the log message 45 | #' @export 46 | #' @return Bool Value 47 | #' @examples 48 | #' db <- sprintf('%s/.BioInstaller', tempdir()) 49 | #' set.biosoftwares.db(db) 50 | #' change.info(name = 'bwa', installed = 'yes', source.dir = '', 51 | #' bin.dir = '', excutable.files = c('demo'), others.customer = 'demo') 52 | #' get.info('bwa') 53 | #' unlink(db) 54 | get.info <- function(name = "", db = Sys.getenv("BIO_SOFTWARES_DB_ACTIVE", tempfile()), 55 | verbose = TRUE) { 56 | db <- normalizePath(db, mustWork = FALSE) 57 | if (!db.check(db)) { 58 | return(FALSE) 59 | } 60 | config.cfg <- db 61 | if (!file.exists(config.cfg)) { 62 | file.create(config.cfg) 63 | } 64 | if (!(name %in% configr::eval.config.sections(file = db))) { 65 | warning(sprintf("%s not existed in BioInstaller database.", name)) 66 | return(FALSE) 67 | } 68 | config <- configr::eval.config(config = name, file = db) 69 | return(config) 70 | } 71 | 72 | #' Delete biologly softwares infomation of system 73 | #' 74 | #' @param name Software name 75 | #' @param db File saving softwares infomation 76 | #' @param verbose Ligical indicating wheather show the log message 77 | #' @export 78 | #' @return Bool Value 79 | #' @examples 80 | #' db <- sprintf('%s/.BioInstaller', tempdir()) 81 | #' set.biosoftwares.db(db) 82 | #' change.info(name = 'bwa', installed = 'yes', source.dir = '', 83 | #' bin.dir = '', excutable.files = c('demo'), others.customer = 'demo') 84 | #' del.info('bwa') 85 | #' unlink(db) 86 | del.info <- function(name = "", db = Sys.getenv("BIO_SOFTWARES_DB_ACTIVE", tempfile()), 87 | verbose = TRUE) { 88 | db <- normalizePath(db, mustWork = FALSE) 89 | if (!db.check(db)) { 90 | return(FALSE) 91 | } 92 | config.cfg <- db 93 | if (!file.exists(config.cfg)) { 94 | file.create(config.cfg) 95 | } 96 | if (!(name %in% configr::eval.config.sections(file = config.cfg))) { 97 | warning(sprintf("%s not existed in BioInstaller database.", name)) 98 | return(FALSE) 99 | } 100 | config <- configr::read.config(config = name, file = config.cfg) 101 | config[[name]] <- NULL 102 | configr::write.config(config.dat = config, file = config.cfg, write.type = "yaml") 103 | } 104 | 105 | #' Show all installed bio-softwares in system 106 | #' 107 | #' @param db File saving softwares infomation 108 | #' @param only.installed Logical wheather only show installed softwares in db 109 | #' @param verbose Ligical indicating wheather show the log message 110 | #' @export 111 | #' @return Bool Value 112 | #' @examples 113 | #' db <- sprintf('%s/.BioInstaller', tempdir()) 114 | #' set.biosoftwares.db(db) 115 | #' change.info(name = 'bwa', installed = 'yes', source.dir = '', 116 | #' bin.dir = '', excutable.files = c('demo'), others.customer = 'demo') 117 | #' show.installed() 118 | #' unlink(db) 119 | show.installed <- function(db = Sys.getenv("BIO_SOFTWARES_DB_ACTIVE", tempfile()), 120 | only.installed = TRUE, verbose = TRUE) { 121 | db <- normalizePath(db, mustWork = FALSE) 122 | if (!db.check(db)) { 123 | return(FALSE) 124 | } 125 | config.cfg <- db 126 | if (!file.exists(config.cfg)) { 127 | file.create(config.cfg) 128 | } 129 | softwares <- c() 130 | sections <- configr::eval.config.sections(file = config.cfg) 131 | for (i in sections) { 132 | config <- eval.config(config = i, file = config.cfg) 133 | if ("installed" %in% names(config)) { 134 | is.installed <- config[["installed"]] %in% c(TRUE, "yes", 1) 135 | } else { 136 | is.installed <- FALSE 137 | } 138 | if (only.installed && is.installed) { 139 | softwares <- c(softwares, i) 140 | } else if (!only.installed) { 141 | softwares <- c(softwares, i) 142 | } 143 | } 144 | if (is.null(softwares)) { 145 | return(NULL) 146 | } 147 | attr(softwares, "file") <- db 148 | attr(softwares, "configtype") <- get.config.type(db) 149 | return(softwares) 150 | } 151 | 152 | 153 | db.check <- function(db) { 154 | if (!file.exists(db)) { 155 | if (!file.exists(dirname(db))) { 156 | status <- dir.create(dir.name(db), recursive = T) 157 | } 158 | status <- file.create(db) 159 | if (any(status == FALSE)) { 160 | return(FALSE) 161 | } 162 | } 163 | return(TRUE) 164 | } 165 | -------------------------------------------------------------------------------- /R/install_utils.R: -------------------------------------------------------------------------------- 1 | # Check BioInstaller Database 2 | db.check <- function(db) { 3 | if (file.exists(db)) { 4 | return(TRUE) 5 | } else { 6 | file.create(db) 7 | } 8 | } 9 | # Configuration file and install name initial 10 | config.and.name.initial <- function(config.cfg, name) { 11 | status <- check.configfile.validate(config.cfg) 12 | if (!status) { 13 | return(FALSE) 14 | } 15 | status <- check.install.name(name, config.cfg) 16 | if (!status) { 17 | return(FALSE) 18 | } 19 | return(TRUE) 20 | } 21 | 22 | # Check configfile wheather is a valid format configuration file 23 | check.configfile.validate <- function(config.cfg) { 24 | if (is.list(fetch.config(config.cfg))) { 25 | return(TRUE) 26 | } else { 27 | return(FALSE) 28 | } 29 | } 30 | 31 | # Check install function parametrs 32 | check.install.name <- function(name, config.cfg) { 33 | if (!is.character(name)) { 34 | warning("Parameter 'name' must be a character.") 35 | return(FALSE) 36 | } 37 | if (!(name %in% names(fetch.config(config.cfg)))) { 38 | if (name == "") { 39 | warning("Parameter 'name' can not be empty!") 40 | } else { 41 | warning(sprintf("%s are not available in BioInstaller.", name)) 42 | } 43 | return(FALSE) 44 | } 45 | return(TRUE) 46 | } 47 | 48 | # Initial parameter version 49 | version.initial <- function(name = "", version = NULL, versions = NULL, config = NULL) { 50 | if (is.null(version)) { 51 | params <- list(config = config, versions = versions) 52 | version <- do.call(version.newest, params) 53 | } 54 | if (is.numeric(version)) { 55 | version <- as.character(version) 56 | } 57 | return(version) 58 | } 59 | 60 | # Check wheather show all avaliable version can be installed 61 | show.avaliable.versions <- function(config, name) { 62 | flag <- use.github.response(config) 63 | if (flag) { 64 | versions <- as.character(get.github.version(config)) 65 | } else { 66 | versions <- nongithub2versions(name) 67 | if (is.null(versions)) { 68 | versions <- config$version_available 69 | } 70 | } 71 | return(versions) 72 | } 73 | 74 | # Check wheather destdir is exist or not, if not will create it, and set workdir 75 | # in make.dir 76 | set.makedir <- function(make.dir, destdir) { 77 | destdir <- normalizePath(destdir, "/", mustWork = FALSE) 78 | if (dir.exists(destdir)) { 79 | setwd(destdir) 80 | } else { 81 | dir.create(destdir, showWarnings = FALSE, recursive = TRUE) 82 | setwd(destdir) 83 | } 84 | if (!is.null(make.dir)) { 85 | make.dir <- normalizePath(make.dir, "/", mustWork = FALSE) 86 | for (i in make.dir) { 87 | if (i != "./" && dir.exists(i)) { 88 | setwd(i) 89 | } 90 | } 91 | } 92 | } 93 | 94 | # Check dependence 95 | is.need.dependence <- function(need.install) { 96 | return(length(need.install) > 0) 97 | } 98 | 99 | # Setted dependence 100 | is.setted.dependence <- function(config) { 101 | return(!is.null(config$dependence_version) && !is.null(config$dependence)) 102 | } 103 | 104 | check.need.install <- function(names, versions, db) { 105 | result <- c() 106 | names.installed <- show.installed(db) 107 | count <- 1 108 | for (i in names) { 109 | if (i %in% names.installed) { 110 | if (versions[count] == get.info(i)$version) { 111 | result <- c(result, TRUE) 112 | } else { 113 | result <- c(result, FALSE) 114 | } 115 | } else { 116 | result <- c(result, FALSE) 117 | } 118 | count <- count + 1 119 | } 120 | return(result) 121 | } 122 | 123 | # Get need install name 124 | get.need.install <- function(config, db) { 125 | fil1 <- check.need.install(config$dependence, config$dependence_version, db) 126 | fil2 <- check.need.install(str_replace_all(config$dependence, "@", "_"), config$dependence_version, 127 | db) 128 | need.install <- config$dependence[!(fil1 | fil2)] 129 | need.install.version <- config$dependence_version[!(fil1 | fil2)] 130 | return(list(need.install = need.install, need.install.version = need.install.version)) 131 | } 132 | 133 | # Install dependence 134 | install.dependence <- function(need.install, need.install.version, download.dir, 135 | destdir, verbose, github.cfg = system.file("extdata", "config/github/github.toml", 136 | package = "BioInstaller"), nongithub.cfg = c(system.file("extdata", "config/nongithub/nongithub.toml", 137 | package = "BioInstaller"), system.file("extdata", "config/db/db_main.toml", 138 | package = "BioInstaller"), system.file("extdata", "config/db/db_annovar.toml", 139 | package = "BioInstaller"), system.file("extdata", "config/db/db_blast.toml", 140 | package = "BioInstaller"))) { 141 | info.msg(sprintf("Try install the dependence:%s", paste0(need.install, collapse = ", ")), 142 | verbose = verbose) 143 | dest.path <- Sys.getenv("BIO_DEPENDENCE_DIR") 144 | if (dest.path != "") { 145 | dest.path <- normalizePath(dest.path, mustWork = F) 146 | download.dir <- dest.path 147 | destdir <- dest.path 148 | } 149 | download.dir = sprintf("%s/%s", download.dir, str_replace_all(need.install, "@", 150 | "_")) 151 | install.status <- install.bioinfo(name = need.install, download.dir = download.dir, 152 | destdir = rep(destdir, length(download.dir)), version = need.install.version, 153 | verbose = verbose, github.cfg = github.cfg, nongithub.cfg = nongithub.cfg) 154 | fail.list <- install.status$fail.list 155 | if (!is.null(fail.list) && fail.list != "") { 156 | stop(sprintf("Dependence Error:%s install fail.", paste0(fail.list, collapse = ", "))) 157 | } 158 | return(TRUE) 159 | } 160 | 161 | # Dependence processor 162 | process.dependence <- function(config, db, download.dir, destdir, verbose, github.cfg = "", 163 | nongithub.cfg = "") { 164 | status <- TRUE 165 | if (is.setted.dependence(config)) { 166 | need.install <- get.need.install(config, db)$need.install 167 | need.install.version <- get.need.install(config, db)$need.install.version 168 | count <- 1 169 | if (is.need.dependence(need.install)) { 170 | status <- install.dependence(need.install, need.install.version, destdir = destdir, 171 | download.dir = download.dir, verbose = verbose, github.cfg = github.cfg, 172 | nongithub.cfg = nongithub.cfg) 173 | } 174 | } 175 | return(status) 176 | } 177 | 178 | # Check wheather will download a dir 179 | is.download.dir <- function(config) { 180 | return(!is.null(config$source_is_dir) && config$source_is_dir) 181 | } 182 | 183 | 184 | # According the config$source_is_dir decide wheather need to download a dir or a 185 | # file to destfile 186 | download.dir.files <- function(config, source_url, destfile, showWarnings = FALSE, 187 | url.all.download = TRUE) { 188 | index <- !file.exists(dirname(destfile)) 189 | if (any(index)) { 190 | need.create.dir <- dirname(destfile)[index] 191 | sapply(need.create.dir, function(x) { 192 | dir.create(x, showWarnings = showWarnings, recursive = TRUE) 193 | }) 194 | } 195 | is.dir <- is.download.dir(config) 196 | count <- 1 197 | status <- c() 198 | for (i in source_url) { 199 | tryCatch({ 200 | status.tmp <- download.file.custom(url = i, destfile = destfile[count], 201 | is.dir = is.dir, showWarnings = showWarnings) 202 | if (!is.logical(status.tmp) && status.tmp == 0) { 203 | status.tmp <- TRUE 204 | } else { 205 | status.tmp <- FALSE 206 | } 207 | status.attr <- attributes(status)$success 208 | status <- c(status, status.tmp) 209 | if (status.tmp) { 210 | attr(status, "success") <- c(status.attr, destfile[count]) 211 | } 212 | if (!url.all.download && status.tmp) { 213 | break 214 | } 215 | }, error = function(e) { 216 | if (showWarnings) { 217 | warning(e) 218 | } 219 | }, warning = function(w) { 220 | if (showWarnings) { 221 | warning(w) 222 | } 223 | }) 224 | count <- count + 1 225 | } 226 | destfile <- unique(destfile) 227 | destfile <- destfile[file.exists(destfile)] 228 | 229 | if (!is.dir && all(!(file.size(destfile) > 0))) { 230 | return(FALSE) 231 | } 232 | if (is.dir && length(list.files(destfile)) == 0) { 233 | return(FALSE) 234 | } 235 | return(status) 236 | } 237 | 238 | # Convert URL to filename 239 | url2filename <- function(url) { 240 | filename <- basename(url) 241 | filename <- str_replace_all(filename, ".*=", "") 242 | return(filename) 243 | } 244 | 245 | # Initital source_url 246 | source.url.initial <- function(config) { 247 | source_url <- config$source_url 248 | if (is.null(source_url)) { 249 | return(NULL) 250 | } 251 | if (is.list(config$source_url)) { 252 | os.version <- get.os() 253 | if (os.version == "windows") { 254 | return(source_url$windows) 255 | } else if (os.version == "mac") { 256 | return(source_url$mac) 257 | } else { 258 | return(source_url$linux) 259 | } 260 | } else { 261 | return(config$source_url) 262 | } 263 | } 264 | 265 | convert.bool <- function(flag) { 266 | if (is.null(flag) || !(flag %in% c(FALSE, 0, "no", "false")) || flag %in% c("true", 267 | TRUE, 1, "yes")) { 268 | TRUE 269 | } else { 270 | FALSE 271 | } 272 | } 273 | 274 | git.download <- function(name, destdir, version, github_url, use_git2r, recursive_clone, 275 | verbose) { 276 | msg <- sprintf("Now start to download %s in %s.", name, destdir, verbose) 277 | info.msg(msg, verbose = verbose) 278 | use_git2r <- convert.bool(use_git2r) 279 | recursive_clone <- convert.bool(recursive_clone) 280 | if (use_git2r) { 281 | if (!dir.exists(dirname(destdir))) { 282 | dir.create(dirname(destdir), recursive = TRUE) 283 | } 284 | repo <- git2r::clone(github_url, destdir) 285 | if (version != "master") { 286 | text <- sprintf("git2r::checkout(git2r::tags(repo)[['%s']])", version) 287 | status <- eval(parse(text = text)) 288 | status <- is.null(status) 289 | } 290 | if (length(list.files(destdir)) != 0) { 291 | status <- TRUE 292 | } else { 293 | status <- FALSE 294 | } 295 | } else { 296 | if (recursive_clone) { 297 | cmd <- sprintf("git clone --recursive %s %s", github_url, destdir) 298 | } else { 299 | cmd <- sprintf("git clone %s %s", github_url, destdir) 300 | } 301 | status <- for_runcmd(cmd) 302 | status <- status == 0 303 | status[is.null(status)] <- FALSE 304 | if (!status) { 305 | return(FALSE) 306 | } 307 | olddir <- getwd() 308 | setwd(destdir) 309 | if (version != "master") { 310 | status <- for_runcmd(sprintf("git checkout %s", version)) 311 | } 312 | setwd(olddir) 313 | } 314 | return(status) 315 | } 316 | 317 | 318 | pre.process.dir <- function(name, destdir, download.dir, count, local.source = NULL, 319 | is.nongithub = FALSE) { 320 | if (is.null.na(destdir[count]) && !is.null.na(download.dir[count])) { 321 | download.dir[count] <- normalizePath(download.dir[count], mustWork = FALSE) 322 | destdir[count] <- download.dir[count] 323 | } else if (is.null.na(download.dir[count]) && !is.null.na(destdir[count])) { 324 | destdir[count] <- normalizePath(destdir[count], mustWork = FALSE) 325 | download.dir[count] <- destdir[count] 326 | } else if (is.null.na(download.dir[count]) && is.null.na(destdir[count])) { 327 | download.dir[count] <- sprintf("%s/%s", tempdir(), name) 328 | destdir[count] <- download.dir[count] 329 | } else { 330 | download.dir[count] <- normalizePath(download.dir[count], mustWork = FALSE) 331 | destdir[count] <- normalizePath(destdir[count], mustWork = FALSE) 332 | } 333 | processed.dirs <- list(des.dir = destdir[count], down.dir = download.dir[count]) 334 | if (!is.null(local.source) && !is.nongithub) { 335 | processed.dirs$down.dir = normalizePath(local.source, mustWork = FALSE) 336 | } 337 | return(processed.dirs) 338 | } 339 | -------------------------------------------------------------------------------- /R/meta.R: -------------------------------------------------------------------------------- 1 | #' Get all BioInstaller meta files path, such as database, 2 | #' GitHub source, non-GitHub source, web source 3 | #' 4 | #' @param db.meta Database source meta file path, default is 5 | #' system.file('extdata', 'config/db/db_meta.toml', package = 'BioInstaller') 6 | #' @param github.meta Github source meta file path, default is 7 | #' system.file('extdata', 'config/github/github_meta.toml', package = 'BioInstaller') 8 | #' @param nongithub.meta non-Github source meta file path, default is 9 | #' system.file('extdata', 'config/nongithub/nongithub_meta.toml', package = 'BioInstaller') 10 | #' @param web.meta Web source meta file path, default is 11 | #' system.file('extdata', 'config/web/web_meta.toml', package = 'BioInstaller') 12 | #' @return 13 | #' List contain the meta files path of BioInstaller collected sources 14 | #' @export 15 | #' 16 | #' @examples 17 | #' get.meta.files() 18 | get.meta.files <- function(db.meta = system.file("extdata", "config/db/db_meta.toml", 19 | package = "BioInstaller"), github.meta = system.file("extdata", "config/github/github_meta.toml", 20 | package = "BioInstaller"), nongithub.meta = system.file("extdata", "config/nongithub/nongithub_meta.toml", 21 | package = "BioInstaller"), web.meta = system.file("extdata", "config/web/web_meta.toml", 22 | package = "BioInstaller")) { 23 | meta_files <- list(db_meta_file = db.meta, github_meta_file = github.meta, nongithub_meta_file = nongithub.meta, 24 | web_meta_file = web.meta) 25 | return(meta_files) 26 | } 27 | 28 | #' Get meta information of BioInstaller collected sources, such as database, 29 | #' GitHub source, non-GitHub source, web source 30 | #' 31 | #' @param value Avaliable option for `db`, `github`, `nongithub`: `cfg_meta`, `item`; 32 | #' for web: `item` 33 | #' @param config Avaliable option: `db`, `db_meta_file`, `github`, `github_meta_file`, 34 | #' `nongithub`, `nongithub_meta_file`, `web`, `web_meta_file` 35 | #' @param get.meta.files.params Params pass to \code{\link{get.meta.files}} 36 | #' @param read.config.params Params pass to \code{\link[configr]{read.config}} 37 | #' @return 38 | #' List contain the meta files path of BioInstaller collected sources 39 | #' @export 40 | #' 41 | #' @examples 42 | #' meta <- get.meta() 43 | #' db_cfg_meta <- get.meta(config = 'db', value = 'cfg_meta') 44 | #' db_meta_file <- get.meta(config = 'db_meta_file') 45 | #' db_cfg_meta_parsed <- get.meta(value = 'cfg_meta', config = 'db', 46 | #' read.config.params = list(rcmd.parse = TRUE)) 47 | get.meta <- function(value = NULL, config = NULL, get.meta.files.params = NULL, read.config.params = NULL) { 48 | if (is.null(get.meta.files.params)) { 49 | meta_files <- get.meta.files() 50 | } else { 51 | meta_files <- do.call("get.meta.files", get.meta.files.params) 52 | } 53 | config.list <- list() 54 | for (i in meta_files) { 55 | if (!is.null(read.config.params)) { 56 | params <- config.list.merge(list(file = i), read.config.params) 57 | config.list.tmp <- do.call("read.config", params) 58 | } else { 59 | config.list.tmp <- read.config(file = i) 60 | } 61 | config.list.tmp$Title <- NULL 62 | config.list <- config.list.merge(config.list, config.list.tmp) 63 | } 64 | config.list <- config.list.merge(meta_files, config.list) 65 | if (!is.null(config) && !is.null(value)) { 66 | return(config.list[[config]][[value]]) 67 | } else if (!is.null(config) && is.null(value)) { 68 | return(config.list[[config]]) 69 | } else { 70 | return(config.list) 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /R/spack.R: -------------------------------------------------------------------------------- 1 | #' Wrapper function of spack 2 | #' 3 | #' @param suffix_params Command line parameters of spack (prefix_params spack suffix_params) 4 | #' @param prefix_params Command line parameters of spack (prefix_params spack suffix_params) 5 | #' @param spack Default is Sys.which('spack') 6 | #' @param ... Parameters pass to 'system' 7 | #' @export 8 | #' 9 | #' @examples 10 | #' \dontrun{ 11 | #' spack() 12 | #' } 13 | spack <- function(suffix_params = "", prefix_params = "", spack = Sys.which("spack"), 14 | ...) { 15 | spack <- unname(spack) 16 | if (spack == "") { 17 | warning("Executable 'spack' Not Found.") 18 | return(FALSE) 19 | } 20 | objs <- system(sprintf("%s%s %s", prefix_params, spack, suffix_params), intern = TRUE, 21 | ...) 22 | paste0(objs, collapse = "\n") 23 | } 24 | 25 | #' Wrapper function of 'spack list', list and search available packages 26 | #' 27 | #' @param ... Parameters pass to \code{\link{spack}} 28 | #' @export 29 | #' 30 | #' @examples 31 | #' \dontrun{ 32 | #' spack.list() 33 | #' } 34 | spack.list <- function(...) { 35 | objs <- spack("list", ...) 36 | if (is.logical(objs) && !objs) { 37 | return(FALSE) 38 | } 39 | text <- paste0(objs, collapse = "\n") 40 | x <- read.table(text = text) 41 | colnames(x) <- c("Name") 42 | return(x) 43 | } 44 | -------------------------------------------------------------------------------- /R/utils_function.R: -------------------------------------------------------------------------------- 1 | # Check the file or dir wheather exists(file need size > 0) @param path A string. 2 | # @return Bool Value @examples isexist('~/workdir') 3 | is.file.empty <- function(path) { 4 | if (!is.na(file.size(path)) & file.size(path) > 0) { 5 | return(FALSE) 6 | } else { 7 | return(TRUE) 8 | } 9 | } 10 | 11 | # Get the operating system distribution 12 | get.os <- function() { 13 | os <- Sys.info()["sysname"][[1]] 14 | if (os == "Linux") { 15 | centos.flag <- as.character(Sys.which("yum")) 16 | ubuntu.flag <- as.character(Sys.which("apt-get")) 17 | arch.flag <- as.character(Sys.which("pacman")) 18 | if (centos.flag != "") { 19 | return("centos") 20 | } else if (ubuntu.flag != "") { 21 | return("ubuntu") 22 | } else if (arch.flag != "") { 23 | return("arch") 24 | } else { 25 | return("other") 26 | } 27 | } else if (os == "Darwin") { 28 | return("mac") 29 | } else if (os == "Windows") { 30 | return("windows") 31 | } else { 32 | return("other") 33 | } 34 | } 35 | 36 | # Run shell or R cmd 37 | runcmd <- function(cmd, verbose = TRUE) { 38 | if (is.character(cmd) && cmd != "") { 39 | if (str_detect(cmd, "^\\#R\\#") && str_detect(cmd, "\\#R\\#$")) { 40 | cmd <- str_replace_all(cmd, "^\\#R\\#", "") 41 | cmd <- str_replace_all(cmd, "\\#R\\#$", "") 42 | cmd <- str_replace_all(cmd, fixed("%'%"), "\"") 43 | cmd <- str_split(cmd, "\\\\n")[[1]] 44 | cmd <- paste0(cmd, collapse = ";") 45 | cmd <- str_replace_all(cmd, ";;", ";") 46 | cmd <- str_replace_all(cmd, fixed("{;"), fixed("{")) 47 | info.msg(sprintf("Running R CMD:%s", cmd), verbose = verbose) 48 | status <- -1 49 | tryCatch(status <- eval(parse(text = cmd)), error = function(e) { 50 | return(-1) 51 | }) 52 | if (is.null(status) || is.na(status) || status != -1) { 53 | return(0) 54 | } else { 55 | return(-1) 56 | } 57 | } else { 58 | cmd <- str_replace_all(cmd, fixed("-e \\\""), "-e \"") 59 | cmd <- str_replace_all(cmd, fixed(")\\\""), ")\"") 60 | cmd <- str_replace_all(cmd, fixed("%'%"), "\"") 61 | info.msg(sprintf("Running CMD:%s", cmd), verbose = verbose) 62 | system(cmd) 63 | } 64 | } else { 65 | return(0) 66 | } 67 | } 68 | 69 | # Run a group of cmd 70 | for_runcmd <- function(cmd_vector, verbose = TRUE) { 71 | if (is.null(cmd_vector)) { 72 | return(0) 73 | } 74 | status.vector <- NULL 75 | for (i in cmd_vector) { 76 | if (i != "") { 77 | status <- runcmd(i, verbose) 78 | status.vector <- c(status.vector, status) 79 | } else { 80 | status <- 0 81 | status.vector <- c(status.vector, status) 82 | } 83 | } 84 | return(status.vector) 85 | } 86 | 87 | get.subconfig <- function(config, subconfig) { 88 | os <- get.os() 89 | if (is.null(config[[subconfig]])) { 90 | return("") 91 | } 92 | if (!is.list(config[[subconfig]])) { 93 | return(config[[subconfig]]) 94 | } 95 | if (os == "mac") { 96 | return(config[[subconfig]]$mac) 97 | } else if (os == "windows") { 98 | return(config[[subconfig]]$windows) 99 | } else { 100 | return(config[[subconfig]]$linux) 101 | } 102 | } 103 | 104 | get.file.type <- function(file) { 105 | filetype.lib <- c("tgz$", "tar.xz$", "tar.bz2$", "tar.gz$", "tar$", "gz$", "zip$", 106 | "bz2$", "xz$") 107 | if (is.na(file)) { 108 | return(FALSE) 109 | } 110 | for (i in filetype.lib) { 111 | if (str_detect(file, i)) { 112 | return(str_replace_all(i, fixed("$"), "")) 113 | } 114 | } 115 | return("other") 116 | } 117 | extract.file <- function(file, destdir, decompress = TRUE) { 118 | filetype <- get.file.type(file) 119 | if (filetype == FALSE) { 120 | status <- FALSE 121 | } 122 | dir.create(destdir, showWarnings = F, recursive = TRUE) 123 | if (!decompress || filetype == "other") { 124 | files <- list.files(dirname(file)) 125 | files.path <- sprintf("%s/%s", dirname(file), files) 126 | 127 | rm.index <- file.size(files.path) == 0 128 | file.remove(files.path[rm.index]) 129 | files.path <- files.path[!rm.index] 130 | destfiles.path <- sprintf("%s/%s", destdir, basename(files.path)) 131 | status <- file.rename(files.path, destfiles.path) 132 | status <- all(status) 133 | return(status) 134 | } 135 | if (filetype == "zip") { 136 | unzip(file, exdir = destdir) 137 | status <- drop_redundance_dir(destdir) 138 | } else if (filetype %in% c("gz", "xz", "bz2")) { 139 | status <- gunzip(filename = file, sprintf("%s/%s", destdir, str_replace_all(basename(file), 140 | ".gz$|.xz|.bz2", ""))) 141 | status <- is.character(status) 142 | } else if (filetype %in% c("tar", "tar.gz", "tgz", "tar.bz2", "tar.xz")) { 143 | status <- untar(file, exdir = destdir) 144 | status <- drop_redundance_dir(destdir) 145 | } else { 146 | status <- TRUE 147 | } 148 | 149 | status <- all(status) 150 | return(status) 151 | } 152 | 153 | 154 | # Extract file and dirs if only one dir present after decomparessed 155 | drop_redundance_dir <- function(destdir) { 156 | files.parent <- list.files(destdir) 157 | if (length(files.parent) == 1) { 158 | dirs.parent <- list.dirs(destdir) 159 | if (length(dirs.parent) == 1) { 160 | return(TRUE) 161 | } 162 | file.rename(sprintf("%s/%s", destdir, files.parent), sprintf("%s/tmp00", 163 | destdir)) 164 | unlink(sprintf("%s/%s", destdir, files.parent), recursive = TRUE) 165 | files.parent <- sprintf("%s/tmp00", destdir) 166 | files.child <- list.files(files.parent) 167 | files.path <- sprintf("%s/%s", files.parent, files.child) 168 | destfiles.path <- sprintf("%s/%s", destdir, files.child) 169 | status <- file.rename(files.path, destfiles.path) 170 | unlink(files.parent, recursive = TRUE) 171 | files.parent <- list.files(destdir) 172 | if (length(files.parent) > 0) { 173 | TRUE 174 | } else { 175 | FALSE 176 | } 177 | } 178 | } 179 | 180 | # Download from url, if is.dir is TRUE, it will get filenames first and download 181 | # them (FTP supported only) 182 | download.file.custom <- function(url = "", destfile = "", is.dir = FALSE, showWarnings = FALSE, 183 | ...) { 184 | status <- NULL 185 | if (is.dir) { 186 | filenames <- getURL(url, ftp.use.epsv = FALSE, dirlistonly = TRUE) 187 | filenames <- str_replace_all(filenames, "\r\n", "\n") 188 | filenames <- str_split(filenames, "\n")[[1]] 189 | filenames <- filenames[filenames != ""] 190 | if (!str_detect(url, "ftp://")) { 191 | filenames <- str_extract(filenames, "href=.*\">.*") 192 | filenames <- str_split(filenames, "\"") 193 | filenames <- sapply(filenames, function(x) { 194 | return(x[2]) 195 | }) 196 | filenames <- filenames[!is.na(filenames)] 197 | dirs <- filenames[str_detect(filenames, "/$")] 198 | filenames <- filenames[!str_detect(filenames, ";|/")] 199 | } 200 | dir.create(destfile, showWarnings = showWarnings, recursive = TRUE) 201 | for (i in filenames) { 202 | fn <- sprintf("%s/%s", destfile, i) 203 | tryCatch({ 204 | url.encode <- URLencode(sprintf("%s/%s", url, i)) 205 | status.tmp <- download.file(url = url.encode, destfile = fn, ...) 206 | status <- c(status.tmp, status) 207 | }, error = function(e) { 208 | if (showWarnings) { 209 | warning(e) 210 | } 211 | }, warning = function(w) { 212 | if (showWarnings) { 213 | warning(w) 214 | } 215 | }) 216 | } 217 | if (any(status == 0)) { 218 | status <- 0 219 | } 220 | } else { 221 | url.encode <- URLencode(url) 222 | status <- download.file(url = url.encode, destfile = destfile, ...) 223 | } 224 | return(status) 225 | } 226 | 227 | # Check destdir and decide wheather overwrite 228 | destdir.initial <- function(destdir, strict = TRUE, download.only = FALSE, local.source = NULL, 229 | is.git = TRUE, overwrite = FALSE) { 230 | if (!is.null(local.source)) { 231 | return(TRUE) 232 | } 233 | if (overwrite && dir.exists(destdir)) { 234 | unlink(destdir, recursive = TRUE) 235 | } else if (!is.git) { 236 | return(TRUE) 237 | } 238 | if (!download.only && file.exists(destdir) && length(list.files(destdir) != 0) && 239 | strict) { 240 | flag <- "y" 241 | flag.input <- "N" 242 | count <- 1 243 | while (flag.input == "N" || !flag.input %in% c("y", "n", "Y", "N")) { 244 | if (count > 3) { 245 | cat("More than 3 counts input, default is not to overwrite.\n") 246 | return(FALSE) 247 | } 248 | if (flag.input != "N" && !(flag.input %in% c("y", "n", "Y", "N"))) { 249 | cat("Please input y/n/Y/N!\n") 250 | } 251 | flag.input <- readline(prompt = sprintf("%s not empty, overwrite?[y]", 252 | destdir)) 253 | flag.input <- str_sub(flag.input, 1, 1) 254 | flag.input <- tolower(flag.input) 255 | count <- count + 1 256 | } 257 | if (flag.input == "n") { 258 | return(FALSE) 259 | } else { 260 | unlink(destdir, recursive = TRUE) 261 | return(TRUE) 262 | } 263 | } else if (!download.only && file.exists(destdir) && !strict) { 264 | flag <- "y" 265 | flag.input <- "N" 266 | count <- 1 267 | while (flag.input == "N" || !flag.input %in% c("y", "n", "Y", "N")) { 268 | if (count > 3) { 269 | cat("More than 3 counts input, default is not to overwrite.\n") 270 | return(FALSE) 271 | } 272 | if (flag.input != "N" && !(flag.input %in% c("y", "n", "Y", "N"))) { 273 | cat("Please input y/n/Y/N!\n") 274 | } 275 | flag.input <- readline(prompt = sprintf("%s existed, overwrite?[y]", 276 | destdir)) 277 | flag.input <- str_sub(flag.input, 1, 1) 278 | flag.input <- tolower(flag.input) 279 | count <- count + 1 280 | } 281 | if (flag.input == "n") { 282 | return(FALSE) 283 | } else { 284 | unlink(destdir, recursive = TRUE) 285 | return(TRUE) 286 | } 287 | } 288 | return(TRUE) 289 | } 290 | 291 | is.null.na <- function(value) { 292 | return(is.null(value) || is.na(value)) 293 | } 294 | 295 | info.msg <- function(msg, verbose = TRUE, ...) { 296 | if (verbose) { 297 | flog.info(msg, ...) 298 | } 299 | } 300 | 301 | print.vb <- function(x, verbose = TRUE, ...) { 302 | if (verbose) { 303 | print(x, ...) 304 | } 305 | } 306 | -------------------------------------------------------------------------------- /R/versions.R: -------------------------------------------------------------------------------- 1 | get.github.version <- function(config) { 2 | if (is.null(config$github_url) && is.null(config$bitbucket)) { 3 | result <- github2versions(config$source_url) 4 | } else if (!is.null(config$bitbucket) && config$bitbucket) { 5 | result <- bitbucket2versions(config$github_url) 6 | } else { 7 | result <- github2versions(config$github_url) 8 | } 9 | if (is.null(result)) { 10 | result <- "master" 11 | } 12 | result <- str_sort(result, numeric = TRUE) 13 | if (!("master" %in% result)) { 14 | result <- c("master", result) 15 | } 16 | black_list <- c("vcf-direct-final", "stable2", "stable1", "konnector2-prerelease", 17 | "konnector-prelease", "bc_4.13", "BCM", "st-final", "sgdp") 18 | result <- result[!result %in% black_list] 19 | return(result) 20 | } 21 | 22 | github2versions <- function(github.url) { 23 | github.url <- str_replace(github.url, "http://|https://|git://", "") 24 | txt <- str_split(github.url, "/")[[1]] 25 | user <- txt[2] 26 | repo <- txt[3] 27 | url <- sprintf("https://api.github.com/repos/%s/%s/tags?client_id=1d40ab6884d214ef6889&client_secret=23b818c2bad8e9f88dafd8a425613475362b326d", 28 | user, repo) 29 | json <- tryCatch(fromJSON(url), error = function(e) { 30 | message("Featch the github version failed.") 31 | NULL 32 | }) 33 | if (is.null(json)) 34 | return("master") 35 | return(json$name) 36 | } 37 | 38 | bitbucket2versions <- function(bitbucket.url) { 39 | bitbucket.url <- str_replace(bitbucket.url, "http://|https://|git://", "") 40 | txt <- str_split(bitbucket.url, "/")[[1]] 41 | user <- txt[2] 42 | repo <- txt[3] 43 | url <- sprintf("https://api.bitbucket.org/2.0/repositories/%s/%s/refs/tags", 44 | user, repo) 45 | json <- tryCatch(fromJSON(url), error = function(e) { 46 | message("Featch the bitbucket version failed.") 47 | NULL 48 | }) 49 | if (is.null(json)) 50 | return("master") 51 | return(json$values$name) 52 | } 53 | 54 | use.github.response <- function(config) { 55 | flag1 <- (!is.null(config$github_url)) && is.null(config$version_fixed) 56 | flag2 <- (!is.null(config$source_url)) && !is.null(config$use_github_versions) 57 | return(flag1 || flag2) 58 | } 59 | 60 | nongithub2versions <- function(name) { 61 | script <- system.file("extdata", "scripts/parse_version.R", package = "BioInstaller") 62 | source(script, local = TRUE) 63 | text <- sprintf("str_sort(get.%s.versions(), numeric = TRUE)", name) 64 | tryCatch(eval(parse(text = text)), error = function(e) { 65 | NULL 66 | }) 67 | } 68 | 69 | version.newest <- function(config, versions) { 70 | if (is.null(config$version_order_fixed)) { 71 | versions <- versions[length(versions)] 72 | } 73 | if (!is.null(config$version_newest_fixed)) { 74 | return(config$version_newest_fixed) 75 | } 76 | return(versions[1]) 77 | } 78 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # BioInstaller 2 | 3 | [![Build 4 | Status](https://img.shields.io/circleci/project/github/JhuangLab/BioInstaller/master.svg)](https://circleci.com/gh/JhuangLab/BioInstaller/tree/master) 5 | [![CRAN](http://www.r-pkg.org/badges/version/BioInstaller)](https://cran.r-project.org/package=BioInstaller) 6 | [![Zenodo](https://zenodo.org/badge/DOI/10.5281/zenodo.1343914.svg)](https://zenodo.org/record/1343914) 7 | [![Downloads](http://cranlogs.r-pkg.org/badges/BioInstaller?color=brightgreen)](http://www.r-pkg.org/pkg/BioInstaller) 8 | [![codecov](https://codecov.io/github/JhuangLab/BioInstaller/branch/master/graphs/badge.svg)](https://codecov.io/github/JhuangLab/BioInstaller) 9 | 10 | ## Introduction 11 | 12 | The increase in bioinformatics resources such as tools/scripts and databases poses a great challenge for users seeking to construct interactive and reproducible biological data analysis applications. 13 | 14 | R language, as the most popular programming language for statistics, biological data analysis, and big data, has enabled diverse and free R packages (>14000) for different types of applications. However, due to the lack of high-performance and open-source cloud platforms based on R (e.g., Galaxy for Python users), it is still difficult for R users, especially those without web development skills, to construct interactive and reproducible biological data analysis applications supporting the upload and management of files, long-time computation, task submission, tracking of output files, exception handling, logging, export of plots and tables, and extendible plugin systems. 15 | 16 | The collection, management, and share of various bioinformatics tools/scripts and databases are also essential for almost all bioinformatics analysis projects. 17 | 18 | Here, we established a new platform to construct interactive and reproducible biological data analysis applications based on R language. This platform contains diverse user interfaces, including the R functions and R Shiny application, REST APIs, and support for collecting, managing, sharing, and utilizing massive bioinformatics tools/scripts and databases. 19 | 20 | **Feature**: 21 | 22 | - Easy-to-use 23 | - User-friendly Shiny application 24 | - Integrative platform of Databases and bioinformatics resources 25 | - Open source and completely free 26 | - One-click to download and install bioinformatics resources (via R, Shiny or Opencpu REST APIs) 27 | - More attention for those software and database resource that have not been 28 | by other tools 29 | - Logging 30 | - System monitor 31 | - Task submitting system 32 | - Parallel tasks 33 | 34 | **Field** 35 | 36 | - Quality Control 37 | - Alignment And Assembly 38 | - Alternative Splicing 39 | - ChIP-seq analysis 40 | - Gene Expression Data Analysis 41 | - Variant Detection 42 | - Variant Annotation 43 | - Virus Related 44 | - Statistical and Visualization 45 | - Noncoding RNA Related Database 46 | - Cancer Genomics Database 47 | - Regulator Related Database 48 | - eQTL Related Database 49 | - Clinical Annotation 50 | - Drugs Database 51 | - Proteomic Database 52 | - Software Dependence Database 53 | - ...... 54 | 55 | 56 | 57 | **Note:** We are developing [bget](https://github.com/openbiox/bget) and [bioshiny](https://github.com/openbiox/bioshiny) projects independently for simplify the functions of download and shiny. 58 | 59 | - [bget](https://github.com/openbiox/bget) is an golang-based command-line tool that do not need to install any R packages. 60 | - [bioshiny](https://github.com/openbiox/bioshiny) is the core shiny application of previous BioInstaller package. 61 | 62 | ## Installation 63 | 64 | ### CRAN 65 | 66 | ``` r 67 | #You can install this package directly from CRAN by running (from within R): 68 | install.packages('BioInstaller') 69 | ``` 70 | 71 | ### Github 72 | 73 | ``` bash 74 | # install.packages("devtools") 75 | devtools::install_github("JhuangLab/BioInstaller") 76 | 77 | ``` 78 | ## Shiny application 79 | 80 | **Note**, the Shiny application of BioInstaller was migrated to [bioshiny](https://github.com/openbiox/bioshiny) project. All shiny files in this package have been removed for reducing package size. 81 | 82 | In the new project, we are developing more free plugins of bioshiny for various bioinformatics data analysis. 83 | 84 | ```bash 85 | echo 'export BIO_SOFTWARES_DB_ACTIVE="~/.bioshiny/info.yaml" >> ~/.bashrc' 86 | echo 'export BIOSHINY_CONFIG="~/.bioshiny/shiny.config.yaml" >> ~/.bashrc' 87 | . ~/.bashrc 88 | 89 | # Start the standalone Shiny application 90 | wget https://raw.githubusercontent.com/openbiox/bioshiny/master/bin/bioshiny_deps_r 91 | wget https://raw.githubusercontent.com/openbiox/bioshiny/master/bin/bioshiny_start 92 | chmod a+x bioshiny_deps_r 93 | chmod a+x bioshiny_start 94 | ./bioshiny_deps_r 95 | 96 | # Start Shiny application workers 97 | Rscript -e "bioshiny::set_shiny_workers(1)" 98 | ./bioshiny_start 99 | 100 | # or use yarn 101 | yarn global add bioshiny 102 | bioshiny_deps_r 103 | Rscript -e "bioshiny::set_shiny_workers(1)" 104 | bioshiny_start 105 | ``` 106 | 107 | [spack](https://spack.io/) and [miniconda](https://docs.conda.io/en/latest/miniconda.html) are required for extra functions. 108 | 109 | ## Contributed Resources 110 | 111 | - [GitHub 112 | resource](https://github.com/JhuangLab/BioInstaller/blob/master/inst/extdata/config/github/github.toml) 113 | - GitHub resource [meta 114 | information](https://github.com/JhuangLab/BioInstaller/blob/master/inst/extdata/config/github/github_meta.toml) 115 | - [Non GitHub 116 | resource](https://github.com/JhuangLab/BioInstaller/blob/master/inst/extdata/config/nongithub/nongithub.toml) 117 | - Non Github resource [meta 118 | infrmation](https://github.com/JhuangLab/BioInstaller/blob/master/inst/extdata/config/nongithub/nongithub_meta.toml) 119 | - [Database](https://github.com/JhuangLab/BioInstaller/tree/master/inst/extdata/config/db) 120 | - [Web 121 | Service](https://github.com/JhuangLab/BioInstaller/blob/master/inst/extdata/config/web/web_meta.toml) 122 | - [Docker](https://github.com/JhuangLab/BioInstaller/blob/master/inst/extdata/config/docker/docker.toml) 123 | 124 | ## Support Summary 125 | 126 | **Quality Control:** 127 | 128 | - FastQC, PRINSEQ, SolexaQA, FASTX-Toolkit ... 129 | 130 | **Alignment and Assembly:** 131 | 132 | - BWA, STAR, TMAP, Bowtie, Bowtie2, tophat2, hisat2, GMAP-GSNAP, 133 | ABySS, SSAHA2, Velvet, Edean, Trinity, oases, RUM, MapSplice2, 134 | NovoAlign ... 135 | 136 | **Variant Detection:** 137 | 138 | - GATK, Mutect, VarScan2, FreeBayes, LoFreq, TVC, SomaticSniper, 139 | Pindel, Delly, BreakDancer, FusionCatcher, Genome STRiP, CNVnator, 140 | CNVkit, SpeedSeq ... 141 | 142 | **Variant Annotation:** 143 | 144 | - ANNOVAR, SnpEff, VEP, oncotator ... 145 | 146 | **Utils:** 147 | 148 | - htslib, samtools, bcftools, bedtools, bamtools, vcftools, sratools, 149 | picard, HTSeq, seqtk, UCSC Utils(blat, liftOver), bamUtil, jvarkit, 150 | bcl2fastq2, fastq\_tools ... 151 | 152 | **Genome:** 153 | 154 | - hisat2\_reffa, ucsc\_reffa, ensemble\_reffa ... 155 | 156 | **Others:** 157 | 158 | - sparsehash, SQLite, pigz, lzo, lzop, bzip2, zlib, armadillo, pxz, 159 | ROOT, curl, xz, pcre, R, gatk\_bundle, ImageJ, igraph ... 160 | 161 | **Databases:** 162 | 163 | - ANNOVAR, blast, CSCD, GATK\_Bundle, biosystems, civic, denovo\_db, 164 | dgidb, diseaseenhancer, drugbank, ecodrug, expression\_atlas, 165 | funcoup, gtex, hpo, inbiomap, interpro, medreaders, mndr, msdd, 166 | omim, pancanqtl, proteinatlas, remap2, rsnp3, seecancer, 167 | srnanalyzer, superdrug2, tumorfusions, varcards ... 168 | 169 | ## Docker 170 | 171 | You can use the BioInstaller in Docker since v0.3.0. Shiny application was supported since v0.3.5. 172 | 173 | ``` bash 174 | docker pull bioinstaller/bioinstaller 175 | docker run -it -p 80:80 -p 8004:8004 -v /tmp/download:/tmp/download bioinstaller/bioinstaller 176 | ``` 177 | 178 | Service list: 179 | 180 | - localhost/ocpu/ Opencpu service 181 | - localhost/shiny/BioInstaller Shiny service 182 | - localhost/rstudio/ Rstudio server (opencpu/opencpu) 183 | 184 | ## Citation 185 | 186 | - Li J, Cui B, Dai Y, et al. BioInstaller: a comprehensive R package to construct interactive and reproducible biological data analysis applications based on the R platform[J]. PeerJ, 2018, 6:e5853. 187 | 188 | ## How to contribute? 189 | 190 | Please fork the [GitHub BioInstaller 191 | repository](https://github.com/JhuangLab/BioInstaller), modify it, and 192 | submit a pull request to us. Especialy, the files list in `contributed 193 | section` should be modified when you see a tool or database that not be 194 | included in the other software warehouse. 195 | 196 | ## Maintainer 197 | 198 | [Jianfeng Li](https://github.com/Miachol) 199 | 200 | ## License 201 | 202 | R package: 203 | 204 | [MIT](https://en.wikipedia.org/wiki/MIT_License) 205 | 206 | Related Other Resources 207 | 208 | Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License 209 | -------------------------------------------------------------------------------- /_pkgdown.yml: -------------------------------------------------------------------------------- 1 | template: 2 | package: lifetemplate 3 | default_assets: false 4 | 5 | home: 6 | strip_header: true 7 | 8 | navbar: 9 | title: ~ 10 | type: default 11 | left: 12 | - text: Get started 13 | href: articles/BioInstaller.html 14 | - text: Download 15 | href: articles/download.html 16 | - text: Reference 17 | href: reference/index.html 18 | - text: Articles 19 | menu: 20 | - text: Description of supported items 21 | href: articles/items_description.html 22 | - text: Write Your Own Configuration File 23 | href: articles/write_configuration_file.html 24 | - text: Start the BioInstaller Shiny Application 25 | href: articles/start_shiny_of_BioInstaller.html 26 | - text: Plugins of BioInstaller Shiny Application 27 | href: articles/plugins_of_BioInstaller_shiny.html 28 | - text: News 29 | href: news/index.html 30 | right: 31 | - icon: fa-github fa-lg 32 | href: https://github.com/JhuangLab/BioInstaller 33 | -------------------------------------------------------------------------------- /inst/extdata/config/db/db_blast.toml: -------------------------------------------------------------------------------- 1 | # Configuration file of install.softwares(Non-Github) 2 | title = "Non-Github Configuration File (Databases): blast FTP sets (ftp://ftp.ncbi.nih.gov/blast/db/)" 3 | [db_blast_env_nr] 4 | source_url = "!!glue ftp://ftp.ncbi.nih.gov/blast/db/env_nr.{ids=sprintf('%02d', 0:23);rep(ids, 2)}.tar.gz{c(rep('', length(ids)), rep('.md5', length(ids)))}" 5 | decompress = "!!glue c(rep(TRUE, 24), rep(FALSE, 24))" 6 | version_available = ["newest"] 7 | after_failure = "echo 'fail!'" 8 | after_success = "echo 'successful!'" 9 | make_dir = ["./"] 10 | bin_dir = ["./"] 11 | 12 | [db_blast_est_human] 13 | source_url = "!!glue ftp://ftp.ncbi.nih.gov/blast/db/est_human.{ids=sprintf('%02d', 0:1);rep(ids, 2)}.tar.gz{c(rep('', length(ids)), rep('.md5', length(ids)))}" 14 | decompress = "!!glue c(rep(TRUE, 2), rep(FALSE, 2))" 15 | version_available = ["newest"] 16 | after_failure = "echo 'fail!'" 17 | after_success = "echo 'successful!'" 18 | make_dir = ["./"] 19 | bin_dir = ["./"] 20 | 21 | [db_blast_est_mouse] 22 | source_url = "!!glue ftp://ftp.ncbi.nih.gov/blast/db/est_mouse.{ids=sprintf('%02d', 0:1);rep(ids, 2)}.tar.gz{c(rep('', length(ids)), rep('.md5', length(ids)))}" 23 | decompress = "!!glue c(rep(TRUE, 2), rep(FALSE, 2))" 24 | version_available = ["newest"] 25 | after_failure = "echo 'fail!'" 26 | after_success = "echo 'successful!'" 27 | make_dir = ["./"] 28 | bin_dir = ["./"] 29 | 30 | [db_blast_est_others] 31 | source_url = "!!glue ftp://ftp.ncbi.nih.gov/blast/db/est_others.{ids=sprintf('%02d', 0:10);rep(ids, 2)}.tar.gz{c(rep('', length(ids)), rep('.md5', length(ids)))}" 32 | decompress = "!!glue c(rep(TRUE, 11), rep(FALSE, 11))" 33 | version_available = ["newest"] 34 | after_failure = "echo 'fail!'" 35 | after_success = "echo 'successful!'" 36 | make_dir = ["./"] 37 | bin_dir = ["./"] 38 | 39 | [db_blast_gss] 40 | source_url = ["!!glue ftp://ftp.ncbi.nih.gov/blast/db/gss.{ids=sprintf('%02d', 0:6);rep(ids, 2)}.tar.gz{c(rep('', length(ids)), rep('.md5', length(ids)))}", 41 | "ftp://ftp.ncbi.nih.gov/blast/db/gss_annot.00.tar.gz{c('', '.md5')}"] 42 | decompress = "!!glue c(rep(TRUE, 7), rep(FALSE, 7))" 43 | version_available = ["newest"] 44 | after_failure = "echo 'fail!'" 45 | after_success = "echo 'successful!'" 46 | make_dir = ["./"] 47 | bin_dir = ["./"] 48 | 49 | 50 | [db_blast_htgs] 51 | source_url = ["!!glue ftp://ftp.ncbi.nih.gov/blast/db/htgs.{ids=sprintf('%02d', 0:10);rep(ids, 2)}.tar.gz{c(rep('', length(ids)), rep('.md5', length(ids)))}"] 52 | decompress = "!!glue c(rep(TRUE, 11), rep(FALSE, 11))" 53 | version_available = ["newest"] 54 | after_failure = "echo 'fail!'" 55 | after_success = "echo 'successful!'" 56 | make_dir = ["./"] 57 | bin_dir = ["./"] 58 | 59 | [db_blast_human_genomic] 60 | source_url = ["!!glue ftp://ftp.ncbi.nih.gov/blast/db/human_genomic.{ids=sprintf('%02d', 0:21);rep(ids, 2)}.tar.gz{c(rep('', length(ids)), rep('.md5', length(ids)))}", 61 | "ftp://ftp.ncbi.nih.gov/blast/db/human_genomic_transcript.tar.gz{c('', '.md5')}"] 62 | decompress = "!!glue c(rep(TRUE, 22), rep(FALSE, 22))" 63 | version_available = ["newest"] 64 | after_failure = "echo 'fail!'" 65 | after_success = "echo 'successful!'" 66 | make_dir = ["./"] 67 | bin_dir = ["./"] 68 | 69 | [db_blast_landmark] 70 | source_url = ["!!glue ftp://ftp.ncbi.nih.gov/blast/db/landmark.tar.gz{c('', '.md5')}"] 71 | decompress = [true, false] 72 | version_available = ["newest"] 73 | after_failure = "echo 'fail!'" 74 | after_success = "echo 'successful!'" 75 | make_dir = ["./"] 76 | bin_dir = ["./"] 77 | 78 | [db_blast_mouse_genomic] 79 | source_url = ["!!glue ftp://ftp.ncbi.nih.gov/blast/db/mouse_genomic_transcript.tar.gz{c('', '.md5')}"] 80 | decompress = [true, false] 81 | version_available = ["newest"] 82 | after_failure = "echo 'fail!'" 83 | after_success = "echo 'successful!'" 84 | make_dir = ["./"] 85 | bin_dir = ["./"] 86 | 87 | [db_blast_nr] 88 | source_url = ["!!glue ftp://ftp.ncbi.nih.gov/blast/db/nr.{ids=sprintf('%02d', 0:68);rep(ids, 2)}.tar.gz{c(rep('', length(ids)), rep('.md5', length(ids)))}"] 89 | decompress = "!!glue c(rep(TRUE, 69), rep(FALSE, 69))" 90 | version_available = ["newest"] 91 | after_failure = "echo 'fail!'" 92 | after_success = "echo 'successful!'" 93 | make_dir = ["./"] 94 | bin_dir = ["./"] 95 | 96 | [db_blast_nt] 97 | source_url = ["!!glue ftp://ftp.ncbi.nih.gov/blast/db/nt.{ids=sprintf('%02d', 0:47);rep(ids, 2)}.tar.gz{c(rep('', length(ids)), rep('.md5', length(ids)))}"] 98 | decompress = "!!glue c(rep(TRUE, 48), rep(FALSE, 48))" 99 | version_available = ["newest"] 100 | after_failure = "echo 'fail!'" 101 | after_success = "echo 'successful!'" 102 | make_dir = ["./"] 103 | bin_dir = ["./"] 104 | 105 | [db_blast_other_genomic] 106 | source_url = ["!!glue ftp://ftp.ncbi.nih.gov/blast/db/other_genomic.{ids=sprintf('%02d', 0:99);rep(ids, 2)}.tar.gz{c(rep('', length(ids)), rep('.md5', length(ids)))}", 107 | "!!glue ftp://ftp.ncbi.nih.gov/blast/db/other_genomic.{ids=sprintf('%d', 100:178);rep(ids, 2)}.tar.gz{c(rep('', length(ids)), rep('.md5', length(ids)))}"] 108 | decompress = "!!glue c(rep(TRUE, 179), rep(FALSE, 179))" 109 | version_available = ["newest"] 110 | after_failure = "echo 'fail!'" 111 | after_success = "echo 'successful!'" 112 | make_dir = ["./"] 113 | bin_dir = ["./"] 114 | 115 | [db_blast_pataa] 116 | source_url = ["!!glue ftp://ftp.ncbi.nih.gov/blast/db/pataa.tar.gz{c('', '.md5')}"] 117 | decompress = [true, false] 118 | version_available = ["newest"] 119 | after_failure = "echo 'fail!'" 120 | after_success = "echo 'successful!'" 121 | make_dir = ["./"] 122 | bin_dir = ["./"] 123 | 124 | [db_blast_patnt] 125 | source_url = ["!!glue ftp://ftp.ncbi.nih.gov/blast/db/patnt.{ids=sprintf('%02d', 0:4);rep(ids, 2)}.tar.gz{c(rep('', length(ids)), rep('.md5', length(ids)))}"] 126 | decompress = "!!glue c(rep(TRUE, 5), rep(FALSE, 5))" 127 | version_available = ["newest"] 128 | after_failure = "echo 'fail!'" 129 | after_success = "echo 'successful!'" 130 | make_dir = ["./"] 131 | bin_dir = ["./"] 132 | 133 | [db_blast_pdbaa] 134 | source_url = ["!!glue ftp://ftp.ncbi.nih.gov/blast/db/pdbaa.tar.gz{c('', '.md5')}"] 135 | decompress = [true, false] 136 | version_available = ["newest"] 137 | after_failure = "echo 'fail!'" 138 | after_success = "echo 'successful!'" 139 | make_dir = ["./"] 140 | bin_dir = ["./"] 141 | 142 | [db_blast_pdbnt] 143 | source_url = ["!!glue ftp://ftp.ncbi.nih.gov/blast/db/pdbnt.{ids=sprintf('%02d', 0:47);rep(ids, 2)}.tar.gz{c(rep('', length(ids)), rep('.md5', length(ids)))}"] 144 | decompress = "!!glue c(rep(TRUE, 48), rep(FALSE, 48))" 145 | version_available = ["newest"] 146 | after_failure = "echo 'fail!'" 147 | after_success = "echo 'successful!'" 148 | make_dir = ["./"] 149 | bin_dir = ["./"] 150 | 151 | [db_blast_ref_prok_rep_genomes] 152 | source_url = ["!!glue ftp://ftp.ncbi.nih.gov/blast/db/ref_prok_rep_genomes.{ids=sprintf('%02d', 0:5);rep(ids, 2)}.tar.gz{c(rep('', length(ids)), rep('.md5', length(ids)))}"] 153 | decompress = "!!glue c(rep(TRUE, 6), rep(FALSE, 6))" 154 | version_available = ["newest"] 155 | after_failure = "echo 'fail!'" 156 | after_success = "echo 'successful!'" 157 | make_dir = ["./"] 158 | bin_dir = ["./"] 159 | 160 | [db_blast_ref_viroids_rep_genomes] 161 | source_url = ["!!glue ftp://ftp.ncbi.nih.gov/blast/db/ref_viroids_rep_genomes.tar.gz{c('', '.md5')}"] 162 | decompress = [true, false] 163 | version_available = ["newest"] 164 | after_failure = "echo 'fail!'" 165 | after_success = "echo 'successful!'" 166 | make_dir = ["./"] 167 | bin_dir = ["./"] 168 | 169 | [db_blast_ref_viruses_rep_genomes] 170 | source_url = ["!!glue ftp://ftp.ncbi.nih.gov/blast/db/ref_viruses_rep_genomes.tar.gz{c('', '.md5')}"] 171 | decompress = [true, false] 172 | version_available = ["newest"] 173 | after_failure = "echo 'fail!'" 174 | after_success = "echo 'successful!'" 175 | make_dir = ["./"] 176 | bin_dir = ["./"] 177 | 178 | [db_blast_refseq_genomic] 179 | source_url = ["!!glue ftp://ftp.ncbi.nih.gov/blast/db/refseq_genomic.{ids=sprintf('%02d', 0:99);rep(ids, 2)}.tar.gz{c(rep('', length(ids)), rep('.md5', length(ids)))}", 180 | "!!glue ftp://ftp.ncbi.nih.gov/blast/db/refseq_genomic.{ids=sprintf('%d', 100:270);rep(ids, 2)}.tar.gz{c(rep('', length(ids)), rep('.md5', length(ids)))}"] 181 | decompress = "!!glue c(rep(TRUE, 271), rep(FALSE, 271))" 182 | version_available = ["newest"] 183 | after_failure = "echo 'fail!'" 184 | after_success = "echo 'successful!'" 185 | make_dir = ["./"] 186 | bin_dir = ["./"] 187 | 188 | [db_blast_refseq_protein] 189 | source_url = ["!!glue ftp://ftp.ncbi.nih.gov/blast/db/refseq_protein.{ids=sprintf('%02d', 0:32);rep(ids, 2)}.tar.gz{c(rep('', length(ids)), rep('.md5', length(ids)))}"] 190 | decompress = "!!glue c(rep(TRUE, 33), rep(FALSE, 33))" 191 | version_available = ["newest"] 192 | after_failure = "echo 'fail!'" 193 | after_success = "echo 'successful!'" 194 | make_dir = ["./"] 195 | bin_dir = ["./"] 196 | 197 | [db_blast_refseq_rna] 198 | source_url = ["!!glue ftp://ftp.ncbi.nih.gov/blast/db/refseq_rna.{ids=sprintf('%02d', 0:11);rep(ids, 2)}.tar.gz{c(rep('', length(ids)), rep('.md5', length(ids)))}"] 199 | decompress = "!!glue c(rep(TRUE, 12), rep(FALSE, 12))" 200 | version_available = ["newest"] 201 | after_failure = "echo 'fail!'" 202 | after_success = "echo 'successful!'" 203 | make_dir = ["./"] 204 | bin_dir = ["./"] 205 | 206 | [db_blast_refseqgene] 207 | source_url = ["!!glue ftp://ftp.ncbi.nih.gov/blast/db/refseqgene.tar.gz{c('', '.md5')}"] 208 | decompress = [true, false] 209 | version_available = ["newest"] 210 | after_failure = "echo 'fail!'" 211 | after_success = "echo 'successful!'" 212 | make_dir = ["./"] 213 | bin_dir = ["./"] 214 | 215 | [db_blast_sts] 216 | source_url = ["!!glue ftp://ftp.ncbi.nih.gov/blast/db/sts.tar.gz{c('', '.md5')}"] 217 | decompress = [true, false] 218 | version_available = ["newest"] 219 | after_failure = "echo 'fail!'" 220 | after_success = "echo 'successful!'" 221 | make_dir = ["./"] 222 | bin_dir = ["./"] 223 | 224 | [db_blast_swissprot] 225 | source_url = ["!!glue ftp://ftp.ncbi.nih.gov/blast/db/swissprot.tar.gz{c('', '.md5')}"] 226 | decompress = [true, false] 227 | version_available = ["newest"] 228 | after_failure = "echo 'fail!'" 229 | after_success = "echo 'successful!'" 230 | make_dir = ["./"] 231 | bin_dir = ["./"] 232 | 233 | [db_blast_taxdb] 234 | source_url = ["!!glue ftp://ftp.ncbi.nih.gov/blast/db/taxdb.tar.gz{c('', '.md5')}"] 235 | decompress = [true, false] 236 | version_available = ["newest"] 237 | after_failure = "echo 'fail!'" 238 | after_success = "echo 'successful!'" 239 | make_dir = ["./"] 240 | bin_dir = ["./"] 241 | 242 | [db_blast_tsa_nr] 243 | source_url = ["!!glue ftp://ftp.ncbi.nih.gov/blast/db/tsa_nr.tar.gz{c('', '.md5')}"] 244 | decompress = [true, false] 245 | version_available = ["newest"] 246 | after_failure = "echo 'fail!'" 247 | after_success = "echo 'successful!'" 248 | make_dir = ["./"] 249 | bin_dir = ["./"] 250 | 251 | [db_blast_tsa_nt] 252 | source_url = ["!!glue ftp://ftp.ncbi.nih.gov/blast/db/tsa_nt{ids=sprintf('%02d', 0:15);rep(ids, 2)}.tar.gz{c(rep('', length(ids)), rep('.md5', length(ids)))}"] 253 | decompress = "!!glue c(rep(TRUE, 16), rep(FALSE, 16))" 254 | version_available = ["newest"] 255 | after_failure = "echo 'fail!'" 256 | after_success = "echo 'successful!'" 257 | make_dir = ["./"] 258 | bin_dir = ["./"] 259 | 260 | [db_blast_vector] 261 | source_url = ["!!glue ftp://ftp.ncbi.nih.gov/blast/db/vector{ids=sprintf('%02d', 0:15);rep(ids, 2)}.tar.gz{c(rep('', length(ids)), rep('.md5', length(ids)))}"] 262 | decompress = "!!glue c(rep(TRUE, 16), rep(FALSE, 16))" 263 | version_available = ["newest"] 264 | after_failure = "echo 'fail!'" 265 | after_success = "echo 'successful!'" 266 | make_dir = ["./"] 267 | bin_dir = ["./"] 268 | -------------------------------------------------------------------------------- /inst/extdata/config/db/db_ucsc.toml.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JhuangLab/BioInstaller/bb365f5bfb7cdfd61f2ac83ddff4277800a79955/inst/extdata/config/db/db_ucsc.toml.gz -------------------------------------------------------------------------------- /inst/extdata/config/docker/docker.toml: -------------------------------------------------------------------------------- 1 | title = "This is a docker hub simplified search database built-in BioInstaller R Package" 2 | [bwa] 3 | repo = ["bioinstaller"] 4 | name = "bwa" 5 | version_newest = "latest" 6 | version_available = ["latest"] 7 | short_description = """Burrows-Wheeler Aligner""" 8 | 9 | [gatk3] 10 | repo = ["bioinstaller"] 11 | name = "gatk3" 12 | version_newest = "latest" 13 | version_available = ["latest"] 14 | short_description = """Genome Analysis Toolkit""" 15 | 16 | [samtools] 17 | repo = ["bioinstaller"] 18 | name = "samtools" 19 | version_newest = "latest" 20 | version_available = ["latest"] 21 | short_description = """samtools:Tools (written in C using htslib) for manipulating next-generation sequencing data""" 22 | 23 | [picard] 24 | repo = ["bioinstaller"] 25 | name = "picard" 26 | version_newest = "latest" 27 | version_available = ["latest"] 28 | short_description = """picard:A set of command line tools (in Java) for manipulating high-throughput sequencing (HTS) data and formats such as SAM/BAM/CRAM and VCF.""" 29 | 30 | [mutect] 31 | repo = ["bioinstaller"] 32 | name = "mutect" 33 | version_newest = "latest" 34 | version_available = ["latest"] 35 | short_description = """mutect:Accurate and sensitive cancer mutation detection""" 36 | -------------------------------------------------------------------------------- /inst/extdata/config/nongithub/nongithub_meta.toml: -------------------------------------------------------------------------------- 1 | title = "Non Github resources" 2 | [nongithub.cfg_meta] 3 | avaliable_cfg = ["nongithub.toml"] 4 | prefix_url = "https://raw.githubusercontent.com/JhuangLab/BioInstaller/master/inst/extdata/config/nongithub" 5 | cfg_dir = "@>@system.file('extdata', 'config/nongithub', package = 'BioInstaller')@<@" 6 | 7 | [nongithub.item.gmap] 8 | title = "GMAP: A Genomic Mapping and Alignment Program for mRNA and EST Sequences, and GSNAP: Genomic Short-read Nucleotide Alignment Program" 9 | description = "The programs GMAP and GSNAP, for aligning RNA-Seq and DNA-Seq datasets to genomes, have evolved along with advances in biological methodology to handle longer reads, larger volumes of data, and new types of biological assays. The genomic representation has been improved to include linear genomes that can compare sequences using single-instruction multiple-data (SIMD) instructions, compressed genomic hash tables with fast access using SIMD instructions, handling of large genomes with more than four billion bp, and enhanced suffix arrays (ESAs) with novel data structures for fast access. Improvements to the algorithms have included a greedy match-and-extend algorithm using suffix arrays, segment chaining using genomic hash tables, diagonalization using segmental hash tables, and nucleotide-level dynamic programming procedures that use SIMD instructions and eliminate the need for F-loop calculations. Enhancements to the functionality of the programs include standardization of indel positions, handling of ambiguous splicing, clipping and merging of overlapping paired-end reads, and alignments to circular chromosomes and alternate scaffolds. The programs have been adapted for use in pipelines by integrating their usage into R/Bioconductor packages such as gmapR and HTSeqGenie, and these pipelines have facilitated the discovery of numerous biological phenomena." 10 | publication = """Wu T D, Watanabe C K. GMAP: a genomic mapping and alignment program for mRNA and EST sequences[J]. Bioinformatics, 2005, 21(9): 1859-1875. doi: 10.1093/bioinformatics/bti310; Wu T D, Reeder J, Lawrence M, et al. GMAP and GSNAP for genomic sequence alignment: enhancements to speed, accuracy, and functionality[J]. Statistical Genomics: Methods and Protocols, 2016: 283-334. doi: 10.1007/978-1-4939-3578-9_15""" 11 | tag = ["Genomics", "NGS", "Genomic alignment", "DNA-seq", "RNA-seq", "mRNA", "Whole Transcriptome Sequencing", 12 | "EST"] 13 | 14 | [nongithub.item.gridss] 15 | title = "GRIDSS: sensitive and specific genomic rearrangement detection using positional de Bruijn graph assembly." 16 | description = "The identification of genomic rearrangements with high sensitivity and specificity using massively parallel sequencing remains a major challenge, particularly in precision medicine and cancer research. Here, we describe a new method for detecting rearrangements, GRIDSS (Genome Rearrangement IDentification Software Suite). GRIDSS is a multithreaded structural variant (SV) caller that performs efficient genome-wide break-end assembly prior to variant calling using a novel positional de Bruijn graph-based assembler. By combining assembly, split read, and read pair evidence using a probabilistic scoring, GRIDSS achieves high sensitivity and specificity on simulated, cell line, and patient tumor data, recently winning SV subchallenge #5 of the ICGC-TCGA DREAM8.5 Somatic Mutation Calling Challenge. On human cell line data, GRIDSS halves the false discovery rate compared to other recent methods while matching or exceeding their sensitivity. GRIDSS identifies nontemplate sequence insertions, microhomologies, and large imperfect homologies, estimates a quality score for each breakpoint, stratifies calls into high or low confidence, and supports multisample analysis." 17 | publication = "Cameron D L, Schroeder J, Penington J S, et al. GRIDSS: sensitive and specific genomic rearrangement detection using positional de Bruijn graph assembly[J]. Genome Research, 2017, 27(12). doi: 10.1101/gr.222109.117" 18 | tag = ["NGS", "SV"] 19 | 20 | [nongithub.item.interproscan] 21 | title = "Protein sequence analysis & classification" 22 | description = "InterProScan is the software package that allows sequences (protein and nucleic) to be scanned against InterPro's signatures. Signatures are predictive models, provided by several different databases, that make up the InterPro consortium." 23 | publication = "Zdobnov E M, Apweiler R. InterProScan – an integration platform for the signature-recognition methods in InterPro[J]. Bioinformatics, 2001, 17(9):847-848. doi: PMID: 11590104" 24 | tag = ["Protein", "Classification"] 25 | 26 | [nongithub.item.subread] 27 | title = "High-performance read alignment, quantification and mutation discovery" 28 | description = "The Subread software package is a tool kit for processing next-gen sequencing data. It includes Subread aligner, Subjunc exon-exon junction detector and featureCounts read summarization program. Subread aligner can be used to align both gDNA-seq and RNA-seq reads. Subjunc aligner was specified designed for the detection of exon-exon junction. For the mapping of RNA-seq reads, Subread performs local alignments and Subjunc performs global alignments." 29 | publication = """Yang Liao, Gordon K Smyth and Wei Shi. "The Subread aligner: fast, accurate and scalable read mapping by seed-and-vote", Nucleic Acids Research, 2013, 41(10):e108""" 30 | tag = ["NGS", "aligner"] 31 | 32 | [nongithub.item.vcfanno] 33 | title = "annotate a VCF with other VCFs/BEDs/tabixed files" 34 | description = "vcfanno allows you to quickly annotate your VCF with any number of INFO fields from any number of VCFs or BED files. It uses a simple conf file to allow the user to specify the source annotation files and fields and how they will be added to the info of the query VCF." 35 | publication = "Pedersen B S, Layer R M, Quinlan A R. Vcfanno: fast, flexible annotation of genetic variants[J]. Genome Biology, 2016, 17(1):1-9." 36 | tag = ["NGS", "annotation"] 37 | 38 | [nongithub.item.absolute] 39 | title = "ABSOLUTE can estimate purity/ploidy, and from that compute absolute copy-number and mutation multiplicities." 40 | description = "When DNA is extracted from an admixed population of cancer and normal cells, the information on absolute copy number per cancer cell is lost in the mixing. The purpose of ABSOLUTE is to re-extract these data from the mixed DNA population. This process begins by generation of segmented copy number data, which is input to the ABSOLUTE algorithm together with pre-computed models of recurrent cancer karyotypes and, optionally, allelic fraction values for somatic point mutations. The output of ABSOLUTE then provides re-extracted information on the absolute cellular copy number of local DNA segments and, for point mutations, the number of mutated alleles." 41 | publication = "Carter S L, Cibulskis K, Helman E, et al. Absolute quantification of somatic DNA alterations in human cancer[J]. Nature biotechnology, 2012, 30(5): 413-421." 42 | 43 | [nongithub.item.hapseg] 44 | title = "A probabilistic method to interpret bi-allelic marker data in cancer samples." 45 | description = "The HAPSEG module takes single nucleotide polymorphism (SNP) microarray data and outputs copy number data segmented by haplotype. The output data is suitable for use as input data for the ABSOLUTE module. More detail see http://software.broadinstitute.org/cancer/software/genepattern/modules/docs/HAPSEG/1" 46 | publication = "Carter SL, Meyerson M, Getz G. Accurate estimation of homologue-specific DNA concentration-ratios in cancer samples allows long-range haplotyping. Available from Nature Precedings; 2011." 47 | 48 | [nongithub.item.atlas2] 49 | title = "Atlas2, next-generation sequencing suite of variant analysis tools specializing in the separation of true SNPs and insertions and deletions (indels)" 50 | description = "Atlas2 is a next-generation sequencing suite of variant analysis tools specializing in the separation of true SNPs and insertions and deletions (indels) from sequencing and mapping errors in Whole Exome Capture Sequencing (WECS) data." 51 | publication = "Challis D. etc. An integrative variant analysis suite for whole exome next-generation sequencing data. BMC Bioinformatics 2012, 13:8 doi:10.1186/1471-2105-13-8" 52 | 53 | [nongithub.item.beagle] 54 | title = "Beagle, a software package that performs genotype calling, genotype phasing, imputation of ungenotyped markers, and identity-by-descent segment detection." 55 | description = """Beagle version 4.1 has a more accurate genotype phasing algorithm and a very fast and accurate genotype imputation algorithm. Version 4.1 also has several changes to the command line arguments which are described in the release notes. The "ped" argument has no effect in version 4.1. If your data contains nuclear families and you want to model the parent-offspring relationships when phasing genotypes, please use version 4.0.""" 56 | publication = """S R Browning and B L Browning (2007) Rapid and accurate haplotype phasing and missing data inference for whole genome association studies by use of localized haplotype clustering. Am J Hum Genet 81:1084-1097. doi:10.1086/521987; B L Browning and S R Browning (2013). Improving the accuracy and efficiency of identity-by-descent detection in population data. Genetics 194(2):459-71. doi:10.1534/genetics.113.150029; B L Browning and S R Browning (2016). Genotype imputation with millions of reference samples. Am J Hum Genet 98:116-126. doi:10.1016/j.ajhg.2015.11.020""" 57 | 58 | [nongithub.item.contest] 59 | title = "ContEst is a tool (and method) for estimating the amount of cross-sample contamination in next generation sequencing data. Using a Bayesian framework, contamination levels are estimated from array based genotypes and sequencing reads." 60 | description = "Here, we present ContEst, a tool for estimating the level of cross-individual contamination in next-generation sequencing data. We demonstrate the accuracy of ContEst across a range of contamination levels, sources and read depths using sequencing data mixed in silico at known concentrations. We applied our tool to published cancer sequencing datasets and report their estimated contamination levels." 61 | publication = "Cibulskis K, Mckenna A, Fennell T, et al. ContEst: estimating cross-contamination of human samples in next-generation sequencing data[J]. Bioinformatics, 2011, 27(18):2601-2602." 62 | 63 | [nongithub.item.rmats] 64 | title = "Multivariate Analysis of Transcript Splicing (MATS)" 65 | description = "MATS is a computational tool to detect differential alternative splicing events from RNA-Seq data. The statistical model of MATS calculates the P-value and false discovery rate that the difference in the isoform ratio of a gene between two conditions exceeds a given user-defined threshold. From the RNA-Seq data, MATS can automatically detect and analyze alternative splicing events corresponding to all major types of alternative splicing patterns. MATS handles replicate RNA-Seq data from both paired and unpaired study design." 66 | publication = """Shen S., Park JW., Lu ZX., Lin L., Henry MD., Wu YN., Zhou Q., Xing Y. rMATS: Robust and Flexible Detection of Differential Alternative Splicing from Replicate RNA-Seq Data. PNAS, 111(51):E5593-601. doi: 10.1073/pnas.1419161111; Park JW., Tokheim C., Shen S., Xing Y. Identifying differential alternative splicing events from RNA sequencing data using RNASeq-MATS. Methods in Molecular Biology: Deep Sequencing Data Analysis, 2013;1038:171-179 doi: 10.1007/978-1-62703-514-9_10; Shen S., Park JW., Huang J., Dittmar KA., Lu ZX., Zhou Q., Carstens RP., Xing Y. MATS: A Bayesian Framework for Flexible Detection of Differential Alternative Splicing from RNA-Seq Data. Nucleic Acids Research, 2012;40(8):e61 doi: 10.1093/nar/gkr1291""" 67 | 68 | [nongithub.item.prada] 69 | title = "PRADA : Pipeline for RNA-Sequencing Data Analysis" 70 | description = """Massively parallel sequencing of cDNA reverse transcribed from RNA (RNASeq) provides an accurate estimate of the quantity and composition of mRNAs. To characterize the transcriptome through the analysis of RNA-seq data, we developed PRADA. PRADA focuses on the processing and analysis of gene expression estimates, supervised and unsupervised gene fusion identification, and supervised intragenic deletion identification. 71 | PRADA currently supports 7 modules to process and identify abnormalities from RNAseq data: 72 | preprocess: Generates aligned and recalibrated BAM files. 73 | expression: Generates gene expression (RPKM) and quality metrics. 74 | fusion: Identifies candidate gene fusions. 75 | guess-ft: Supervised search for fusion transcripts. 76 | guess-if: Supervised search for intragenic fusions. 77 | homology: Calculates homology between given two genes. 78 | frame: Predicts functional consequence of fusion transcript""" 79 | publication = "PRADA: pipeline for RNA sequencing data analysis[J]. Bioinformatics, 2014, 30(15): 2224-2226. https://doi.org/10.1093/bioinformatics/btu169" 80 | 81 | [nongithub.item.igv] 82 | title = "The Integrative Genomics Viewer (IGV)" 83 | description = "The Integrative Genomics Viewer (IGV) is a high-performance visualization tool for interactive exploration of large, integrated genomic datasets. It supports a wide variety of data types, including array-based and next-generation sequence data, and genomic annotations." 84 | publication = """Integrative Genomics Viewer. Nature Biotechnology 29, 24–26 (2011); Integrative Genomics Viewer (IGV): high-performance genomics data visualization and exploration. Briefings in Bioinformatics 14, 178-192 (2013).""" 85 | 86 | 87 | [nongithub.item.marina] 88 | title = "Master Regulator Inference Algorithm" 89 | description = "MARINA (Master Regulator Inference Algorithm) MAster Regulator INference algorithm (MARINa), designed to infer transcription factors (TFs) controlling the transition between the two phenotypes, A and B, and the maintenance of the latter phenotype. Expression at the mRNA level is often a poor predictor of a TF's regulatory activity and an even worst predictor of its biological relevance in regulating phenotype-specific programs. To obviate this problem, MARINa infers TF activity from the global transcriptional activation of its regulon (i.e. its activated and repressed targets) and its biological relevance by TF-regulon overlap with phenotype-specific programs." 90 | publication = "Lefebvre C, Rajbhandari P, Alvarez MJ, Bandaru P, Lim WK, Sato M, Wang K, Sumazin P, Kustagi M, Bisikirska BC, Basso K, Beltrao P, Krogan N, Gautier J, Dalla-Favera R, Califano A. A human B-cell interactome identifies MYB and FOXM1 as master regulators of proliferation in germinal centers. Mol Syst Biol. 2010 Jun 8;6:377." 91 | 92 | [nongithub.item.paradigm] 93 | title = "PAthway Representation and Analysis by Direct Inference on Graphical Models" 94 | description = "High-dimensional ‘-omics’ profiling provides a detailed molecular view of individual cancers; however, understanding the mechanisms by which tumors evade cellular defenses requires deep knowledge of the underlying cellular pathways within each cancer sample. We extended the PARADIGM algorithm (Vaske et al., 2010, Bioinformatics, 26, i237–i245), a pathway analysis method for combining multiple ‘-omics’ data types, to learn the strength and direction of 9139 gene and protein interactions curated from the literature. Using genomic and mRNA expression data from 1936 samples in The Cancer Genome Atlas (TCGA) cohort, we learned interactions that provided support for and relative strength of 7138 (78%) of the curated links. Gene set enrichment found that genes involved in the strongest interactions were significantly enriched for transcriptional regulation, apoptosis, cell cycle regulation and response to tumor cells. Within the TCGA breast cancer cohort, we assessed different interaction strengths between breast cancer subtypes, and found interactions associated with the MYC pathway and the ER alpha network to be among the most differential between basal and luminal A subtypes. PARADIGM with the Naive Bayesian assumption produced gene activity predictions that, when clustered, found groups of patients with better separation in survival than both the original version of PARADIGM and a version without the assumption. We found that this Naive Bayes assumption was valid for the vast majority of co-regulators, indicating that most co-regulators act independently on their shared target." 95 | publication = "Sedgewick A J, Benz S C, Rabizadeh S, et al. Learning subgroup-specific regulatory interactions and regulator independence with PARADIGM[J]. Bioinformatics, 2013, 29(13): i62-i70. https://doi.org/10.1093/bioinformatics/btt229" 96 | 97 | [nongithub.item.meerkat] 98 | title = "http://dx.doi.org/10.1016/j.cell.2013.04.010" 99 | description = "Identification of somatic rearrangements in cancer genomes has accelerated through analysis of high-throughput sequencing data. However, characterization of complex structural alterations and their underlying mechanisms remains inadequate. Here, applying an algorithm to predict structural variations from short reads, we report a comprehensive catalog of somatic structural variations and the mechanisms generating them, using high-coverage whole-genome sequencing data from 140 patients across ten tumor types. We characterize the relative contributions of different types of rearrangements and their mutational mechanisms, find that ∼20% of the somatic deletions are complex deletions formed by replication errors, and describe the differences between the mutational mechanisms in somatic and germline alterations. Importantly, we provide detailed reconstructions of the events responsible for loss of CDKN2A/B and gain of EGFR in glioblastoma, revealing that these alterations can result from multiple mechanisms even in a single genome and that both DNA double-strand breaks and replication errors drive somatic rearrangements." 100 | publication = "Yang L, Luquette L J, Gehlenborg N, et al. Diverse Mechanisms of Somatic Structural Variations in Human Cancer Genomes[J]. Cell, 2013, 153(4):919-29." 101 | 102 | [nongithub.item.vadir] 103 | title = "VaDiR: an integrated approach to Variant Detection in RNA" 104 | description = """Advances in next-generation DNA sequencing technologies are now enabling detailed 105 | characterization of sequence variations in cancer genomes. With whole genome sequencing, variations in 106 | coding and non-coding sequences can be discovered. But the cost associated with it is currently limiting its 107 | general use in research. Whole exome sequencing is used to characterize sequence variations in coding regions, 108 | but the cost associated with capture reagents and biases in capture rate limit its full use in research. Additional 109 | limitations include uncertainty in assigning the functional signi cance of the mutations when these mutations 110 | are observed in the non-coding region or in genes that are not expressed in cancer tissue. 111 | We investigated the feasibility of uncovering mutations from expressed genes using RNA sequencing 112 | datasets with a method called VaDiR: Variant Detection in RNA" that integrate three variant callers, namely: 113 | SNPiR, RVBoost and MuTect2. The combination of all three methods, which we called Tier1 variants, 114 | produced the highest precision with true positive mutations from RNA-seq that could be validated at the DNA 115 | level. We also found that the integration of Tier1 variants with those called by MuTect2 and SNPiR produced 116 | the highest recall with acceptable precision. Finally, we observed higher rate of mutation discovery in genes 117 | that are expressed at higher levels.""" 118 | publication = "Neums L, Suenaga S, Beyerlein P, et al. VaDiR: an integrated approach to Variant Detection in RNA[J]. GigaScience, 2017. https://doi.org/10.1093/gigascience/gix122" 119 | 120 | [nongithub.item.mutsig] 121 | title = "Mutational heterogeneity in cancer and the search for new cancer-associated genes" 122 | description = """ 123 | MutSig (for "Mutation Significance") is a package of tools for analyzing mutation data. It operates on a cohort of patients and identifies mutations, genes, and other genomic elements predicted to be driver candidates. 124 | """ 125 | publication = "Lawrence, M. et al. Mutational heterogeneity in cancer and the search for new cancer-associated genes. Nature 499, 214-218 (2013) http://dx.doi.org/10.1038/nature12213" 126 | 127 | [nongithub.item.effusion] 128 | title = "Effusion: Prediction of Protein Function from Sequence Similarity Networks" 129 | description = "A method for predicting protein function, Effusion, that uses a sequence similarity network to add context for homology transfer, a probabilistic model to account for the uncertainty in labels and function propagation, and the structure of the Gene Ontology (GO) to best utilize sparse input labels and make consistent output predictions. Effusion's model makes it practical to integrate rare experimental data and abundant primary sequence and sequence similarity." 130 | publication = "Effusion: Prediction of Protein Function from Sequence Similarity Networks. Bioinformatics. 2018 Aug 01, PMID: 30084920 DOI: 10.1093/bioinformatics/bty672" 131 | 132 | [nongithub.item.hgtid] 133 | title = "HGT-ID: an efficient and sensitive workflow to detect human-viral insertion sites using next-generation sequencing data" 134 | description = "Identifies viral insertion sequences for the genome of human cancers. HGT-ID incorporates a sample dataset, references limited to chromosome 18 and the software package. This software detects viral insertion sequences from known viral reference genome of human cancers." 135 | publication = """HGT-ID: an efficient and sensitive workflow to detect human-viral insertion sites using next-generation sequencing data, BMC Bioinformatics 2018, 10.1186/s12859-018-2260-9""" 136 | 137 | [nongithub.item.cromwell] 138 | title = "Scientific workflow engine designed for simplicity & scalability. Trivially transition between one off use cases to massive scale production environments http://cromwell.readthedocs.io/" 139 | description = "Cromwell is a Workflow Management System geared towards scientific workflows. Cromwell is open sourced under the BSD 3-Clause license." 140 | publication = "Not yet" 141 | -------------------------------------------------------------------------------- /inst/extdata/config/web/web_meta.toml: -------------------------------------------------------------------------------- 1 | title = "A library of useful WEB URL resource." 2 | 3 | [web.item.uniprot] 4 | url = "http://www.uniprot.org/" 5 | ftp = "ftp://ftp.uniprot.org/pub/databases/uniprot" 6 | 7 | [web.item.kegg] 8 | url = "http://www.kegg.jp/" 9 | ftp = "ftp://ftp.genome.jp/pub" 10 | 11 | [web.item.ncbi] 12 | url = "https://www.ncbi.nlm.nih.gov/" 13 | ftp = "ftp://ftp.ncbi.nih.gov/pub" 14 | 15 | [web.item.ensembl] 16 | url = "http://www.ensembl.org/" 17 | ftp = "ftp://ftp.ensembl.org/pub/" 18 | 19 | [web.item.tcga_gdc] 20 | url = "https://portal.gdc.cancer.gov" 21 | 22 | [web.item.cbioportal] 23 | url = 'http://www.cbioportal.org/index.do' 24 | 25 | [web.item.rsnp3] 26 | url = "http://rsnp3.psych.ac.cn/index.do" 27 | ftp = "ftp://rv.psych.ac.cn/pub/rsnp3/" 28 | 29 | -------------------------------------------------------------------------------- /inst/extdata/demo/softwares_db_demo.yaml: -------------------------------------------------------------------------------- 1 | title: biosoftwares demo_db 2 | -------------------------------------------------------------------------------- /inst/extdata/scripts/echo_root_env.sh: -------------------------------------------------------------------------------- 1 | echo export ROOTSYS=${1} >> ~/.bashrc 2 | echo 'export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${ROOTSYS}/lib' >> ~/.bashrc 3 | echo 'export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${ROOTSYS}/lib/root' >> ~/.bashrc 4 | -------------------------------------------------------------------------------- /inst/extdata/scripts/install.R: -------------------------------------------------------------------------------- 1 | library(BioInstaller) 2 | install.bioinfo() 3 | -------------------------------------------------------------------------------- /inst/extdata/scripts/install_tvc.sh: -------------------------------------------------------------------------------- 1 | 2 | TVC_VERSION=tvc-$2 3 | 4 | BUILD_ROOT_DIR=`mktemp -d` 5 | cp $TVC_VERSION.tar.gz $BUILD_ROOT_DIR 6 | DISTRIBUTION_CODENAME=`lsb_release -is`_`lsb_release -rs`_`uname -m` 7 | TVC_INSTALL_DIR=$BUILD_ROOT_DIR/$TVC_VERSION-$DISTRIBUTION_CODENAME-binary 8 | mkdir -p $TVC_INSTALL_DIR/bin/ 9 | 10 | 11 | cd $BUILD_ROOT_DIR 12 | wget http://updates.iontorrent.com/updates/software/external/armadillo-4.600.1.tar.gz 13 | tar xvzf armadillo-4.600.1.tar.gz 14 | cd armadillo-4.600.1/ 15 | sed -i 's:^// #define ARMA_USE_LAPACK$:#define ARMA_USE_LAPACK:g' include/armadillo_bits/config.hpp 16 | sed -i 's:^// #define ARMA_USE_BLAS$:#define ARMA_USE_BLAS:g' include/armadillo_bits/config.hpp 17 | cmake . 18 | make -j4 19 | 20 | 21 | cd $BUILD_ROOT_DIR 22 | wget updates.iontorrent.com/updates/software/external/bamtools-2.4.0.20150702+git15eadb925f.tar.gz 23 | tar xvzf bamtools-2.4.0.20150702+git15eadb925f.tar.gz 24 | mkdir bamtools-2.4.0.20150702+git15eadb925f-build 25 | cd bamtools-2.4.0.20150702+git15eadb925f-build 26 | cmake ../bamtools-2.4.0.20150702+git15eadb925f -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo 27 | make -j4 28 | 29 | 30 | cd $BUILD_ROOT_DIR 31 | wget --no-check-certificate https://github.com/samtools/htslib/archive/1.2.1.tar.gz -O htslib-1.2.1.tar.gz 32 | tar xvzf htslib-1.2.1.tar.gz 33 | ln -s htslib-1.2.1 htslib # for samtools 34 | cd htslib-1.2.1 35 | make -j4 36 | 37 | cd $BUILD_ROOT_DIR 38 | wget --no-check-certificate https://github.com/samtools/samtools/archive/1.2.tar.gz -O samtools-1.2.tar.gz 39 | tar xvzf samtools-1.2.tar.gz 40 | cd samtools-1.2 41 | make -j4 42 | cp samtools $TVC_INSTALL_DIR/bin/ 43 | 44 | cd $BUILD_ROOT_DIR 45 | tar xvzf $TVC_VERSION.tar.gz 46 | TVC_SOURCE_DIR=$BUILD_ROOT_DIR/$TVC_VERSION 47 | mkdir $TVC_VERSION-build 48 | cd $TVC_VERSION-build 49 | cmake $TVC_SOURCE_DIR -DCMAKE_INSTALL_PREFIX:PATH=$TVC_INSTALL_DIR -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo 50 | make -j4 install 51 | 52 | tar cvzf $TVC_VERSION-$DISTRIBUTION_CODENAME-binary.tar.gz -C $BUILD_ROOT_DIR $TVC_VERSION-$DISTRIBUTION_CODENAME-binary 53 | 54 | TVC_ROOT_DIR=$1 55 | tar xvzf $TVC_VERSION-$DISTRIBUTION_CODENAME-binary.tar.gz -C $TVC_ROOT_DIR 56 | mv $TVC_ROOT_DIR/*binary/* $TVC_ROOT_DIR 57 | rm -rf $TVC_ROOT_DIR/*binary $TVC_ROOT_DIR/tvc-*gz 58 | -------------------------------------------------------------------------------- /inst/extdata/sql/output_file_table.sql: -------------------------------------------------------------------------------- 1 | PRAGMA foreign_keys=OFF; 2 | BEGIN TRANSACTION; 3 | CREATE TABLE `output_files` ( 4 | `id` INTEGER PRIMARY KEY AUTOINCREMENT, 5 | `file_basename` TEXT, 6 | `file_dir` TEXT, 7 | `file_size` TEXT, 8 | `file_mtime` TEXT, 9 | `key` TEXT 10 | ); 11 | COMMIT; 12 | -------------------------------------------------------------------------------- /inst/extdata/sql/task_table.sql: -------------------------------------------------------------------------------- 1 | PRAGMA foreign_keys=OFF; 2 | BEGIN TRANSACTION; 3 | CREATE TABLE `task_info` ( 4 | `id` INTEGER PRIMARY KEY AUTOINCREMENT, 5 | `msgid` REAL, 6 | `key` TEXT, 7 | `status` TEXT, 8 | `log` TEXT 9 | ); 10 | COMMIT; 11 | -------------------------------------------------------------------------------- /inst/extdata/sql/upload_table.sql: -------------------------------------------------------------------------------- 1 | PRAGMA foreign_keys=OFF; 2 | BEGIN TRANSACTION; 3 | CREATE TABLE `upload_data` ( 4 | `id` INTEGER PRIMARY KEY AUTOINCREMENT, 5 | `file_name` TEXT, 6 | `file_path` TEXT, 7 | `file_size` TEXT, 8 | `file_type` TEXT, 9 | `genome_version` TEXT, 10 | `upload_time` TEXT, 11 | `md5` TEXT, 12 | `description` TEXT 13 | ); 14 | COMMIT; 15 | -------------------------------------------------------------------------------- /man/BioInstaller.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/BioInstaller.R 3 | \docType{package} 4 | \name{BioInstaller} 5 | \alias{BioInstaller} 6 | \alias{BioInstaller-package} 7 | \title{This package is a new platform to construct interactive and reproducible biological 8 | data analysis applications based on R language, which includes the R functions and R 9 | Shiny application, REST APIs.} 10 | \description{ 11 | This package is a new platform to construct interactive and reproducible biological 12 | data analysis applications based on R language, which includes the R functions and R 13 | Shiny application, REST APIs. 14 | } 15 | \seealso{ 16 | Useful links: 17 | 18 | \url{https://github.com/JhuangLab/BioInstaller} 19 | 20 | Report bugs at \url{https://github.com/JhuangLab/BioInstaller/issues} 21 | } 22 | \author{ 23 | Li Jianfeng \url{lee_jianfeng@sjtu.edu.cn} 24 | } 25 | -------------------------------------------------------------------------------- /man/change.info.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/info.R 3 | \name{change.info} 4 | \alias{change.info} 5 | \title{Update biologly softwares infomation of system} 6 | \usage{ 7 | change.info(name = "", installed = TRUE, source.dir = "", 8 | bin.dir = "", executable.files = "", 9 | db = Sys.getenv("BIO_SOFTWARES_DB_ACTIVE", tempfile()), ..., 10 | verbose = TRUE) 11 | } 12 | \arguments{ 13 | \item{name}{Software name} 14 | 15 | \item{installed}{Wheather be installed successful in system} 16 | 17 | \item{source.dir}{Directorie of softwares source code} 18 | 19 | \item{bin.dir}{Directorie of softwares bin} 20 | 21 | \item{executable.files}{Executable files in bin.dir} 22 | 23 | \item{db}{File saving softwares infomation} 24 | 25 | \item{...}{Other key and value paired need be saved in BioInstaller} 26 | 27 | \item{verbose}{Ligical indicating wheather show the log message} 28 | } 29 | \value{ 30 | Bool Value 31 | } 32 | \description{ 33 | Update biologly softwares infomation of system 34 | } 35 | \examples{ 36 | db <- sprintf('\%s/.BioInstaller', tempdir()) 37 | set.biosoftwares.db(db) 38 | change.info(name = 'demo', installed = 'yes', source.dir = '', 39 | bin.dir = '', excutable.files = c('demo'), others.customer = 'demo') 40 | unlink(db) 41 | } 42 | -------------------------------------------------------------------------------- /man/conda.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/conda.R 3 | \name{conda} 4 | \alias{conda} 5 | \title{Wrapper function of conda} 6 | \usage{ 7 | conda(suffix_params = "", prefix_params = "", 8 | conda = Sys.which("conda"), ...) 9 | } 10 | \arguments{ 11 | \item{suffix_params}{Command line parameters of conda} 12 | 13 | \item{prefix_params}{Command line parameters of conda} 14 | 15 | \item{conda}{Default is Sys.which('conda')} 16 | 17 | \item{...}{Parameters pass to 'system'} 18 | } 19 | \description{ 20 | Wrapper function of conda 21 | } 22 | \examples{ 23 | \dontrun{ 24 | conda() 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /man/conda.env.create.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/conda.R 3 | \name{conda.env.create} 4 | \alias{conda.env.create} 5 | \title{Wrapper function of 'conda env create', create an environment based on an environment file} 6 | \usage{ 7 | conda.env.create(env_name = "", env_file = "", env_path = "", 8 | params = "", ...) 9 | } 10 | \arguments{ 11 | \item{env_name}{Name of environment} 12 | 13 | \item{env_file}{Environment definition file (default: environment.yml)} 14 | 15 | \item{env_path}{Full path to environment prefix} 16 | 17 | \item{params}{Extra command line parameters of conda} 18 | 19 | \item{...}{Parameters pass to \code{\link{conda}}} 20 | } 21 | \description{ 22 | Wrapper function of 'conda env create', create an environment based on an environment file 23 | } 24 | \examples{ 25 | \dontrun{ 26 | conda.env.create(params = 'vader/deathstar') 27 | conda.env.create(env_name = 'name') 28 | conda.env.create(env_file = '/path/to/environment.yml') 29 | conda.env.create(env_name = 'deathstar', 30 | env_file = '/path/to/requirements.txt') 31 | conda.env.create(env_file = '/path/to/requirements.txt', 32 | env_path = '/home/user/software/deathstar') 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /man/conda.env.list.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/conda.R 3 | \name{conda.env.list} 4 | \alias{conda.env.list} 5 | \title{Wrapper function of 'conda env list', list the Conda environments} 6 | \usage{ 7 | conda.env.list(...) 8 | } 9 | \arguments{ 10 | \item{...}{Parameters pass to \code{\link{conda}}} 11 | } 12 | \description{ 13 | Wrapper function of 'conda env list', list the Conda environments 14 | } 15 | \examples{ 16 | \dontrun{ 17 | conda.env.list() 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /man/conda.list.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/conda.R 3 | \name{conda.list} 4 | \alias{conda.list} 5 | \title{Wrapper function of 'conda list', list linked packages in a conda environment.} 6 | \usage{ 7 | conda.list(env_name = "base", ...) 8 | } 9 | \arguments{ 10 | \item{env_name}{Name of environment, default is current} 11 | 12 | \item{...}{Parameters pass to \code{\link{conda}}} 13 | } 14 | \description{ 15 | Wrapper function of 'conda list', list linked packages in a conda environment. 16 | } 17 | \examples{ 18 | \dontrun{ 19 | conda.list() 20 | conda.list(env_name = 'your_env') 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /man/crawl.all.versions.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/crawl.R 3 | \name{crawl.all.versions} 4 | \alias{crawl.all.versions} 5 | \title{A function can be used to craw all source code from nongithub.cfg stored information} 6 | \usage{ 7 | crawl.all.versions(name, download.dir = "./", 8 | nongithub.cfg = c(system.file("extdata", 9 | "config/nongithub/nongithub.toml", package = "BioInstaller"), 10 | system.file("extdata", "config/db/db_main.toml", package = 11 | "BioInstaller"), system.file("extdata", "config/db/db_annovar.toml", 12 | package = "BioInstaller"), system.file("extdata", 13 | "config/db/db_blast.toml", package = "BioInstaller")), 14 | parse.extra.params = list(extra.list = list(), rcmd.parse = TRUE, 15 | bash.parse = TRUE, glue.parse = TRUE), license = "") 16 | } 17 | \arguments{ 18 | \item{name}{Software name} 19 | 20 | \item{download.dir}{Download destdir} 21 | 22 | \item{nongithub.cfg}{Configuration file of installed by non github url, 23 | default is system.file('extdata', 'config/nongithub/nongithub.toml', package='BioInstaller')} 24 | 25 | \item{parse.extra.params}{Other parameters pass to \code{\link[configr]{parse.extra}}} 26 | 27 | \item{license}{The BioInstaller download license code.} 28 | } 29 | \description{ 30 | A function can be used to craw all source code from nongithub.cfg stored information 31 | } 32 | \examples{ 33 | crawl.all.versions('demo') 34 | } 35 | -------------------------------------------------------------------------------- /man/del.info.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/info.R 3 | \name{del.info} 4 | \alias{del.info} 5 | \title{Delete biologly softwares infomation of system} 6 | \usage{ 7 | del.info(name = "", db = Sys.getenv("BIO_SOFTWARES_DB_ACTIVE", 8 | tempfile()), verbose = TRUE) 9 | } 10 | \arguments{ 11 | \item{name}{Software name} 12 | 13 | \item{db}{File saving softwares infomation} 14 | 15 | \item{verbose}{Ligical indicating wheather show the log message} 16 | } 17 | \value{ 18 | Bool Value 19 | } 20 | \description{ 21 | Delete biologly softwares infomation of system 22 | } 23 | \examples{ 24 | db <- sprintf('\%s/.BioInstaller', tempdir()) 25 | set.biosoftwares.db(db) 26 | change.info(name = 'bwa', installed = 'yes', source.dir = '', 27 | bin.dir = '', excutable.files = c('demo'), others.customer = 'demo') 28 | del.info('bwa') 29 | unlink(db) 30 | } 31 | -------------------------------------------------------------------------------- /man/docker.pull.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/docker.R 3 | \name{docker.pull} 4 | \alias{docker.pull} 5 | \title{Use docker to pull image} 6 | \usage{ 7 | docker.pull(repo, name, version = NULL, docker.bin = NULL, 8 | all.tags = FALSE, disable.content.trust = TRUE, verbose = TRUE) 9 | } 10 | \arguments{ 11 | \item{repo, }{Repository name of docker hub, e.g life2cloud} 12 | 13 | \item{name}{Software name, e.g bwa} 14 | 15 | \item{version}{Image version} 16 | 17 | \item{docker.bin}{Docker executable file, default is 'docker' in $PATH} 18 | 19 | \item{all.tags}{Download all tagged images in the repository} 20 | 21 | \item{disable.content.trust}{Skip image verification (default true)} 22 | 23 | \item{verbose}{Ligical indicating wheather show the log message} 24 | } 25 | \value{ 26 | Bool Value 27 | } 28 | \description{ 29 | Use docker to pull image 30 | } 31 | \examples{ 32 | docker.bin <- unname(Sys.which('docker')) 33 | if (docker.bin != '') { 34 | docker.pull(repo = 'learn', name = 'tutorial') 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /man/docker.search.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/docker.R 3 | \name{docker.search} 4 | \alias{docker.search} 5 | \title{Search softwares docker infomation in BioInstaller docker database} 6 | \usage{ 7 | docker.search(name, docker.db = system.file("extdata", 8 | "config/docker/docker.toml", package = "BioInstaller")) 9 | } 10 | \arguments{ 11 | \item{name}{Software name, e.g bwa} 12 | 13 | \item{docker.db}{A list including docker repo infomation, 14 | default to use built-in config/docker/docker.toml} 15 | } 16 | \value{ 17 | A list 18 | } 19 | \description{ 20 | Search softwares docker infomation in BioInstaller docker database 21 | } 22 | \examples{ 23 | docker.search('bwa') 24 | } 25 | -------------------------------------------------------------------------------- /man/figures/design_of_bioInstaller.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JhuangLab/BioInstaller/bb365f5bfb7cdfd61f2ac83ddff4277800a79955/man/figures/design_of_bioInstaller.jpg -------------------------------------------------------------------------------- /man/figures/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JhuangLab/BioInstaller/bb365f5bfb7cdfd61f2ac83ddff4277800a79955/man/figures/logo.png -------------------------------------------------------------------------------- /man/figures/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 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 | BioInstaller 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 71 | 72 | 73 | 74 | 76 | 78 | 80 | 82 | 84 | 86 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 158 | 159 | 160 | -------------------------------------------------------------------------------- /man/get.info.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/info.R 3 | \name{get.info} 4 | \alias{get.info} 5 | \title{Show biologly softwares infomation of system} 6 | \usage{ 7 | get.info(name = "", db = Sys.getenv("BIO_SOFTWARES_DB_ACTIVE", 8 | tempfile()), verbose = TRUE) 9 | } 10 | \arguments{ 11 | \item{name}{Software name} 12 | 13 | \item{db}{File saving softwares infomation} 14 | 15 | \item{verbose}{Ligical indicating wheather show the log message} 16 | } 17 | \value{ 18 | Bool Value 19 | } 20 | \description{ 21 | Show biologly softwares infomation of system 22 | } 23 | \examples{ 24 | db <- sprintf('\%s/.BioInstaller', tempdir()) 25 | set.biosoftwares.db(db) 26 | change.info(name = 'bwa', installed = 'yes', source.dir = '', 27 | bin.dir = '', excutable.files = c('demo'), others.customer = 'demo') 28 | get.info('bwa') 29 | unlink(db) 30 | } 31 | -------------------------------------------------------------------------------- /man/get.meta.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/meta.R 3 | \name{get.meta} 4 | \alias{get.meta} 5 | \title{Get meta information of BioInstaller collected sources, such as database, 6 | GitHub source, non-GitHub source, web source} 7 | \usage{ 8 | get.meta(value = NULL, config = NULL, get.meta.files.params = NULL, 9 | read.config.params = NULL) 10 | } 11 | \arguments{ 12 | \item{value}{Avaliable option for `db`, `github`, `nongithub`: `cfg_meta`, `item`; 13 | for web: `item`} 14 | 15 | \item{config}{Avaliable option: `db`, `db_meta_file`, `github`, `github_meta_file`, 16 | `nongithub`, `nongithub_meta_file`, `web`, `web_meta_file`} 17 | 18 | \item{get.meta.files.params}{Params pass to \code{\link{get.meta.files}}} 19 | 20 | \item{read.config.params}{Params pass to \code{\link[configr]{read.config}}} 21 | } 22 | \value{ 23 | List contain the meta files path of BioInstaller collected sources 24 | } 25 | \description{ 26 | Get meta information of BioInstaller collected sources, such as database, 27 | GitHub source, non-GitHub source, web source 28 | } 29 | \examples{ 30 | meta <- get.meta() 31 | db_cfg_meta <- get.meta(config = 'db', value = 'cfg_meta') 32 | db_meta_file <- get.meta(config = 'db_meta_file') 33 | db_cfg_meta_parsed <- get.meta(value = 'cfg_meta', config = 'db', 34 | read.config.params = list(rcmd.parse = TRUE)) 35 | } 36 | -------------------------------------------------------------------------------- /man/get.meta.files.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/meta.R 3 | \name{get.meta.files} 4 | \alias{get.meta.files} 5 | \title{Get all BioInstaller meta files path, such as database, 6 | GitHub source, non-GitHub source, web source} 7 | \usage{ 8 | get.meta.files(db.meta = system.file("extdata", "config/db/db_meta.toml", 9 | package = "BioInstaller"), github.meta = system.file("extdata", 10 | "config/github/github_meta.toml", package = "BioInstaller"), 11 | nongithub.meta = system.file("extdata", 12 | "config/nongithub/nongithub_meta.toml", package = "BioInstaller"), 13 | web.meta = system.file("extdata", "config/web/web_meta.toml", package = 14 | "BioInstaller")) 15 | } 16 | \arguments{ 17 | \item{db.meta}{Database source meta file path, default is 18 | system.file('extdata', 'config/db/db_meta.toml', package = 'BioInstaller')} 19 | 20 | \item{github.meta}{Github source meta file path, default is 21 | system.file('extdata', 'config/github/github_meta.toml', package = 'BioInstaller')} 22 | 23 | \item{nongithub.meta}{non-Github source meta file path, default is 24 | system.file('extdata', 'config/nongithub/nongithub_meta.toml', package = 'BioInstaller')} 25 | 26 | \item{web.meta}{Web source meta file path, default is 27 | system.file('extdata', 'config/web/web_meta.toml', package = 'BioInstaller')} 28 | } 29 | \value{ 30 | List contain the meta files path of BioInstaller collected sources 31 | } 32 | \description{ 33 | Get all BioInstaller meta files path, such as database, 34 | GitHub source, non-GitHub source, web source 35 | } 36 | \examples{ 37 | get.meta.files() 38 | } 39 | -------------------------------------------------------------------------------- /man/install.bioinfo.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/install.R 3 | \name{install.bioinfo} 4 | \alias{install.bioinfo} 5 | \title{Download and install biology software or database} 6 | \usage{ 7 | install.bioinfo(name = c(), download.dir = c(), destdir = c(), 8 | name.saved = NULL, github.cfg = system.file("extdata", 9 | "config/github/github.toml", package = "BioInstaller"), 10 | nongithub.cfg = c(system.file("extdata", 11 | "config/nongithub/nongithub.toml", package = "BioInstaller"), 12 | system.file("extdata", "config/db/db_main.toml", package = 13 | "BioInstaller"), system.file("extdata", "config/db/db_annovar.toml", 14 | package = "BioInstaller"), system.file("extdata", 15 | "config/db/db_blast.toml", package = "BioInstaller")), version = c(), 16 | local.source = NULL, show.all.versions = FALSE, 17 | show.all.names = FALSE, db = Sys.getenv("BIO_SOFTWARES_DB_ACTIVE", 18 | system.file("extdata", "demo/softwares_db_demo.yaml", package = 19 | "BioInstaller")), download.only = FALSE, decompress = TRUE, 20 | dependence.need = TRUE, showWarnings = FALSE, extra.list = list(), 21 | rcmd.parse = TRUE, bash.parse = TRUE, glue.parse = TRUE, 22 | glue.flag = "!!glue", save.to.db = TRUE, license = "", 23 | overwrite = FALSE, verbose = TRUE, ...) 24 | } 25 | \arguments{ 26 | \item{name}{Software name} 27 | 28 | \item{download.dir}{A string, point the source code download destdir} 29 | 30 | \item{destdir}{A string, point the install path} 31 | 32 | \item{name.saved}{Software name when you want to install different version, you 33 | can use this to point the installed softwares name like 'GATK-3.7'} 34 | 35 | \item{github.cfg}{Configuration file of installed by github url, 36 | default is system.file('extdata', 'config/github/github.toml', package='BioInstaller')} 37 | 38 | \item{nongithub.cfg}{Configuration file of installed by non github url, 39 | default is c(system.file('extdata', 'config/nongithub/nongithub.toml', package = 'BioInstaller'), 40 | system.file('extdata', 'config/db/db_main.toml', package = 'BioInstaller'), 41 | system.file('extdata', 'config/db/db_annovar.toml', package = 'BioInstaller'), 42 | system.file('extdata', 'config/db/db_blast.toml', package = 'BioInstaller'))} 43 | 44 | \item{version}{Software version} 45 | 46 | \item{local.source}{Install from local source, github softwares need a cloned dir, 47 | and nongithub softwares can be installed from a compressed file 48 | (if it is a dir, you need set decompress to FALSE)} 49 | 50 | \item{show.all.versions}{Logical wheather show all avaliable versions can be install} 51 | 52 | \item{show.all.names}{Logical wheather show all avaliable names can be install} 53 | 54 | \item{db}{File of saving softwares infomation, default is Sys.getenv('BIO_SOFTWARES_DB_ACTIVE', 55 | system.file('extdata', 'demo/softwares_db_demo.yaml', package = 'BioInstaller'))} 56 | 57 | \item{download.only}{Logicol indicating wheather only download source or file (non-github)} 58 | 59 | \item{decompress}{Logicol indicating wheather need to decompress the downloaded file, default is TRUE} 60 | 61 | \item{dependence.need}{Logical should the dependence should be installed} 62 | 63 | \item{showWarnings}{Logical should the warnings on failure be shown?} 64 | 65 | \item{extra.list}{A list that can replace the configuration file '{{debug}}' by list(debug = TRUE), and {{debug}} will be setted to TRUE} 66 | 67 | \item{rcmd.parse}{Logical wheather parse '@>@str_replace('abc', 'b', 'c')@<@' in config to 'acc'} 68 | 69 | \item{bash.parse}{Logical wheather parse '#>#echo $HOME#<#' in config to your HOME PATH} 70 | 71 | \item{glue.parse}{Logical wheather parse '!!glue{1:5}' in config to ['1','2','3','4','5']; 72 | ['nochange', '!!glue(1:5)', 'nochange'] => ['nochange', '1', '2', '3', '4', '5', 'nochange']} 73 | 74 | \item{glue.flag}{A character flage indicating wheater run glue() function to parse (Default is !!glue)} 75 | 76 | \item{save.to.db}{Ligical indicating wheather save the install infomation in db} 77 | 78 | \item{license}{The BioInstaller download license code.} 79 | 80 | \item{overwrite}{Force delete the destdir or download dir without a interactive message (careful)} 81 | 82 | \item{verbose}{Ligical indicating wheather show the log message} 83 | 84 | \item{...}{Other key and value paired need be saved in BioInstaller passed to \code{\link{change.info}}} 85 | } 86 | \value{ 87 | Bool Value or a list 88 | } 89 | \description{ 90 | Download and install biology software or database 91 | } 92 | \examples{ 93 | db <- sprintf('\%s/.BioInstaller', tempdir()) 94 | set.biosoftwares.db(db) 95 | \dontrun{ 96 | install.bioinfo('bwa', show.all.versions = TRUE) 97 | } 98 | unlink(db) 99 | } 100 | -------------------------------------------------------------------------------- /man/install.github.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/install.R 3 | \name{install.github} 4 | \alias{install.github} 5 | \title{Install or download softwares from Github} 6 | \usage{ 7 | install.github(name = "", download.dir = NULL, destdir = NULL, 8 | version = NULL, local.source = NULL, show.all.versions = FALSE, 9 | name.saved = NULL, github.cfg = system.file("extdata", 10 | "config/github/github.toml", package = "BioInstaller"), 11 | db = Sys.getenv("BIO_SOFTWARES_DB_ACTIVE", system.file("extdata", 12 | "demo/softwares_db_demo.yaml", package = "BioInstaller")), 13 | download.only = FALSE, showWarnings = FALSE, 14 | dependence.need = TRUE, extra.list = list(), rcmd.parse = TRUE, 15 | bash.parse = TRUE, glue.parse = TRUE, glue.flag = "!!glue", 16 | save.to.db = TRUE, overwrite = FALSE, verbose = TRUE, ...) 17 | } 18 | \arguments{ 19 | \item{name}{Software name} 20 | 21 | \item{download.dir}{A string, point the source code download destdir} 22 | 23 | \item{destdir}{A string, point the install path} 24 | 25 | \item{version}{Software version} 26 | 27 | \item{local.source}{Install from local source, github softwares need a cloned dir} 28 | 29 | \item{show.all.versions}{Logical wheather show all avaliable version can be install} 30 | 31 | \item{name.saved}{Software name when you want to install different version, you 32 | can use this to point the installed softwares name like 'GATK-3.7'} 33 | 34 | \item{github.cfg}{Configuration file of installed by github url, 35 | default is system.file('extdata', 'config/github/github.toml', package='BioInstaller')} 36 | 37 | \item{db}{File of saving softwares infomation, default is Sys.getenv('BIO_SOFTWARES_DB_ACTIVE', 38 | system.file('extdata', 'demo/softwares_db_demo.yaml', package = 'BioInstaller'))} 39 | 40 | \item{download.only}{Logicol indicating wheather only download source or file (non-github)} 41 | 42 | \item{showWarnings}{Logical should the warnings on failure be shown?} 43 | 44 | \item{dependence.need}{Logical should the dependence should be installed} 45 | 46 | \item{extra.list}{A list that can replace the configuration file '{{debug}}' by list(debug = TRUE), and {{debug}} will be setted to TRUE} 47 | 48 | \item{rcmd.parse}{Logical wheather parse '@>@str_replace('abc', 'b', 'c')@<@' in config to 'acc'} 49 | 50 | \item{bash.parse}{Logical wheather parse '#>#echo $HOME#<#' in config to your HOME PATH} 51 | 52 | \item{glue.parse}{Logical wheather parse '!!glue{1:5}' in config to ['1','2','3','4','5']; 53 | ['nochange', '!!glue(1:5)', 'nochange'] => ['nochange', '1', '2', '3', '4', '5', 'nochange']} 54 | 55 | \item{glue.flag}{A character flage indicating wheater run glue() function to parse (Default is !!glue)} 56 | 57 | \item{save.to.db}{Ligical indicating wheather save the install infomation in db} 58 | 59 | \item{overwrite}{Force delete the destdir or download dir without a interactive message (careful)} 60 | 61 | \item{verbose}{Ligical indicating wheather show the log message} 62 | 63 | \item{...}{Other key and value paired need be saved in BioInstaller passed to \code{\link{change.info}}} 64 | } 65 | \value{ 66 | Bool Value 67 | } 68 | \description{ 69 | Install or download softwares from Github 70 | } 71 | \examples{ 72 | db <- sprintf('\%s/.BioInstaller', tempdir()) 73 | set.biosoftwares.db(db) 74 | \dontrun{ 75 | install.github('bwa', show.all.versions = TRUE) 76 | } 77 | unlink(db) 78 | } 79 | -------------------------------------------------------------------------------- /man/install.nongithub.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/install.R 3 | \name{install.nongithub} 4 | \alias{install.nongithub} 5 | \title{Install or download softwares from non-Github Web site} 6 | \usage{ 7 | install.nongithub(name = "", download.dir = NULL, destdir = NULL, 8 | version = NULL, local.source = NULL, show.all.versions = FALSE, 9 | name.saved = NULL, nongithub.cfg = c(system.file("extdata", 10 | "config/nongithub/nongithub.toml", package = "BioInstaller"), 11 | system.file("extdata", "config/db/db_main.toml", package = 12 | "BioInstaller"), system.file("extdata", "config/db/db_annovar.toml", 13 | package = "BioInstaller"), system.file("extdata", 14 | "config/db/db_blast.toml", package = "BioInstaller")), 15 | db = Sys.getenv("BIO_SOFTWARES_DB_ACTIVE", system.file("extdata", 16 | "demo/softwares_db_demo.yaml", package = "BioInstaller")), 17 | download.only = FALSE, decompress = TRUE, dependence.need = TRUE, 18 | showWarnings = FALSE, extra.list = list(), rcmd.parse = TRUE, 19 | bash.parse = TRUE, glue.parse = TRUE, glue.flag = "!!glue", 20 | save.to.db = TRUE, overwrite = FALSE, verbose = TRUE, ...) 21 | } 22 | \arguments{ 23 | \item{name}{Software name} 24 | 25 | \item{download.dir}{A string, point the source code download destdir} 26 | 27 | \item{destdir}{A string, point the install path} 28 | 29 | \item{version}{Software version} 30 | 31 | \item{local.source}{Install from local source (a compressed file, 32 | if it is a dir, you need set decompress to FALSE)} 33 | 34 | \item{show.all.versions}{Logical wheather show all avaliable version can be install} 35 | 36 | \item{name.saved}{Software name when you want to install different version, you 37 | can use this to point the installed softwares name like 'GATK-3.7'} 38 | 39 | \item{nongithub.cfg}{Configuration file of installed by non github url, 40 | default is c(system.file('extdata', 'config/nongithub/nongithub.toml', package = 'BioInstaller'), 41 | system.file('extdata', 'config/db/db_main.toml', package = 'BioInstaller'), 42 | system.file('extdata', 'config/db/db_annovar.toml', package = 'BioInstaller'), 43 | system.file('extdata', 'config/db/db_blast.toml', package = 'BioInstaller'))} 44 | 45 | \item{db}{File of saving softwares infomation, default is Sys.getenv('BIO_SOFTWARES_DB_ACTIVE', 46 | system.file('extdata', 'demo/softwares_db_demo.yaml', package = 'BioInstaller'))} 47 | 48 | \item{download.only}{Logicol indicating wheather only download source or file (non-github)} 49 | 50 | \item{decompress}{Logicol indicating wheather need to decompress the downloaded file, default is TRUE} 51 | 52 | \item{dependence.need}{Logical should the dependence should be installed} 53 | 54 | \item{showWarnings}{Logical should the warnings on failure be shown?} 55 | 56 | \item{extra.list}{A list that can replace the configuration file '{{debug}}' by list(debug = TRUE), and {{debug}} will be setted to TRUE} 57 | 58 | \item{rcmd.parse}{Logical wheather parse '@>@str_replace('abc', 'b', 'c')@<@' in config to 'acc'} 59 | 60 | \item{bash.parse}{Logical wheather parse '#>#echo $HOME#<#' in config to your HOME PATH} 61 | 62 | \item{glue.parse}{Logical wheather parse '!!glue{1:5}' in config to ['1','2','3','4','5']; 63 | ['nochange', '!!glue(1:5)', 'nochange'] => ['nochange', '1', '2', '3', '4', '5', 'nochange']} 64 | 65 | \item{glue.flag}{A character flage indicating wheater run glue() function to parse (Default is !!glue)} 66 | 67 | \item{save.to.db}{Ligical indicating wheather save the install infomation in db} 68 | 69 | \item{overwrite}{Force delete the destdir or download dir without a interactive message (careful)} 70 | 71 | \item{verbose}{Ligical indicating wheather show the log message} 72 | 73 | \item{...}{Other key and value paired need be saved in BioInstaller passed to \code{\link{change.info}}} 74 | } 75 | \value{ 76 | Bool Value 77 | } 78 | \description{ 79 | Install or download softwares from non-Github Web site 80 | } 81 | \examples{ 82 | db <- sprintf('\%s/.BioInstaller', tempdir()) 83 | set.biosoftwares.db(db) 84 | \dontrun{ 85 | install.nongithub('gmap', show.all.versions = TRUE) 86 | } 87 | unlink(db) 88 | } 89 | -------------------------------------------------------------------------------- /man/is.biosoftwares.db.active.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/active.R 3 | \name{is.biosoftwares.db.active} 4 | \alias{is.biosoftwares.db.active} 5 | \title{Test active configuration file} 6 | \usage{ 7 | is.biosoftwares.db.active(biosoftwares.db) 8 | } 9 | \arguments{ 10 | \item{biosoftwares.db}{Configuration filename of bio-softwares db} 11 | } 12 | \value{ 13 | Logical indicating whether the specified configuration file is active 14 | } 15 | \description{ 16 | Check whether a Bio Softwares DB is active 17 | } 18 | \examples{ 19 | is.biosoftwares.db.active('config.cfg') 20 | } 21 | -------------------------------------------------------------------------------- /man/new.bioinfo.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/config.R 3 | \name{new.bioinfo} 4 | \alias{new.bioinfo} 5 | \title{Create new BioInstaller items to github forum} 6 | \usage{ 7 | new.bioinfo(config.file = "github.toml", title = "", 8 | description = "", publication = "") 9 | } 10 | \arguments{ 11 | \item{config.file}{github.toml, nongithub.toml, db_annovar.toml, db_main.toml, or new} 12 | 13 | \item{title}{Name of new item} 14 | 15 | \item{description}{Description of new item} 16 | 17 | \item{publication}{Publication of new item} 18 | } 19 | \description{ 20 | Create new BioInstaller items to github forum 21 | } 22 | \examples{ 23 | new.bioinfo('db_main.toml', 'test_item', 'Just is a test item', 'NA') 24 | } 25 | -------------------------------------------------------------------------------- /man/set.biosoftwares.db.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/active.R 3 | \name{set.biosoftwares.db} 4 | \alias{set.biosoftwares.db} 5 | \title{Set BIO_SOFWARES_DB_ACTIVE as the BioInstaller db} 6 | \usage{ 7 | set.biosoftwares.db(biosoftwares.db) 8 | } 9 | \arguments{ 10 | \item{biosoftwares.db}{Configuration filename of bio-softwares db} 11 | } 12 | \value{ 13 | Logical indicate wheather set db successful 14 | } 15 | \description{ 16 | Set BIO_SOFWARES_DB_ACTIVE as the BioInstaller db 17 | } 18 | \examples{ 19 | set.biosoftwares.db(sprintf('\%s/.BioInstaller', tempdir())) 20 | } 21 | -------------------------------------------------------------------------------- /man/show.installed.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/info.R 3 | \name{show.installed} 4 | \alias{show.installed} 5 | \title{Show all installed bio-softwares in system} 6 | \usage{ 7 | show.installed(db = Sys.getenv("BIO_SOFTWARES_DB_ACTIVE", tempfile()), 8 | only.installed = TRUE, verbose = TRUE) 9 | } 10 | \arguments{ 11 | \item{db}{File saving softwares infomation} 12 | 13 | \item{only.installed}{Logical wheather only show installed softwares in db} 14 | 15 | \item{verbose}{Ligical indicating wheather show the log message} 16 | } 17 | \value{ 18 | Bool Value 19 | } 20 | \description{ 21 | Show all installed bio-softwares in system 22 | } 23 | \examples{ 24 | db <- sprintf('\%s/.BioInstaller', tempdir()) 25 | set.biosoftwares.db(db) 26 | change.info(name = 'bwa', installed = 'yes', source.dir = '', 27 | bin.dir = '', excutable.files = c('demo'), others.customer = 'demo') 28 | show.installed() 29 | unlink(db) 30 | } 31 | -------------------------------------------------------------------------------- /man/spack.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/spack.R 3 | \name{spack} 4 | \alias{spack} 5 | \title{Wrapper function of spack} 6 | \usage{ 7 | spack(suffix_params = "", prefix_params = "", 8 | spack = Sys.which("spack"), ...) 9 | } 10 | \arguments{ 11 | \item{suffix_params}{Command line parameters of spack (prefix_params spack suffix_params)} 12 | 13 | \item{prefix_params}{Command line parameters of spack (prefix_params spack suffix_params)} 14 | 15 | \item{spack}{Default is Sys.which('spack')} 16 | 17 | \item{...}{Parameters pass to 'system'} 18 | } 19 | \description{ 20 | Wrapper function of spack 21 | } 22 | \examples{ 23 | \dontrun{ 24 | spack() 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /man/spack.list.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/spack.R 3 | \name{spack.list} 4 | \alias{spack.list} 5 | \title{Wrapper function of 'spack list', list and search available packages} 6 | \usage{ 7 | spack.list(...) 8 | } 9 | \arguments{ 10 | \item{...}{Parameters pass to \code{\link{spack}}} 11 | } 12 | \description{ 13 | Wrapper function of 'spack list', list and search available packages 14 | } 15 | \examples{ 16 | \dontrun{ 17 | spack.list() 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /tests/testthat.R: -------------------------------------------------------------------------------- 1 | library(testthat) 2 | library(BioInstaller) 3 | 4 | 5 | test_check("BioInstaller") 6 | -------------------------------------------------------------------------------- /tests/testthat/test_active.R: -------------------------------------------------------------------------------- 1 | if (!dir.exists(tempdir())) { 2 | dir.create(tempdir()) 3 | } 4 | test_that("is.biosoftwares.db.active",{ 5 | tmp.dir <- normalizePath(tempdir(), "/") 6 | db <- sprintf('%s/test', tmp.dir) 7 | db <- normalizePath(db, "/", mustWork = FALSE) 8 | x <- is.biosoftwares.db.active(db) 9 | expect_that(x, equals(FALSE)) 10 | set.biosoftwares.db(db) 11 | x <- do.call(is.biosoftwares.db.active, list(db)) 12 | expect_that(x, equals(TRUE)) 13 | unlink(db, recursive = TRUE, TRUE) 14 | }) 15 | -------------------------------------------------------------------------------- /tests/testthat/test_docker.R: -------------------------------------------------------------------------------- 1 | docker.bin <- unname(Sys.which('docker')) 2 | if (docker.bin != '') { 3 | docker.pull(repo = 'learn', name = 'tutorial') 4 | docker.search('bwa') 5 | } 6 | -------------------------------------------------------------------------------- /tests/testthat/test_info.R: -------------------------------------------------------------------------------- 1 | if (!dir.exists(tempdir())) { 2 | dir.create(tempdir()) 3 | } 4 | db <- sprintf('%s/.BioInstaller', tempdir()) 5 | unlink(db) 6 | set.biosoftwares.db(db) 7 | test_that("info", { 8 | x <- change.info(name = "demo", installed = "yes", debug = TRUE, verbose = F) 9 | expect_that(x, equals(TRUE)) 10 | x <- get.info(name = "demo") 11 | expect_that(is.list(x), equals(TRUE)) 12 | x <- del.info(name = "demo") 13 | expect_that(x, equals(TRUE)) 14 | x <- NULL 15 | x <- tryCatch({ 16 | get.info(name = "demo") 17 | }, warning = function(w){ 18 | x <- FALSE 19 | return(x) 20 | }) 21 | expect_that(x, equals(FALSE)) 22 | x <- change.info(name = "demo", installed = "yes", debug = TRUE, verbose = F) 23 | x <- change.info(name = "demo1", installed = "no", debug = TRUE, verbose = F) 24 | x <- show.installed() 25 | expect_that(as.character(x), equals('demo')) 26 | }) 27 | 28 | temps <- list.files(tempdir(), ".*") 29 | unlink(sprintf("%s/%s", tempdir(), temps), recursive = TRUE, TRUE) 30 | -------------------------------------------------------------------------------- /tests/testthat/test_install.R: -------------------------------------------------------------------------------- 1 | if (!dir.exists(tempdir())) { 2 | dir.create(tempdir()) 3 | } 4 | db <- sprintf('%s/.BioInstaller', tempdir()) 5 | set.biosoftwares.db(db) 6 | 7 | test_that("install.github", { 8 | x <- tryCatch(RCurl::getURL("https://github.com"), error = function(e){message("Connect Github failed. Please check the network.");NULL}) 9 | if (!is.null(x)) { 10 | destdir <- sprintf('%s/github_demo0', tempdir()) 11 | destdir <- normalizePath(destdir, "/", FALSE) 12 | x <- install.github(name = "github_demo", destdir = destdir, 13 | download.dir = destdir, verbose = F) 14 | expect_that(x, equals(TRUE)) 15 | unlink(destdir, recursive = T, TRUE) 16 | destdir <- sprintf('%s/github_demo1', tempdir()) 17 | destdir <- normalizePath(destdir, "/", FALSE) 18 | x <- suppressWarnings(install.github(show.all.versions = T, verbose = F)) 19 | expect_that(x, equals(FALSE)) 20 | destdir <- sprintf('%s/bwa', tempdir()) 21 | destdir <- normalizePath(destdir, "/", FALSE) 22 | x <- install.github(name = "bwa", show.all.versions = T, verbose = F) 23 | expect_that(is.character(x), equals(TRUE)) 24 | unlink(destdir, recursive = T, TRUE) 25 | x <- tryCatch(install.github(name = list(), show.all.versions = T, verbose = F), error = function(e) {return(FALSE)}) 26 | expect_that(is.character(x), equals(FALSE)) 27 | unlink(destdir, recursive = T, TRUE) 28 | destdir <- sprintf('%s/github_demo2', tempdir()) 29 | destdir <- normalizePath(destdir, "/", FALSE) 30 | x <- install.github(name = "github_demo", destdir = destdir, 31 | download.dir = destdir, verbose = F, download.only = TRUE) 32 | expect_that(x, equals(TRUE)) 33 | unlink(destdir, recursive = T, TRUE) 34 | } else { 35 | message("Please check RCurl::getURL('https://github.com')") 36 | } 37 | }) 38 | 39 | test_that("install.nongithub", { 40 | destdir <- sprintf('%s/demo0', tempdir()) 41 | destdir <- normalizePath(destdir, "/", FALSE) 42 | x <- tryCatch(install.nongithub('demo', destdir = destdir, verbose = F), 43 | warning = function(w) {NULL}) 44 | if (!is.null(x) && is.logical(x) && x) { 45 | expect_that(x, equals(TRUE)) 46 | expect_that(is.list(get.info('demo')), equals(TRUE)) 47 | unlink(destdir, recursive = T, TRUE) 48 | x <- install.nongithub('demo', destdir = destdir, verbose = F, download.only = T) 49 | expect_that(as.logical(x), equals(TRUE)) 50 | unlink(destdir, recursive = T, TRUE) 51 | } else { 52 | message("Please check install.nongithub('demo', destdir = destdir, verbose = F)") 53 | expect_that(is.null(x) || is.logical(x), equals(TRUE)) 54 | } 55 | }) 56 | 57 | test_that("install.bioinfo", { 58 | destdir <- sprintf('%s/demo1', tempdir()) 59 | destdir <- normalizePath(destdir, "/", FALSE) 60 | x <- tryCatch(install.bioinfo('demo', destdir = destdir, verbose = F), 61 | error = function(e) {message(e); NULL}) 62 | if (!is.null(x) && is.list(x) && "demo" %in% x$success.list) { 63 | expect_that("demo" %in% x$success.list, equals(TRUE)) 64 | expect_that(is.list(get.info('demo')), equals(TRUE)) 65 | unlink(destdir, recursive = T, TRUE) 66 | 67 | destdir <- sprintf('%s/github_demo3', tempdir()) 68 | destdir <- normalizePath(destdir, "/", FALSE) 69 | unlink(destdir, recursive = T, TRUE) 70 | } else { 71 | message("Please check install.bioinfo('demo', destdir = destdir, verbose = F)") 72 | expect_that(is.null(x) || is.list(x), equals(TRUE)) 73 | expect_that("demo" %in% x$fail.list, equals(TRUE)) 74 | } 75 | x <- tryCatch(install.bioinfo(name = "github_demo", destdir = destdir, 76 | download.dir = destdir, verbose = F), 77 | error = function(e) { 78 | message("Connecting Github website failed (SSL possible)."); NULL 79 | }) 80 | if (!is.null(x)) expect_that("github_demo" %in% x$success.list, equals(TRUE)) 81 | unlink(destdir, recursive = T, TRUE) 82 | }) 83 | 84 | unlink(db) 85 | temps <- list.files(tempdir(), ".*") 86 | unlink(sprintf("%s/%s", tempdir(), temps), recursive = TRUE, TRUE) 87 | -------------------------------------------------------------------------------- /tests/testthat/test_install_utils.R: -------------------------------------------------------------------------------- 1 | if (!dir.exists(tempdir())) { 2 | dir.create(tempdir()) 3 | } 4 | test_that("db.check", { 5 | db <- sprintf('%s/config.db', tempdir()) 6 | db <- normalizePath(db, "/", FALSE) 7 | x <- db.check(db) 8 | expect_that(x, equals(TRUE)) 9 | unlink(db) 10 | }) 11 | test_that("config.and.name.initial", { 12 | config.cfg <- system.file("extdata", "config/github/github.toml", package = "BioInstaller") 13 | x <- config.and.name.initial(config.cfg, "bwa") 14 | expect_that(x, equals(TRUE)) 15 | x <- check.configfile.validate(config.cfg) 16 | expect_that(x, equals(TRUE)) 17 | config.cfg <- system.file("extdata", "config.error.toml", package = "configr") 18 | x <- tryCatch({ 19 | x <- check.configfile.validate(config.cfg) 20 | }, warning = function(w) { 21 | return(FALSE) 22 | }) 23 | expect_that(x, equals(FALSE)) 24 | }) 25 | 26 | 27 | test_that("initial",{ 28 | config.cfg <- system.file("extdata", "config/github/github.toml", package = "BioInstaller") 29 | x <- NULL 30 | tryCatch({ 31 | x <- check.install.name(NULL, config.cfg) 32 | }, warning = function(w) { 33 | x <- FALSE 34 | }) 35 | expect_that(x, equals(NULL)) 36 | config.cfg <- system.file("extdata", "config/github/github.toml", package = "BioInstaller") 37 | x <- config.and.name.initial(config.cfg, "bwa") 38 | config <- eval.config(config = "bwa", file = config.cfg) 39 | versions <- tryCatch(show.avaliable.versions(config), 40 | error = function(e) {message("Featch bwa version failed."); NULL}) 41 | if (!is.null(versions)) { 42 | params <- list(name = "bwa", version = "v0.7.15", versions = versions, config = config) 43 | x <- do.call(version.initial, params) 44 | expect_that(x, equals("v0.7.15")) 45 | } 46 | x <- tryCatch({ 47 | x <- check.configfile.validate(config.cfg) 48 | }, warning = function(w) {}, error = function(e){ 49 | x <- TRUE 50 | return(x) 51 | }) 52 | expect_that(x, equals(TRUE)) 53 | }) 54 | 55 | test_that("set.makedir", { 56 | old.workdir <- getwd() 57 | tmp.dir <- normalizePath(tempdir(), "/") 58 | makedir.1 <- sprintf("%s/setmakedir/test_makedir1", tmp.dir) 59 | makedir.2 <- sprintf("%s/setmakedir/test_makedir2", tmp.dir) 60 | destdir <- sprintf("%s/setmakedir", tmp.dir) 61 | destdir <- normalizePath(destdir, "/", FALSE) 62 | makedir.1 <- normalizePath(makedir.1, "/", FALSE) 63 | makedir.2 <- normalizePath(makedir.2, "/", FALSE) 64 | params <- list(make.dir = makedir.1, destdir = destdir) 65 | do.call(set.makedir, params) 66 | expect_that(getwd(), equals(destdir)) 67 | dir.create(makedir.1) 68 | params <- list(make.dir = makedir.1, destdir = destdir) 69 | do.call(set.makedir, params) 70 | expect_that(getwd(), equals(makedir.1)) 71 | params <- list(make.dir = makedir.2, destdir = destdir) 72 | do.call(set.makedir, params) 73 | expect_that(getwd(), equals(destdir)) 74 | setwd(old.workdir) 75 | unlink(destdir, recursive = T, TRUE) 76 | }) 77 | 78 | test_that("dependence",{ 79 | db <- sprintf('%s/.BioInstaller', tempdir()) 80 | unlink(db) 81 | set.biosoftwares.db(db) 82 | x <- change.info(name = "demo", installed = "yes", debug = TRUE, verbose = F, version = '1.0') 83 | x <- check.need.install('demo', '1.0', db) 84 | expect_that(x, equals(TRUE)) 85 | config.cfg <- system.file("extdata", "config/github/github.toml", package = "BioInstaller") 86 | x <- get.need.install(eval.config(config = "bcftools", file = config.cfg), db) 87 | expect_that(is.list(x), equals(TRUE)) 88 | expect_that(x[[1]][1], equals('htslib')) 89 | destdir <- sprintf('%s/', tempdir()) 90 | destdir <- normalizePath(destdir, "/", FALSE) 91 | x <- tryCatch(install.dependence('github_demo', 'master', destdir, destdir, F), 92 | error = function(e) {message("Connecting Github website failed."); NULL}) 93 | if (!is.null(x)) { 94 | expect_that(x, equals(TRUE)) 95 | unlink(destdir, recursive=TRUE, TRUE) 96 | x <- process.dependence(eval.config(config = "github_demo", file = config.cfg), db, destdir, destdir, FALSE) 97 | expect_that(x, equals(TRUE)) 98 | unlink(destdir, recursive=TRUE, TRUE) 99 | } 100 | }) 101 | 102 | 103 | test_that("git.download",{ 104 | destdir <- sprintf('%s/denpendence1', tempdir()) 105 | destdir <- normalizePath(destdir, "/", FALSE) 106 | unlink(destdir, recursive = TRUE, TRUE) 107 | url <- "https://github.com/Miachol/github_demo" 108 | x <- tryCatch(git.download("github_demo", destdir, "master", 109 | url, TRUE, FALSE, FALSE), 110 | error = function(e) {NULL}) 111 | expect_that(is.null(x) || x, equals(TRUE)) 112 | unlink(destdir, recursive=TRUE, TRUE) 113 | }) 114 | 115 | temps <- list.files(tempdir(), ".*") 116 | unlink(sprintf("%s/%s", tempdir(), temps), recursive = TRUE, TRUE) 117 | -------------------------------------------------------------------------------- /tests/testthat/test_meta.R: -------------------------------------------------------------------------------- 1 | if (!dir.exists(tempdir())) { 2 | dir.create(tempdir()) 3 | } 4 | test_that("get.meta",{ 5 | x <- get.meta.files() 6 | expect_that(is.list(x), equals(TRUE)) 7 | expect_that(x[[1]] != "", equals(TRUE)) 8 | expect_that(x[[2]] != "", equals(TRUE)) 9 | expect_that(x[[3]] != "", equals(TRUE)) 10 | expect_that(x[[4]] != "", equals(TRUE)) 11 | x <- get.meta() 12 | expect_that(is.list(x), equals(TRUE)) 13 | x <- get.meta(config = "db", value = "cfg_meta") 14 | expect_that(is.list(x), equals(TRUE)) 15 | x <- get.meta(config = "db_meta_file") 16 | expect_that(is.character(x), equals(TRUE)) 17 | }) 18 | -------------------------------------------------------------------------------- /tests/testthat/test_utils.R: -------------------------------------------------------------------------------- 1 | if (!dir.exists(tempdir())) { 2 | dir.create(tempdir()) 3 | } 4 | test_that("extract.file with decompress", { 5 | workdir <- tempdir() 6 | dir.create(sprintf("%s/tmp/", workdir)) 7 | dir.create(sprintf("%s/tmp1/", workdir)) 8 | test.file <- sprintf("%s/tmp1/test", workdir) 9 | file.create(test.file) 10 | gzip(test.file) 11 | x <- extract.file(sprintf("%s.gz", test.file), paste0(workdir, "/tmp")) 12 | expect_that(x, equals(TRUE)) 13 | unlink(sprintf('%s/tmp', workdir), recursive=TRUE, TRUE) 14 | unlink(sprintf('%s/tmp1', workdir), recursive=TRUE, TRUE) 15 | }) 16 | 17 | test_that("extract.file with decompress", { 18 | workdir <- tempdir() 19 | dir.create(sprintf("%s/tmp/", workdir)) 20 | dir.create(sprintf("%s/tmp1/", workdir)) 21 | test.file <- sprintf("%s/tmp1/test", workdir) 22 | file.create(test.file) 23 | gzip(test.file) 24 | x <- extract.file(sprintf("%s.gz", test.file), paste0(workdir, "/tmp"), decompress = FALSE) 25 | expect_that(x, equals(TRUE)) 26 | unlink(sprintf('%s/tmp', workdir), recursive=TRUE, TRUE) 27 | unlink(sprintf('%s/tmp1', workdir), recursive=TRUE, TRUE) 28 | }) 29 | 30 | test_that("drop_redundance_dir", { 31 | test.dir <- sprintf("%s/test_drop", tempdir()) 32 | dir.create(test.dir) 33 | dir.create(sprintf("%s/a", test.dir)) 34 | file.create(sprintf("%s/a/b1", test.dir)) 35 | dir.create(sprintf("%s/a/b", test.dir)) 36 | dir.create(sprintf("%s/a/c", test.dir)) 37 | x <- drop_redundance_dir(test.dir) 38 | expect_that(x, equals(TRUE)) 39 | expect_that(file.exists(sprintf("%s/b1", test.dir)), equals(TRUE)) 40 | expect_that(dir.exists(sprintf("%s/b", test.dir)), equals(TRUE)) 41 | expect_that(dir.exists(sprintf("%s/c", test.dir)), equals(TRUE)) 42 | unlink(test.dir, recursive=TRUE, TRUE) 43 | }) 44 | 45 | test_that("is.file.empty", { 46 | test.file <- sprintf("%s/1", tempdir()) 47 | file.create(test.file) 48 | x <- is.file.empty(test.file) 49 | expect_that(x, equals(TRUE)) 50 | unlink(test.file) 51 | }) 52 | 53 | test_that("get.os", { 54 | x <- get.os() 55 | x <- x %in% c('centos', 'ubuntu', 'arch', 'other', 'windows', 'mac') 56 | expect_that(x, equals(TRUE)) 57 | }) 58 | 59 | test_that("runcmd & for_runcmd", { 60 | cmd <- "" 61 | x <- runcmd(cmd, verbose = FALSE) 62 | expect_that(x, equals(0)) 63 | destdir <- normalizePath(tempdir(), "/", FALSE) 64 | cmd <- sprintf("echo 123 > %s/123", destdir) 65 | x <- runcmd(cmd, verbose = FALSE) 66 | expect_that(x, equals(0)) 67 | cmd <- rep("", 3) 68 | x <- for_runcmd(cmd, verbose = FALSE) 69 | expect_that(x, equals(rep(0,3))) 70 | cmd <- rep(sprintf("echo 123 > %s/123", destdir), 3) 71 | x <- for_runcmd(cmd, verbose = FALSE) 72 | expect_that(x, equals(rep(0,3))) 73 | unlink(sprintf('%s/123', destdir), TRUE) 74 | cmd <- "#R#Sys.setenv(R_TEST= 'rtest')#R#" 75 | runcmd(cmd, verbose = FALSE) 76 | expect_that(Sys.getenv("R_TEST") == "rtest", equals(TRUE)) 77 | }) 78 | 79 | test_that("get.subconfig", { 80 | config.1 <- list() 81 | x <- get.subconfig(config.1, "empty") 82 | expect_that(x, equals("")) 83 | config.1 <- list(debug=TRUE) 84 | x <- get.subconfig(config.1, "debug") 85 | expect_that(x, equals(TRUE)) 86 | config.1 <- list(install = list(windows = "w", mac = "m", linux = "l")) 87 | x <- get.subconfig(config.1, "install") 88 | expect_that(x %in% c("w", "m", "l"), equals(TRUE)) 89 | expect_that(sum(x %in% c("w", "m", "l")), equals(1)) 90 | }) 91 | 92 | test_that("get.file.type", { 93 | filetype.lib <- c("tgz", "tar.xz", "tar.bz2", "tar.gz", "tar", "gz", "zip", 94 | "bz2", "xz") 95 | filenames <- sprintf("test.%s", filetype.lib) 96 | x <- sapply(filenames, function(x) {get.file.type(x)}) 97 | x <- unname(x) 98 | expect_that(x, equals(filetype.lib)) 99 | }) 100 | 101 | test_that("download.file.custom", { 102 | url <- "https://github.com/Miachol/ftp/blob/master/files/GRCh37_MT_ensGene.txt" 103 | destfile <- sprintf("%s/GRCh37", tempdir()) 104 | x <- tryCatch(download.file.custom(url, destfile, quiet = T), 105 | warning= function(w) {NULL}) 106 | if (!is.null(x)) expect_that(x, equals(0)) 107 | else expect_that(x, equals(NULL)) 108 | unlink(destfile) 109 | }) 110 | 111 | 112 | test_that("destdir.initial",{ 113 | test.dir <- sprintf('%s/destdir.initial', tempdir()) 114 | x <- destdir.initial(test.dir, FALSE, TRUE) 115 | expect_that(x, equals(TRUE)) 116 | unlink(test.dir, recursive = T, TRUE) 117 | }) 118 | 119 | test_that("is.null.na",{ 120 | x <- is.null.na(NULL) 121 | expect_that(x, equals(TRUE)) 122 | x <- is.null.na(NA) 123 | expect_that(x, equals(TRUE)) 124 | }) 125 | 126 | test_that("destdir.initial", { 127 | test.dir <- sprintf('%s/destdir.initial', tempdir()) 128 | dir.create(test.dir) 129 | x <- destdir.initial(test.dir, TRUE, FALSE) 130 | expect_that(x, equals(TRUE)) 131 | file.create(sprintf('%s/1', test.dir)) 132 | x <- destdir.initial(test.dir, TRUE, FALSE) 133 | expect_that(x, equals(FALSE)) 134 | x <- destdir.initial(test.dir, FALSE, FALSE) 135 | expect_that(x, equals(FALSE)) 136 | }) 137 | 138 | #test_that("download.file.custom is.dir", { 139 | # url <- "ftp://ftp.sjtu.edu.cn/pub/CPAN/clpa/" 140 | # x <- download.file.custom(url, tempdir(), TRUE) 141 | # expect_that(x, equals(0)) 142 | # x <- file.exists(sprintf('%s/%s', tempdir(), c('README', 'index.html'))) 143 | # expect_that(all(x), equals(TRUE)) 144 | #}) 145 | temps <- list.files(tempdir(), ".*") 146 | unlink(sprintf("%s/%s", tempdir(), temps), recursive = TRUE, TRUE) 147 | 148 | 149 | -------------------------------------------------------------------------------- /tests/testthat/test_versions.R: -------------------------------------------------------------------------------- 1 | if (!dir.exists(tempdir())) { 2 | dir.create(tempdir()) 3 | } 4 | test_that("nongithub.versions",{ 5 | x <- tryCatch(nongithub2versions("gmap"), error = function(e) { 6 | message("Connecting Gmap website failed. Please try it later.") 7 | NULL 8 | }) 9 | if (!is.null(x)) expect_that(length(x) > 1, equals(TRUE)) else { 10 | expect_that(x, equals(NULL)) 11 | } 12 | }) 13 | temps <- list.files(tempdir(), ".*") 14 | unlink(sprintf("%s/%s", tempdir(), temps), recursive = TRUE, TRUE) 15 | -------------------------------------------------------------------------------- /vignettes/BioInstaller.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Introduction to R functions of BioInstaller" 3 | author: "Jianfeng Li" 4 | date: "`r Sys.Date()`" 5 | output: 6 | prettydoc::html_pretty: 7 | toc: true 8 | theme: cayman 9 | highlight: github 10 | pdf_document: 11 | toc: true 12 | vignette: > 13 | %\VignetteIndexEntry{Introduction to R functions of BioInstaller} 14 | %\VignetteEngine{knitr::rmarkdown} 15 | \usepackage[utf8]{inputenc} 16 | %\VignetteEncoding{UTF-8} 17 | --- 18 | 19 | ```{r, echo = FALSE} 20 | knitr::opts_chunk$set(comment = "#>", collapse = TRUE, screenshot.force = FALSE) 21 | ``` 22 | 23 | ## Introduction 24 | 25 | in this vignette, you can learn the R functions usage of BioInstaller R package. 26 | 27 | Key points: 28 | 29 | - How to set the database to store installation information. 30 | - How to featch the versions of a item? 31 | - How to download and install a tool/script or database? 32 | - How to get the installation information? 33 | 34 | ## Core R functions 35 | 36 | Function `set.biosoftwares.db()` can be used to set a database file saving the information of installed software and database. 37 | 38 | Next, you can use the function `install.bioinfo(show.all.names = TRUE)` get all soteware and database supported by BioInstaller. 39 | 40 | ```{r} 41 | library(BioInstaller) 42 | set.biosoftwares.db(tempfile()) 43 | # Show all avaliable softwares/dependece in default inst/extdata/config/github/github.toml 44 | # and inst/extdata/config/nongithub/nongithub.toml 45 | x <- install.bioinfo(show.all.names = TRUE) 46 | ``` 47 | ```{r echo = FALSE} 48 | suppressWarnings( 49 | DT::datatable(matrix(x, ncol=3), caption = sprintf("Items supported by BioInstaller")) 50 | ) 51 | ``` 52 | 53 | When setting the `show.all.versions` to `TRUE`, the versions of software and database will be returned. 54 | 55 | ```{r eval = FALSE} 56 | # Fetching versions of softwares 57 | install.bioinfo(name = 'samtools', show.all.versions = TRUE) 58 | ``` 59 | 60 | Parameter `verbose` in `install.bioinfo` can be used to show the extra debug information. 61 | 62 | Besides, if you only want to download the source code or raw database files to a specific directory, the parameter `download.dir` and `download.only`are required. 63 | 64 | ```{r eval = FALSE} 65 | # Install 'demo' with debug infomation 66 | download.dir <- sprintf('%s/demo_2', tempdir()) 67 | install.bioinfo('demo', download.dir = download.dir, verbose = TRUE) 68 | 69 | # Download demo source code 70 | download.dir <- sprintf('%s/demo_3', tempdir()) 71 | install.bioinfo('demo', download.dir = download.dir, 72 | download.only = TRUE, verbose = TRUE) 73 | ``` 74 | 75 | After finishing the download step, typically, you need to install the software by running several commands or an installation script. BioInstaller stores the related installation script or commands in the configuration files, and you can one-click to install the related software or database. 76 | 77 | Besides, BioInstaller will pass several parameters to installation command or script. Just like `destdir` of `./configure --prefix={{destdir}}; make; make install` for compiling C program. 78 | 79 | It is optional to create `bin` directory in the `destdir`, and copy all the executable files in it. The `bin` in `destdir` can be set in the variable `PATH` for re-use in any other working directory. 80 | 81 | If you want to download the source code in `A` directory and install it to `B` directory, you need to simultaneously set the parameters `destdir` and `download.dir`in function `install.bioinfo`. 82 | 83 | ```{r eval = FALSE} 84 | # Set download.dir and destdir (destdir like /usr/local 85 | # including bin, lib, include and others), 86 | # destdir will work if install step {{destdir}} be used 87 | download.dir <- sprintf('%s/demo_source', tempdir()) 88 | destdir <- sprintf('%s/demo', tempdir()) 89 | install.bioinfo('demo', download.dir = download.dir, destdir = destdir) 90 | ``` 91 | 92 | ## Saved informations after installation 93 | 94 | It is important to save related information of installation. This step can help you to use the software or database in the other pipeline. So, after installed the software and database, BioInstaller will save the information, such as software name, version, path, update time, in the database file set by function `set.biosoftwares.db()`, which also defined by environment variable `BIO_SOFWARES_DB_ACTIVE`. 95 | 96 | ```{r eval = FALSE} 97 | temp.db <- tempfile() 98 | set.biosoftwares.db(temp.db) 99 | is.biosoftwares.db.active(temp.db) 100 | 101 | # Install 'demo' quite 102 | download.dir <- sprintf('%s/demo_1', tempdir()) 103 | install.bioinfo('demo', download.dir = download.dir, verbose = FALSE) 104 | ``` 105 | 106 | Function `get.info()` can be used to get the saved information of installed software and databases. 107 | 108 | When you want to delete the saved information, you can use function `del.info`. 109 | 110 | ```{r eval = FALSE} 111 | config <- get.info('demo') 112 | config 113 | 114 | config <- configr::read.config(temp.db) 115 | config$demo$comments <- 'This is a demo.' 116 | params <- list(config.dat = config, file.path = temp.db) 117 | do.call(configr::write.config, params) 118 | get.info('demo') 119 | del.info('demo') 120 | ``` 121 | 122 | ## Local mode 123 | 124 | Local mode of BioInstaller was useful when you have downloaded the source code or database file, and have not run the install steps. 125 | 126 | Tips: 127 | 128 | - Github software/database: a cloned directory were required 129 | - Non-github software/database: a decompressed directory or a compressed archive. 130 | 131 | ```{r eval = FALSE} 132 | download.dir <- sprintf('%s/github_demo_local', tempdir()) 133 | install.bioinfo('github_demo', download.dir = download.dir, download.only = TRUE, verbose = FALSE) 134 | install.bioinfo('github_demo', local.source = download.dir) 135 | 136 | download.dir <- sprintf('%s/demo_local', tempdir()) 137 | install.bioinfo('demo_2', download.dir = download.dir, download.only = TRUE, verbose = FALSE) 138 | install.bioinfo('demo_2', download.dir = download.dir, local.source = sprintf('%s/GRCh37_MT_ensGene.txt.gz', download.dir), decompress = TRUE) 139 | ``` 140 | 141 | ## Download all versions 142 | 143 | Function `craw.all.version` is the simplest method to download all available URL files in nongithub or database files. 144 | 145 | ```{r eval = FALSE} 146 | download.dir <- sprintf('%s/crawl.all.versions', tempdir()) 147 | crawl.all.versions('demo', download.dir = download.dir) 148 | ``` 149 | 150 | ## Meta information of software and database 151 | 152 | Function `get.meta` can be used to get all software and databases meta information, such as description and publication, supported by BioInstaller. 153 | 154 | ```{r} 155 | # Get all meta source files 156 | meta_files <- get.meta.files() 157 | meta_files 158 | 159 | # Get all of meta informaton in BioInstaller 160 | meta <- get.meta() 161 | names(meta) 162 | meta[1:4] 163 | meta$db$cfg_meta 164 | meta$db$item$atcircdb 165 | 166 | # Examples of get.meta 167 | db_cfg_meta <- get.meta(value = "cfg_meta", config = 'db') 168 | db_cfg_meta 169 | 170 | db_cfg_meta_parsed <- get.meta(value = 'cfg_meta', config = 'db', read.config.params = list(rcmd.parse = TRUE)) 171 | db_cfg_meta_parsed 172 | 173 | db_cfg_meta <- get.meta(config = 'github', value = 'item') 174 | db_cfg_meta$bwa 175 | 176 | # Get databases meta file 177 | db_meta_file <- get.meta(config = 'db_meta_file') 178 | db_meta_file 179 | db_meta_file <- meta_files[["db_meta_file"]] 180 | db_meta_file 181 | ``` 182 | 183 | ## Download database 184 | 185 | Database files are required for almost all bioinformatics data analysis pipeline, especially for sequence mapping and annotation steps. We hope BioInstaller can help you to access these resources easily in R, and you can use the function `install.bioinfo` directly download the supported databases. 186 | 187 | ```{r} 188 | # get all database name 189 | library(stringr) 190 | x <- install.bioinfo(show.all.names = T) 191 | x <- x[str_detect(x, "^db_|reffa|bundle")] 192 | suppressWarnings( 193 | DT::datatable(matrix(x, ncol=3), caption = sprintf("Database supported by BioInstaller (n=%s)", length(x))) 194 | ) 195 | 196 | # all databases config 197 | db_cfg_meta <- get.meta(config = 'db', value = 'cfg_meta', 198 | read.config.params=list(rcmd.parse = TRUE)) 199 | cfg_dir <- db_cfg_meta$cfg_dir 200 | cfg_dir 201 | avaliable_cfg <- db_cfg_meta$avaliable_cfg 202 | avaliable_cfg 203 | sprintf("%s/%s", cfg_dir, avaliable_cfg) 204 | ``` 205 | 206 | Just like [ANNOVAR](http://annovar.openbioinformatics.org/en/latest/) and [Bioconductor](http://www.bioconductor.org/) have done, we hope to establish a integrated and shared database pool in this tool. 207 | 208 | ```{r} 209 | # ANNOVAR 210 | download.dir <- sprintf('%s/db_annovar', tempdir()) 211 | config.toml <- system.file("extdata", "config/db/db_annovar.toml", 212 | package = "BioInstaller") 213 | #install.bioinfo('db_ucsc_refgene', download.dir = download.dir, 214 | # nongithub.cfg = config.toml, extra.list = list(buildver = "hg19")) 215 | 216 | # db_main 217 | download.dir <- sprintf('%s/db_main', tempdir()) 218 | config.toml <- system.file("extdata", "config/db/db_main.toml", 219 | package = "BioInstaller") 220 | install.bioinfo('db_diseaseenhancer', download.dir = download.dir, 221 | nongithub.cfg = config.toml) 222 | ``` 223 | 224 | ## Write you own configuration file 225 | 226 | If the software and database have not been supported by BioInstaller, you can write your own `YAML` or `TOML` format configuration file. A related [vignette](https://life2cloud.com/tools/bioinstaller/articles/write_configuration_file.html) can help you to do this. 227 | 228 | ## Session info 229 | 230 | Here is the output of `sessionInfo()` on the system on which this document was compiled: 231 | 232 | ```{r echo=FALSE} 233 | sessionInfo() 234 | ``` 235 | -------------------------------------------------------------------------------- /vignettes/download.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Download Source Code of BioInstaller" 3 | author: "Jianfeng Li" 4 | date: "`r Sys.Date()`" 5 | output: 6 | prettydoc::html_pretty: 7 | toc: true 8 | theme: cayman 9 | highlight: github 10 | pdf_document: 11 | toc: true 12 | vignette: > 13 | %\VignetteIndexEntry{Download Source Code of BioInstaller} 14 | %\VignetteEngine{knitr::rmarkdown} 15 | \usepackage[utf8]{inputenc} 16 | %\VignetteEncoding{UTF-8} 17 | --- 18 | 19 | ```{r, echo = FALSE} 20 | knitr::opts_chunk$set(comment = "#>", collapse = TRUE, screenshot.force = FALSE) 21 | ``` 22 | 23 | ## Github 24 | 25 | Github: https://github.com/JhuangLab/BioInstaller 26 | 27 | ## CRAN 28 | 29 | CRAN: https://CRAN.R-project.org/package=BioInstaller 30 | 31 | ## JhuangLab host 32 | 33 | 2018.11 Temporarily suspend service. 34 | -------------------------------------------------------------------------------- /vignettes/items_description.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Description of supported items" 3 | author: "Jianfeng Li" 4 | date: "`r Sys.Date()`" 5 | output: 6 | prettydoc::html_pretty: 7 | toc: true 8 | theme: cayman 9 | highlight: github 10 | pdf_document: 11 | toc: true 12 | vignette: > 13 | %\VignetteIndexEntry{Description of supported items} 14 | %\VignetteEngine{knitr::rmarkdown} 15 | \usepackage[utf8]{inputenc} 16 | %\VignetteEncoding{UTF-8} 17 | --- 18 | 19 | ```{r, echo = FALSE} 20 | knitr::opts_chunk$set(comment = "#>", collapse = TRUE, screenshot.force = FALSE) 21 | get_dt <- function(item) { 22 | Name <- names(item) 23 | Description <- unname(unlist(lapply(item, function(x){ 24 | if (is.na(x["description"])) return("") 25 | return(x["description"])})) 26 | ) 27 | Publication <- unname(unlist(lapply(item, function(x){ 28 | if (is.na(x["publication"])) return("") 29 | return(x["publication"])})) 30 | ) 31 | data.frame(Name, Description) 32 | } 33 | ``` 34 | 35 | ## Description of supported items 36 | 37 | Partial meta information of tools/scripts and databases are saved in the followed files. 38 | You can get the file list by command `unname(unlist(get.meta()[1:4]))`. 39 | 40 | We do not show the meta information of [annovarR](https://github.com/JhuangLab/BioInstaller/blob/master/inst/extdata/config/db/db_annovar.toml) supported items in this vignette. 41 | 42 | ```{r} 43 | library(BioInstaller) 44 | meta_info <- get.meta(read.config.params = list(rcmd.parse = TRUE)) 45 | unname(unlist(meta_info[1:4])) 46 | ``` 47 | 48 | The followed tables show partial items description that have been collected in BioInstaller package including `Github items`, `Non-github items` and `Database items`. 49 | 50 | ### Github items 51 | 52 | ```{r echo = FALSE} 53 | DT::datatable(get_dt(meta_info$github$item), escape = FALSE) 54 | ``` 55 | 56 | ### Non-github items 57 | 58 | ```{r echo = FALSE} 59 | DT::datatable(get_dt(meta_info$nongithub$item), escape = FALSE) 60 | ``` 61 | 62 | ### Database items 63 | 64 | ```{r echo = FALSE} 65 | DT::datatable(get_dt(meta_info$db$item), escape = FALSE) 66 | ``` 67 | 68 | ## A curated list of resources for learning bioinformatics 69 | 70 | BioInstaller also provides a simplified and curated list of resources for learning bioinformatics, such as sequencing method, web service, command-line tools and database resources. You can get it from [here](https://github.com/JhuangLab/Bioinformatics-Resources). 71 | 72 | -------------------------------------------------------------------------------- /vignettes/start_bioshiny.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Start the bioshiny Application" 3 | author: "Jianfeng Li" 4 | date: "`r Sys.Date()`" 5 | output: 6 | prettydoc::html_pretty: 7 | toc: true 8 | theme: cayman 9 | highlight: github 10 | pdf_document: 11 | toc: true 12 | vignette: > 13 | %\VignetteIndexEntry{Start the BioInstaller Shiny Application} 14 | %\VignetteEngine{knitr::rmarkdown} 15 | \usepackage[utf8]{inputenc} 16 | %\VignetteEncoding{UTF-8} 17 | --- 18 | 19 | ```{r setup, include=FALSE} 20 | knitr::opts_chunk$set(echo = TRUE, screenshot.force = FALSE, comment = "#>", collapse = TRUE) 21 | ``` 22 | 23 | ## Introduction 24 | 25 | Shiny application of BioInstaller has been supported since v0.3.5. A pre-built [Docker image](https://hub.docker.com/r/bioinstaller/bioinstaller/) can help you to start all configured BioInstaller services in one-click, which includes the R (v3.4.4), Opencpu server, Shiny server, and latest BioInstaller. 26 | 27 | ## How to deploy the BioInstaller using Docker 28 | 29 | You need install the [Docker](https://docs.docker.com/install/) program for futher opreations. It is required for running any Docker image including BioInstaller. 30 | 31 | ```{bash eval=FALSE} 32 | docker pull bioinstaller/bioinstaller 33 | docker run -it -p 80:80 -p 8004:8004 -v /tmp/download:/tmp/download bioinstaller/bioinstaller 34 | ``` 35 | 36 | When the docker container of BioInstaller was created, you can access the three types of web service in the browser. 37 | 38 | - localhost/ocpu/ Opencpu server 39 | - localhost/shiny/BioInstaller Shiny server 40 | - localhost/rstudio/ Rstudio server (opencpu/opencpu) 41 | 42 | ### Opencpu server 43 | 44 | ![](https://raw.githubusercontent.com/Miachol/ftp/master/files/images/bioinstaller/opencpu.png) 45 | 46 | ```bash 47 | #Show all items supported by BioInstaller 48 | curl http://localhost/ocpu/library/BioInstaller/R/install.bioinfo -d \ 49 | "show.all.names=TRUE" X POST 50 | #Show all versions of Bwa 51 | curl http://localhost/ocpu/library/BioInstaller/R/install.bioinfo \ 52 | -d "name='bwa', show.all.versions=TRUE" -X POST 53 | 54 | #Download and install latest Bwa 55 | curl http://localhost/ocpu/library/BioInstaller/R/install.bioinfo \ 56 | -d "name='bwa', destdir='/opt/aliner/bwa'" -X POST 57 | # Download 1000 Genome Project annotation database 58 | curl http://localhost:5656/ocpu/library/BioInstaller/R/install.bioinfo \ 59 | -d "name='db_annovar_1000g', destdir = '/opt/annovardb', \ 60 | extra.list=list(buildver='hg19')" -X POST 61 | 62 | # Get the character key and retrieve the output 63 | # Get the JSON format value of returned output 64 | curl http://localhost/ocpu/tmp/{key}/R/.val/json 65 | # Get the text format value of returned output 66 | curl http://localhost/ocpu/tmp/{key}/R/.val/text 67 | # Get the function ‘print’ output of returned value 68 | curl http://localhost/ocpu/tmp/{key}/R/.val/print 69 | ``` 70 | 71 | ### Shiny server 72 | 73 | Open browser and input the URL "localhost/shiny/BioInstaller". It will activate a Shiny session and start the BioInstaller Shiny application. 74 | 75 | ![](https://raw.githubusercontent.com/Miachol/ftp/master/files/images/bioinstaller/shiny.png) 76 | 77 | ### Rstudio server 78 | 79 | The [Rstudio server](https://www.rstudio.com/products/rstudio-server/) was provided for users to connect the docker container just like in the desktop version of Rstudio. 80 | 81 | ![](https://raw.githubusercontent.com/Miachol/ftp/master/files/images/bioinstaller/rstudio.png) 82 | 83 | ## How to start the standalone Shiny service of bioshiny 84 | 85 | If the users can not to run a docker image, the standalone shiny service of bioshiny is an another way to start the service. 86 | 87 | ```bash 88 | echo 'export BIO_SOFTWARES_DB_ACTIVE="~/.bioshiny/info.yaml" >> ~/.bashrc' 89 | echo 'export BIOSHINY_CONFIG="~/.bioshiny/shiny.config.yaml" >> ~/.bashrc' 90 | . ~/.bashrc 91 | 92 | # Start the standalone Shiny application 93 | wget https://raw.githubusercontent.com/openbiox/bioshiny/master/bin/bioshiny_deps_r 94 | wget https://raw.githubusercontent.com/openbiox/bioshiny/master/bin/bioshiny_start 95 | chmod a+x bioshiny_deps_r 96 | chmod a+x bioshiny_start 97 | ./bioshiny_deps_r 98 | 99 | # Start Shiny application workers 100 | Rscript -e "bioshiny::set_shiny_workers(1)" 101 | ./bioshiny_start 102 | 103 | # or use yarn 104 | yarn global add bioshiny 105 | bioshiny_deps_r 106 | Rscript -e "bioshiny::set_shiny_workers(1)" 107 | bioshiny_start 108 | ``` 109 | 110 | ```{r eval=FALSE} 111 | # If the bioshiny R package has not been installed, 112 | # you need execute the followed commands: 113 | # devtools::install_github('openbiox/bioshiny/src/bioshiny') 114 | # It is better to start the worker in another background processor 115 | bioshiny::set_shiny_workers(3) 116 | bioshiny::web(auto_create = TRUE) 117 | ``` 118 | -------------------------------------------------------------------------------- /vignettes/write_configuration_file.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Write BioInstaller Configuration File" 3 | author: "Jianfeng Li" 4 | date: "`r Sys.Date()`" 5 | output: 6 | prettydoc::html_pretty: 7 | toc: true 8 | theme: cayman 9 | highlight: github 10 | pdf_document: 11 | toc: true 12 | vignette: > 13 | %\VignetteIndexEntry{Write Your Own Configuration File} 14 | %\VignetteEngine{knitr::rmarkdown} 15 | \usepackage[utf8]{inputenc} 16 | %\VignetteEncoding{UTF-8} 17 | --- 18 | 19 | ```{r, echo = FALSE} 20 | knitr::opts_chunk$set(comment = "#>", collapse = TRUE, screenshot.force = FALSE) 21 | ``` 22 | 23 | Configuration files in BioInstaller are important. We used these configuration files to stored the software and databases URL, the script of installation, and other useful information. 24 | 25 | Most of the configuration files are parsed by [configr](https://github.com/Miachol/configr). Compared with original configr package syntax `#R# R CMD #R#` is a different point. It can be used to mark those R format command. 26 | 27 | ## github.toml, nongithub.toml and db.toml 28 | 29 | Built-in configuration files: `github.toml`, `nongithub.toml` and `db.toml (db_annovar.toml/db_main.toml, nongithub.toml format)` can be used to download and install several software and database. `install.bioinfo(show.all.names = TRUE)` can be used to get all of avaliable softwares and databases existed in github.toml and nongithub.toml. 30 | 31 | ### Softwares and databases deposited on Github 32 | 33 | Variables to control the download and installation steps of software and databases deposited on github: 34 | 35 | - If you set `use_git2r` to `false`, BioInstaller will use the [git](https://en.wikipedia.org/wiki/Git) of your system. 36 | - If you set `use_git2r` to `false` and setted `recursive_clone` to `true`, BioInstaller will run this command `git clone --recursive https://path/repo` 37 | - You can use the `before_install` stored the pre-installation steps 38 | - The `install` mainly be used to store the installation steps. Besides, you can use your own installation script and setted it to `#R# system('/path/yourscript')#R#` 39 | - The `make_dir` is the compile directory of software and database. Because the workdir of R default will be set to `download.dir`, and need be changed to `make_dir` finish `install` steps. 40 | - All [Bitbucket](https://bitbucket.org) repo should set 'bitbucket' to 'true' (e.g. snakemake in [github.toml](https://github.com/JhuangLab/BioInstaller/blob/master/inst/extdata/config/github/github.toml)) 41 | 42 | ```toml 43 | [bwa] 44 | github_url = "https://github.com/lh3/bwa" 45 | after_failure = "echo 'fail!'" 46 | after_success = "echo 'successful!'" 47 | make_dir = ["./"] 48 | bin_dir = ["./"] 49 | 50 | [bwa.before_install] 51 | linux = "" 52 | mac = "" 53 | 54 | [bwa.install] 55 | linux = "make" 56 | mac = "make" 57 | ``` 58 | 59 | Github software version control can be done by `git2r` package and github tag [API](https://developer.github.com/v3). Source URL of software or files deposited in github can be found by `github_url` in `github.toml`. 60 | 61 | ### Softwares and databases of non-github 62 | 63 | Variables to control the download and installation steps of software and databases not be deposited on github: 64 | 65 | - `github_url` be replaced by `source_url` 66 | - If you want to download multiple files in the source_url, you need to set `url_all_download` to `true`. 67 | - [rvest](https://cran.r-project.org/package=rvest) and [RCurl](https://cran.r-project.org/package=RCurl) packages can be used to parse the version information of software or databases of non-github. 68 | - If you don't want to use the built-in version reorder function, you need to set `version_order_fixed` to `true`. Optional, if the file count of source code was only one, you can set `url_all_download` to `false` and writing multiple URL. It will help you to avoid the invalid URL caused download fail. 69 | 70 | ```toml 71 | [gmap] 72 | # {{version}} will be parsed to your install.bioinfo `version` parameter 73 | # or the newest version parsed from fetched data. 74 | source_url = "http://research-pub.gene.com/gmap/src/{{version}}.tar.gz" 75 | after_failure = "echo 'fail!'" 76 | after_success = "echo 'successful!'" 77 | make_dir = ["./"] 78 | bin_dir = ["./"] 79 | 80 | [gmap.before_install] 81 | linux = "" 82 | mac = "" 83 | 84 | [gmap.install] 85 | linux = "./configure --prefix=`pwd` && make && make install" 86 | mac = ["sed -i s/\"## CFLAGS='-O3 -m64' .*\"/\"CFLAGS='-O3 -m64'\"/ config.site", 87 | "./configure --prefix=`pwd` && make && make install"] 88 | ``` 89 | 90 | Version control of non-github software and databases need a function parsing URL and use `{{version}}` to replace in the `source_url`. 91 | 92 | Besides, BioInstaller uses [configr](https://github.com/Miachol/configr) `glue` to reduce the length of files name. It can help you to use less word to store more files name. 93 | 94 | ```{r} 95 | library(configr) 96 | library(BioInstaller) 97 | blast.databases <- system.file('extdata', 98 | 'config/db/db_blast.toml', package = 'BioInstaller') 99 | 100 | read.config(blast.databases)$db_blast_nr$source_url 101 | x <- read.config(blast.databases, glue.parse = TRUE)$db_blast_nr$source_url 102 | length(x) 103 | head(x) 104 | mask.github <- tempfile() 105 | file.create(mask.github) 106 | install.bioinfo(nongithub.cfg = blast.databases, github.cfg = mask.github, 107 | show.all.names = TRUE) 108 | ``` 109 | 110 | ## Reading from BIO_SOFTWARES_DB_ACTIVE database 111 | 112 | To resolve some software dependence, BioInstaller using the `{{key:value}}` format expression, and get its value from B`BIO_SOFWARES_DB_ACTIVE` database. 113 | 114 | For example, `htslib` is the dependence of Pindel, and we use `./INSTALL {{htslib:source.dir}}` as the install step of Pindel. In the session of R, the value of `{{htslib:source.dir}}` will be replaced by the real value stored in `BIO_SOFTWARES_DB_ACTIVE` or `db` in `install.bioinfo` function. 115 | 116 | ## Parsing from `install.bioinfo` parameter `extra.list` 117 | 118 | To improve the flexibility of configuration templet, BioInstall using the `{{parameters}}` format expression to get the function `install.bioinfo` parameter `extra.list`. Noteably, the `name`, `version`, `os.version`, `destdir` were default pass to `extra.list`. 119 | 120 | For example, source_url of `GMAP` need the `version` value, and we use `source_url = "http://research-pub.gene.com/gmap/src/{{version}}.tar.gz"` as the download URL. In the session of R, the `{{version}}` will be replaced by the `version` parameter value of `install.bioinfo` (if the version were `NULL`, it will be set to be the newest version). 121 | 122 | ## More operation of configuration file 123 | 124 | [configr](https://github.com/Miachol/configr) was another package to parse the configuration file. More examples can be found in [here](https://github.com/Miachol/configr). 125 | --------------------------------------------------------------------------------