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
25 changes: 25 additions & 0 deletions .github/workflows/notify-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Notify pepkit docs

# Tells databio/doc-hubs that this repo's docs changed, so pep.databio.org
# rebuilds. All the logic is in the reusable workflow; this file only names
# which site and which spoke. See databio/doc-hubs README, "Add a spoke".

on:
push:
# Must equal this spoke's `ref` in hubs/pepkit/spokes.toml — the hub builds
# that ref, so notifying from any other branch would rebuild the same bytes.
branches: [master]
paths:
- 'docs/**' # the spoke's docs tree, docs.yml included
- 'peppy/**' # the package the hub renders API pages from
- '.github/workflows/notify-docs.yml' # so a notifier fix proves itself
workflow_dispatch:

jobs:
notify:
uses: databio/actions/.github/workflows/notify-doc-hub.yml@master
with:
site: pepkit
spoke: peppy
secrets:
DOCS_DISPATCH_TOKEN: ${{ secrets.DOCS_DISPATCH_TOKEN }}
15 changes: 0 additions & 15 deletions .readthedocs.yaml

This file was deleted.

10 changes: 9 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
# peppy
# <img src="img/peppy_logo.svg" alt="peppy" class="img-header"/>

<p align="center">
<a href="https://pep.databio.org" alt="PEP compatible"><img src="https://pepkit.github.io/img/PEP-compatible-green.svg"/></a>
<a href="https://github.com/pepkit/peppy/actions/workflows/run-pytest.yml" alt="Run pytests"><img src="https://github.com/pepkit/peppy/workflows/Run%20pytests/badge.svg"/></a>
<a href="https://codecov.io/gh/pepkit/peppy" alt="codecov"><img src="https://codecov.io/gh/pepkit/peppy/branch/master/graph/badge.svg"/></a>
<a href="https://pypi.org/project/peppy" alt="PyPI badge"><img src="https://img.shields.io/pypi/v/peppy"/></a>
<a href="https://github.com/pepkit/peppy" alt="GitHub source code"><img src="https://img.shields.io/badge/source-github-354a75?logo=github"/></a>
</p>

## Introduction

Expand Down
39 changes: 37 additions & 2 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,41 @@

This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) and [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) format.

## [0.50.0a1] -- 2025-12-22
### Added
- Merged [`eido`](https://github.com/pepkit/eido) ([#492](https://github.com/pepkit/peppy/issues/492)) and [`pephubclient`](https://github.com/pepkit/pephubclient) into `peppy`.
- Command line interface based on `typer` for `eido` and `pephubclient`.
- Pytest for Windows.

### Fixed
- Fixed incorrect path expanding from config file URL in Windows.
- Ambiguity ([#498](https://github.com/pepkit/peppy/issues/498)) and redundancy ([#499](https://github.com/pepkit/peppy/issues/499)) in error messages.

## [0.40.7] -- 2024-09-30
### Fixed
- Fixed incorrect sample table index in subtables

## [0.40.6] -- 2024-09-10
### Changed
- [#493](https://github.com/pepkit/peppy/issues/493)

## [0.40.5] -- 2024-07-25
### Fixed
- Fixed bug in initialization of peppy object from csv

## [0.40.4] -- 2024-07-17
### Changed
- minor change, [PR #490](https://github.com/pepkit/peppy/pull/490)

## [0.40.3] -- 2024-07-17
### Fixed
- [#393](https://github.com/pepkit/peppy/issues/393)
- [#480](https://github.com/pepkit/peppy/issues/480)
- [#369](https://github.com/pepkit/peppy/issues/369)
- [#399](https://github.com/pepkit/peppy/issues/399)
- [#476](https://github.com/pepkit/peppy/issues/476)
- [#471](https://github.com/pepkit/peppy/issues/471)

## [0.40.2] -- 2024-05-28
### Added
- added `sample_name` property to samples object.
Expand Down Expand Up @@ -110,12 +145,12 @@ _Due to the changes mentioned above, a few functionalities may be disabled. For
### Fixed

- Performance issues during sample parsing. Two list comprehensions were combined to speed up this functionality.
- `KeyError` is thrown when attempting to access the `pep_version` of a `peppy.Project` instance instatiated from a sample table (`csv`)
- `KeyError` is thrown when attempting to access the `pep_version` of a `peppy.Project` instance instantiated from a sample table (`csv`)

### Added

- Implementation of `__eq__` for the `peppy.Project` class such that two instances of the class can be compared using python's equality operators (`==`, `!=`).
- New `from_dict` function that lets a user instatiate a new `peppy.Project` object using an in-memory representation of a PEP (a `dict`). This supports database storage of PEPs.
- New `from_dict` function that lets a user instantiate a new `peppy.Project` object using an in-memory representation of a PEP (a `dict`). This supports database storage of PEPs.
- New `extended` flag for the `to_dict` method on `peppy.Project` objects. This creates a **richer** dictionary representation of PEPs.
- Better sample parsing

Expand Down
143 changes: 143 additions & 0 deletions docs/code/feature1_append.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
# Learn append sample modifier in `peppy`

This vignette will show you how and why to use the append functionality of the `pepr` package.

- basic information about this concept on the [specification website](http://pep.databio.org/en/2.0.0/specification/#sample_modifiersappend).

## Problem/Goal
The example below demonstrates how to use the constant attributes to **define the samples attributes in the `read_type` column** of the `sample_table.csv` file. This functionality is extremely useful when there are many samples that are characterized by identical values of certain attribute (here: value `SINGLE` in `read_type` attribute). Please consider the example below for reference:


```python
examples_dir = "../tests/data/example_peps-cfg2/example_append/"
sample_table_ori = examples_dir + "sample_table_pre.csv"
%cat $sample_table_ori | column -t -s, | cat
```

sample_name organism time read_type

pig_0h pig 0 SINGLE

pig_1h pig 1 SINGLE

frog_0h frog 0 SINGLE

frog_1h frog 1 SINGLE


## Solution
As the name suggests the attributes in the specified attributes (here: `read_type`) can be defined as constant ones. The way how this process is carried out is indicated explicitly in the `project_config.yaml` file (presented below). The name of the column is determined in the `sample_modifiers.append` key-value pair. Note that definition of more than one constant attribute is possible.



```python
project_config_file = examples_dir + "project_config.yaml"
%cat $project_config_file
```

pep_version: "2.0.0"
sample_table: sample_table.csv

sample_modifiers:
append:
read_type: SINGLE



Let's introduce a few modifications to the original `sample_table.csv` file to use the `sample_modifiers.append` section of the config. Simply skip the attributes that are set constant and let the `pepr` do the work for you.


```python
sample_table = examples_dir + "sample_table.csv"
%cat $sample_table | column -t -s, | cat
```

sample_name organism time

pig_0h pig 0

pig_1h pig 1

frog_0h frog 0

frog_1h frog 1



## Code
Import `peppy` and read in the project metadata by specifying the path to the `project_config.yaml`:


```python
from peppy import Project
p = Project(project_config_file)
```

And inspect it:


```python
print(p)
p.sample_table
```

Project 'example_append' (/Users/mstolarczyk/Uczelnia/UVA/code/peppy/tests/data/example_peps-cfg2/example_append/project_config.yaml)
4 samples: pig_0h, pig_1h, frog_0h, frog_1h
Sections: pep_version, sample_table, sample_modifiers





<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
<th></th>
<th>organism</th>
<th>read_type</th>
<th>sample_name</th>
<th>time</th>
</tr>
<tr>
<th>sample_name</th>
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<th>pig_0h</th>
<td>pig</td>
<td>SINGLE</td>
<td>pig_0h</td>
<td>0</td>
</tr>
<tr>
<th>pig_1h</th>
<td>pig</td>
<td>SINGLE</td>
<td>pig_1h</td>
<td>1</td>
</tr>
<tr>
<th>frog_0h</th>
<td>frog</td>
<td>SINGLE</td>
<td>frog_0h</td>
<td>0</td>
</tr>
<tr>
<th>frog_1h</th>
<td>frog</td>
<td>SINGLE</td>
<td>frog_1h</td>
<td>1</td>
</tr>
</tbody>
</table>



As you can see, the resulting samples are annotated the same way as if they were read from the original annotations file with attributes in the last column manually determined.
Loading
Loading