Skip to content

Repeatedly generate an embryonic repository with one command

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
license.md
Notifications You must be signed in to change notification settings

OuhscBbmc/pluripotent

Repository files navigation

pluripotent

Repeatedly generate an embryonic repository with one command.

Like a pluripotent stem cell, this package will generate new cells/projects. These offspring repos are more specialized, and will exist to do real work (as opposed to exist to generate more stem cells).

The inst/metadata/file-to-copy.csv file describes the source and destination of transferred files. The two projects currently natively supported are:

A new project/repo called 'beasley-poc-1' can be generated in two ways:

  1. Run this single chunk of code, after updating the project_name and destination_directory arguments.

    remotes::install_github(repo="OuhscBbmc/pluripotent")
    pluripotent::start_cdw_skeleton_1(
      project_name            = "beasley-poc-1",
      destination_directory   = "~/bbmc/cdw"
    )
  2. The cdw-template-1 repo provides a platform to jump-start consistent repos for CDW projects. Once it's used as a GitHub template, the utility/spawn.R file contains the following dynamic code that should run without modification.

    # Install remotes & pluripotent if not already installed.  pluripotent won't reinstall if it's already up-to-date.
    if( !requireNamespace("remotes") ) utils::install.packages("remotes")
    remotes::install_github("OuhscBbmc/pluripotent")
    
    # Discover repo name & parent directory.
    project_name          <- basename(normalizePath(".."))
    project_parent_path   <- normalizePath("..\\..")
    
    # Copy remote files to the current repo.
    pluripotent::start_cdw_skeleton_1(
    project_name          = project_name,
    destination_directory = project_parent_path
    )
    
    # Afterwards, close RStudio and open the *.Rproj file in the root directory.

    To spawn a cdw repo (i.e., a repo whose template is cdw-template-1):

    1. open utility/spawn.R directly in RStudio & run the whole file (i.e., ctrl+shift+r)
    2. after it completes, close RStudio
    3. commit & push the repo. A typical commit message is

      populate repo files

      closes #1 (or whatever issue number corresponds to 'initialize repo')

    4. go up one directory (to the repo root) and open the *.Rproj file.
    5. Do Science 🥇
  3. To update a config file that's downloaded from the skeleton's config file, run this instead of spawning a new repo. This scenario comes up when refitting older repos to newer standards.

    pluripotent::populate_config("config.yml", basename(getwd())

@andkov, as I'm describing this, I see the resemblance to a factory pattern in software. But the stem cell metaphor is both flowery and abstruse, which seems to be what you and I go for when we're attaching metaphors.

Installation and Documentation

The development version can be installed from GitHub after installing the remotes package.

install.packages("pluripotent") # Run this line if the 'remotes' package isn't installed already.
remotes::install_github(repo="OuhscBbmc/pluripotent")

The package can be uninstalled from your local machine with remove.packages("pluripotent").

Build Status and Package Characteristics

GitHub Travis-CI AppVeyor Coveralls
Main Build Status Build status Coverage Status
Dev Build Status Build status Coverage Status
Ubuntu LTS Windows Server Test Coverage
Key Value
License License: MIT

About

Repeatedly generate an embryonic repository with one command

Topics

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
license.md

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages