| ExtGenerator {biodb} | R Documentation |
The mother class of all generators for biodb extension packages.
All generator classes for biodb extensions must inherit from this class.
new()Initializer.
ExtGenerator$new( path, loadCfg = TRUE, saveCfg = TRUE, pkgName = getPkgName(path), email = "author@e.mail", dbName = "foo.db", dbTitle = "Foo database", pkgLicense = getLicenses(), firstname = "Firstname of author", lastname = "Lastname of author", newPkg = FALSE, connType = getConnTypes(), entryType = getEntryTypes(), editable = FALSE, writable = FALSE, remote = FALSE, downloadable = FALSE, makefile = FALSE, travis = FALSE, rcpp = FALSE, vignetteName = "intro", githubRepos = getReposName(path, default = "myaccount/myrepos") )
pathThe path to the package folder.
loadCfgSet to FALSE to disable loading of tag values from config file "biodb_ext.yml".
saveCfgSet to FALSE to disable saving of tag values into config file "biodb_ext.yml".
pkgNameThe package name. If set to NULL, the folder name pointer by the "path" paramater will be used as the package name.
emailThe email of the author.
dbNameThe name of the database (in biodb format "my.db.name"), that will be used in "definitions.yml" file and for connector and entry classes.
dbTitleThe official name of the database (e.g.: HMDB, UniProtKB, KEGG).
pkgLicenseThe license of the package.
firstnameThe firstname of the author.
lastnameThe lastname of the author.
newPkgSet to TRUE if the package is not yet published on Bioconductor.
connTypeThe type of connector class to implement.
entryTypeThe type of entry class to implement.
editableSet to TRUE to allow the generated connector to create new entries in memory.
writableSet to TRUE to enable the generated connector to write into the database.
remoteSet to TRUE if the database to connect to is not local.
downloadableSet to TRUE if the database needs to be downloaded or offers this possiblity.
makefileSet to TRUE if you want a Makefile to be generated.
travisSet to TRUE if you want a .travis.yml file to be generated.
rcppSet to TRUE to enable Rcpp C/C++ code inside the package.
vignetteNameSet to the name of the default/main vignette.
githubReposSet to the name of the associated GitHub repository. Example: myaccount/myrepos.
Nothing.
generate()Generates the destination file(s).
ExtGenerator$generate(overwrite = FALSE, fail = TRUE)
overwriteIf set to TRUE and destination files exist, overwrite the destination files.
failIf set to FALSE, do not fail if destination files exist, just do nothing and return.
# Generate a new extension package: pkgFolder <- file.path(tempfile(), 'biodbFoo') biodb::ExtPackage$new(pkgFolder)$generate()
upgrade()Upgrade the destination file(s).
ExtGenerator$upgrade(generate = TRUE)
generateIf set to FALSE, and destination file(s) do not exist, then do not generate them.
clone()The objects of this class are cloneable with this method.
ExtGenerator$clone(deep = FALSE)
deepWhether to make a deep clone.
# Generate a new connector class inside the R folder:
pkgFolder <- file.path(tempfile(), 'biodbFoo')
dir.create(pkgFolder, recursive=TRUE)
biodb::ExtConnClass$new(path=pkgFolder, dbName='foo.db',
dbTitle='Foo database',
connType='mass', remote=TRUE)$generate()
## ------------------------------------------------
## Method `ExtGenerator$generate`
## ------------------------------------------------
# Generate a new extension package:
pkgFolder <- file.path(tempfile(), 'biodbFoo')
biodb::ExtPackage$new(pkgFolder)$generate()