Learn R Programming

The pepr package: Portable Encapsulated Projects in R

pepr is an R package for reading Portable Encapsulated Projects, or PEPs, in R. If you describe your project (configuration and samples) according to this format, you can load all project metadata into R using the pepr package. To test pepr, you can try loading one of the example PEPs.

Complete documentation and API for the pepr R package is at code.databio.org/pepr.

Quick start:

Install from CRAN:

install.packages("pepr")

Load a project and explore metadata like this:

library("pepr")
cfgPath = system.file(
    "extdata",
    "example_peps-master",
    "example_basic",
    "project_config.yaml",
    package = "pepr"
  )
p = Project(file = cfgPath)

sampleTable(p)
config(p)

Copy Link

Version

Install

install.packages('pepr')

Monthly Downloads

223

Version

0.5.0

License

BSD_2_clause + file LICENSE

Maintainer

Nathan Sheffield

Last Published

November 21st, 2023

Functions in pepr (0.5.0)

.getSampleTablePathFromConfig

Get the sample table from config
.makeAbsPath

Create an absolute path from a primary target and a parent candidate.
sampleTable

View samples in the objects of "Project"
.isCfg

Config file or annotation file
getSample

Extract samples
pepr

pepr
getSubsample

Extract subsamples
fetchSamples

Collect samples fulfilling the specified requirements
.isValidUrl

Determine whether the string is a valid URL
.strformat

Format a string like python's format method
.safeFileExists

Check whether the string is a valid URL or an existing local path
.matchesAndRegexes

Create a list of matched files in the system and unmatched regular expessions
.isAbsolute

Determine whether a path is absolute.
.removeAttrs

Remove attributes across all the samples
.inferProjectName

Infer project name
select-config

Access "Config" object elements
listAmendments

List amendments
.loadSubsampleAnnotation

Load single subsample annotation
.printNestedList

Print a nested list
.reformat

Check config spec version and reformat if needed
.deriveAttrs

Derive attributes
makeSectionsAbsolute

Make selected sections absolute using config path
.loadConfig

Load the config of a PEP
.listifyDF

Listify data frame columns
.mergeAttrs

Merge samples defined in sample table with ones in subsample table(s)
.modifySamples

Perform all the sample attribute modifications
checkSection

Check for existence of a section in the Project config
.appendAttrs

Append constant attributes across all the samples
config

Extract "Project"
Config-class

Config objects and specialized list obejcts and expand string attributes
activateAmendments

Activate amendments in objects of "Project"
Project-class

Portable Encapsulated Project object
Project

The constructor of a class representing a Portable Encapsulated Project
.applyAmendments

Apply amendments
.duplicateAttrs

Duplicate a selected attribute across all the samples
.getSubSampleTablePathFromConfig

Get the subsample tables from config
.autoMergeDuplicatedNames

Merge samples with identical names
.getSubscript

Get list subscript
.expandPath

Expand system path
.applyImports

Function for recursive config data imports
.expandList

Recursively try to expand list of strings
.getTableIndexes

Set table indexes
.implyAttrs

Imply attributes
.loadSampleAnnotation

Read sample table from disk
.checkSection

Check for a section existence in a nested list