ExtGenerator | 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 = getPkgName(path), githubRepos = getReposName(path, default = "myaccount/myrepos") )
path
The path to the package folder.
loadCfg
Set to FALSE to disable loading of tag values from config file "biodb_ext.yml".
saveCfg
Set to FALSE to disable saving of tag values into config file "biodb_ext.yml".
pkgName
The package name. If set to NULL, the folder name pointer by the "path" paramater will be used as the package name.
email
The email of the author.
dbName
The name of the database (in biodb format "my.db.name"), that will be used in "definitions.yml" file and for connector and entry classes.
dbTitle
The official name of the database (e.g.: HMDB, UniProtKB, KEGG).
pkgLicense
The license of the package.
firstname
The firstname of the author.
lastname
The lastname of the author.
newPkg
Set to TRUE if the package is not yet published on Bioconductor.
connType
The type of connector class to implement.
entryType
The type of entry class to implement.
editable
Set to TRUE to allow the generated connector to create new entries in memory.
writable
Set to TRUE to enable the generated connector to write into the database.
remote
Set to TRUE if the database to connect to is not local.
downloadable
Set to TRUE if the database needs to be downloaded or offers this possiblity.
makefile
Set to TRUE if you want a Makefile to be generated.
travis
Set to TRUE if you want a .travis.yml file to be generated.
rcpp
Set to TRUE to enable Rcpp C/C++ code inside the package.
vignetteName
Set to the name of the default/main vignette.
githubRepos
Set to the name of the associated GitHub repository. Example: myaccount/myrepos.
Nothing.
generate()
Generates the destination file(s).
ExtGenerator$generate(overwrite = FALSE, fail = TRUE)
overwrite
If set to TRUE and destination files exist, overwrite the destination files.
fail
If 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)
generate
If 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)
deep
Whether 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()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.