Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@

CNAME
test.sh
.github
.github
^cran-comments\.md$
2 changes: 1 addition & 1 deletion .github/workflows/R-CMD-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
config:
- {os: windows-latest, r: 'release'}
- {os: macOS-latest, r: 'release'}
- {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
- {os: ubuntu-latest, r: 'release'}

env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ docs
doc
Meta
pepr.Rcheck/
pepr_*.tar.gz
pepr_*.tar.gz
cran-comments.md
22 changes: 11 additions & 11 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
Package: pepr
Type: Package
Title: Reading Portable Encapsulated Projects
Version: 0.5.0
Date: 2023-11-16
Version: 0.6.0
Date: 2026-02-27
Authors@R: c(person("Nathan", "Sheffield", email = "nathan@code.databio.org",
role = c("aut", "cph","cre")),person("Michal","Stolarczyk",email="michal@virginia.edu",role=c("aut")))
Maintainer: Nathan Sheffield <nathan@code.databio.org>
Description: A PEP, or Portable Encapsulated Project, is a dataset that
Description: A PEP, or Portable Encapsulated Project, is a dataset that
subscribes to the PEP structure for organizing metadata. It is written using
a simple YAML + CSV format, it is your one-stop solution to metadata
management across data analysis environments. This package reads this
standardized project configuration structure into R.
a simple YAML + CSV format, it is your one-stop solution to metadata
management across data analysis environments. This package reads this
standardized project configuration structure into R.
Described in Sheffield et al. (2021) <doi:10.1093/gigascience/giab077>.
Imports:
yaml,
stringr,
pryr,
data.table,
methods,
RCurl
RCurl,
httr2
Suggests:
knitr,
testthat,
testthat (>= 3.1.2),
rmarkdown,
curl
VignetteBuilder: knitr
License: BSD_2_clause + file LICENSE
BugReports: https://github.com/pepkit/pepr
RoxygenNote: 7.2.3
BugReports: https://github.com/pepkit/pepr/issues
RoxygenNote: 7.3.3
Encoding: UTF-8
5 changes: 4 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,17 @@ export(getSample)
export(getSubsample)
export(listAmendments)
export(makeSectionsAbsolute)
export(pullProject)
export(sampleTable)
export(saveJWT)
export(saveProject)
exportClasses(Config)
exportClasses(Project)
exportMethods("$")
exportMethods("[")
exportMethods("[[")
import(RCurl)
import(pryr)
import(httr2)
import(stringr)
import(yaml)
importFrom(methods,as)
Expand Down
27 changes: 26 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
# pepr 0.6.0 - 2026-02-27

## Added

* `pullProject()` to fetch PEPs from PEPhub API via registry paths (e.g., `databio/example:default`)
* `saveProject()` to write a Project object to local files (config YAML + sample CSVs)
* `saveJWT()` to store an authentication token for private PEPs
* PEPhub integration vignette examples in Getting Started guide

## Changed

* Replaced `httr` with `httr2` for PEPhub API calls
* Replaced `tidyr` dependency with base R for subsample unnesting
* Added mocked tests for PEPhub API (CRAN-compatible)
* Graceful error handling when PEPhub API is unreachable

# pepr 0.5.1 - 2026-02-27

## Changed

* Removed dependency on archived `pryr` package; replaced `pryr::partial()` with base R anonymous functions
* Fixed BugReports URL in DESCRIPTION
* Updated all pep.databio.org URLs to current paths
* Removed codecov badge from README

# pepr 0.5.0 - 2023-11-16

## Fixed
Expand Down Expand Up @@ -55,7 +80,7 @@

## Changed

* **project configuration file to follow [PEP2.0.0 specification](http://pep.databio.org/en/2.0.0/specification/).** Browse the specification for changes related to config format
* **project configuration file to follow [PEP2.0.0 specification](https://pep.databio.org/spec/specification/).** Browse the specification for changes related to config format


# pepr 0.2.2 - 2020-01-09
Expand Down
15 changes: 10 additions & 5 deletions R/config.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ setMethod("initialize", "Config", function(.Object, data) {
#' @export
#' @rdname Config-class
Config = function(file, amendments = NULL) {
### if the config from the Project constructor is a list and not a filepath, it is from a PEP fetched from PEPhub
if (typeof(file) == 'list') {
config = methods::new("Config", data = file)
return(config)
}
message("Loading config file: ", file)
cfg_data = .loadConfig(filename = file, amendments = amendments)
config = methods::new("Config", data = cfg_data)
Expand Down Expand Up @@ -58,7 +63,7 @@ setMethod(
#' .expandList(x)
#' @export
#' @keywords internal
.expandList <- function(x) {
.expandList = function(x) {
if (is.list(x))
return(lapply(x, .expandList))
if (length(x) > 1)
Expand All @@ -81,7 +86,7 @@ setMethod(
#' .getSubscript(l, 1) == .getSubscript(l, "a")
#' @export
#' @keywords internal
.getSubscript <- function(lst, i) {
.getSubscript = function(lst, i) {
if (is.character(i))
return(grep(paste0("^", i, "$"), names(lst)))
return(i)
Expand Down Expand Up @@ -135,7 +140,7 @@ setMethod("[[", "Config", function(x, i) {
})


.DollarNames.Config <- function(x, pattern = "")
.DollarNames.Config = function(x, pattern = "")
grep(paste0("^", pattern), grep(names(x), value = TRUE))

#' @rdname select-config
Expand Down Expand Up @@ -170,7 +175,7 @@ setMethod(
),
definition = function(object, sections, cfgPath) {
# Enable creation of absolute path using given parent folder path.
absViaParent = pryr::partial(.makeAbsPath, parent = dirname(cfgPath))
absViaParent = function(x) .makeAbsPath(x, parent = dirname(cfgPath))
for (section in sections) {
if (section %in% names(object))
object[[section]] = absViaParent(object[[section]])
Expand Down Expand Up @@ -297,7 +302,7 @@ setMethod(
# or for user information when the Project is created, where message
# is preferred
if (!style == "message") {
printFun = pryr::partial(cat, fill = T)
printFun = function(...) cat(..., fill = TRUE)
} else{
printFun = message
}
Expand Down
3 changes: 2 additions & 1 deletion R/constants.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ CFG_DUPLICATE_KEY = "duplicate"
CFG_REMOVE_KEY = "remove"
CFG_LOOPER_KEY = "looper"
SAMPLE_NAME_ATTR = "sample_name"
SUBSAMPLE_NAME_ATTR = "subsample_name"
SUBSAMPLE_NAME_ATTR = "subsample_name"
BASE_URL = "https://pephub-api.databio.org/api/v1/"
2 changes: 1 addition & 1 deletion R/pepr.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#' @author Michal Stolarczyk, Nathan Sheffield
#' @import yaml
#' @import stringr
#' @import pryr
#' @import httr2
#'
#' @references
#' GitHub: \url{https://github.com/pepkit/pepr}, Documentation: \url{https://code.databio.org/pepr/}
Expand Down
Loading