Skip to content

Commit 4eac863

Browse files
committed
Merge branch 'main' into hilary_dev
2 parents 312aefd + e22d3d3 commit 4eac863

9 files changed

Lines changed: 1218 additions & 352 deletions

File tree

.flake8

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ ignore =
1616
exclude=
1717
.git,
1818
venv,
19+
tests/test_data,

.github/workflows/pytest.yml

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,47 +6,51 @@ jobs:
66
runs-on: ubuntu-latest
77
strategy:
88
matrix:
9-
python-version: [3.7 ,3.8, 3.9, '3.10', 3.11]
9+
python-version: [3.8, 3.9, '3.10', 3.11, 3.12, 3.13]
1010
steps:
11-
- name: Checkout repository and submodules
12-
uses: actions/checkout@v1
13-
with:
14-
submodules: recursive
15-
- name: Checkout github repo (+ download lfs dependencies)
16-
uses: actions/checkout@v2
17-
with:
18-
lfs: true
19-
- name: Checkout LFS objects
20-
run: git lfs checkout
11+
- name: Checkout repository
12+
uses: actions/checkout@v4
13+
2114
- name: Set up Python ${{ matrix.python-version }}
22-
uses: actions/setup-python@v1
15+
uses: actions/setup-python@v5
2316
with:
2417
python-version: ${{ matrix.python-version }}
18+
2519
- name: Install dependencies
2620
run: |
27-
eval `ssh-agent -s`
28-
ssh-add - <<< '${{ secrets.syncropatch_export_key }}'
2921
python -m pip install --upgrade pip
3022
python -m pip install -e .[test]
23+
24+
- name: Lint with flake8
25+
run: |
26+
python -m flake8 pcpostprocess/*.py tests/*.py pcpostprocess/scripts/*.py
27+
28+
- name: Import sorting with isort
29+
run: |
30+
python -m isort --verbose --check-only --diff pcpostprocess tests setup.py
31+
3132
- name: Extract test data
3233
run: |
3334
wget https://cardiac.nottingham.ac.uk/syncropatch_export/test_data.tar.xz -P tests/
3435
tar xvf tests/test_data.tar.xz -C tests/
36+
3537
- name: Test with pytest
3638
run: |
3739
python -m pip install -e .
3840
python -m pytest --cov --cov-config=.coveragerc
39-
- name: Run export with test data
41+
42+
- name: Install TeX dependencies
4043
timeout-minutes: 15
4144
run: |
4245
sudo apt-get install dvipng texlive-latex-extra texlive-fonts-recommended cm-super -y
46+
47+
- name: Test running QC
48+
timeout-minutes: 15
49+
run: |
4350
pcpostprocess run_herg_qc tests/test_data/13112023_MW2_FF -w A01 A02 A03
44-
- uses: codecov/codecov-action@v1
51+
52+
- uses: codecov/codecov-action@v4
4553
with:
4654
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
47-
- name: Lint with flake8
48-
run: |
49-
python -m flake8 pcpostprocess/*.py tests/*.py pcpostprocess/scripts/*.py
50-
- name: Import sorting with isort
51-
run: |
52-
python -m isort --verbose --check-only --diff pcpostprocess tests setup.py
55+
if: success() && matrix.python-version == 3.13
56+

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/tests/test_data
2-
*.pyc
2+
/test_output
3+
*__pycache__*
4+
*.egg-info
35
*.DS_Store
4-
*__pycache__*

README.md

Lines changed: 22 additions & 140 deletions
Original file line numberDiff line numberDiff line change
@@ -1,106 +1,56 @@
1-
2-
<!-- Improved compatibility of back to top link: See: https://github.com/othneildrew/Best-README-Template/pull/73 -->
3-
<a name="readme-top"></a>
4-
5-
<!-- PROJECT SHIELDS -->
61
[![Unit tests](https://github.com/CardiacModelling/pcpostprocess/actions/workflows/pytest.yml/badge.svg)](https://github.com//CardiacModelling/pcpostprocess/actions/workflows/pytest.yml)
72
[![codecov](https://codecov.io/gh/CardiacModelling/pcpostprocess/graph/badge.svg?token=HOL0FrpGqs)](https://codecov.io/gh/CardiacModelling/pcpostprocess)
83

4+
This repository contains a python package and scripts for handling time-series data from patch-clamp experiments.
5+
The package has been tested with data from a SyncroPatch 384, but may be adapted to work with data in other formats.
6+
It can also be used to perform quality control (QC) as described in [Lei et al. (2019)](https://doi.org/10.1016%2Fj.bpj.2019.07.029).
97

10-
<!-- PROJECT LOGO -->
11-
<!-- <br /> -->
12-
<!-- <div align="center"> -->
13-
<!-- <img src="images/logo.png" alt="Logo" width="80" height="80"> -->
14-
<!-- </a> -->
15-
16-
17-
<!-- TABLE OF CONTENTS -->
18-
<details>
19-
<summary>Table of Contents</summary>
20-
<ol>
21-
<li>
22-
<a href="#about-the-project">About The Project</a>
23-
<ul>
24-
<li><a href="#built-with">Built With</a></li>
25-
</ul>
26-
</li>
27-
<li>
28-
<a href="#getting-started">Getting Started</a>
29-
<ul>
30-
<li><a href="#prerequisites">Prerequisites</a></li>
31-
<li><a href="#installation">Installation</a></li>
32-
</ul>
33-
</li>
34-
<li><a href="#usage">Usage</a></li>
35-
<li><a href="#roadmap">Roadmap</a></li>
36-
<li><a href="#contributing">Contributing</a></li>
37-
<li><a href="#license">License</a></li>
38-
<li><a href="#contact">Contact</a></li>
39-
<li><a href="#acknowledgments">Acknowledgments</a></li>
40-
</ol>
41-
</details>
42-
43-
44-
<!-- ABOUT THE PROJECT -->
45-
## About The Project
46-
This project contains a python package and scripts for handling time-series data from patch-clamp experiments. The package has been tested with data from a SyncroPatch 384, but may be adapted to work with data in other formats. The package can also be used to perform quality control (QC) as described in [Lei et al. (2019)](https://doi.org/10.1016%2Fj.bpj.2019.07.029).
47-
48-
<p align="right">(<a href="#readme-top">back to top</a>)</p>
49-
50-
51-
<!-- GETTING STARTED -->
52-
## Getting Started
53-
54-
This is an example of how you may give instructions on setting up your project locally.
55-
To get a local copy up and running follow these simple example steps.
56-
57-
### Prerequisites
8+
This package is tested on Ubuntu with Python 3.8, 3.9, 3.10, 3.11, 3.12 and 3.13.
589

59-
This package has been tested on Ubuntu with Python 3.7, 3.8, 3.9, 3.10 and 3.11.
60-
61-
### Installation
10+
## Getting Started
6211

63-
First clone this repository
12+
First clone the repository
6413

65-
```
66-
git clone git@github.com:CardiacModelling/pcpostprocess && cd pcpostprocess
14+
```sh
15+
git clone git@github.com:CardiacModelling/pcpostprocess
16+
cd pcpostprocess
6717
```
6818

69-
With one of these versions install, create and activate a virtual environment.
19+
Create and activate a virtual environment.
7020

71-
```sh
72-
python3 -m venv .venv && source .venv/bin/activate
73-
```
21+
```sh
22+
python3 -m venv .venv && source .venv/bin/activate
23+
```
7424

7525
Then install the package with `pip`.
7626

77-
```
27+
```sh
7828
python3 -m pip install --upgrade pip && python3 -m pip install -e .'[test]'
7929
```
8030

81-
To run the tests you must first download some test data. Test data is available at [cardiac.nottingham.ac.uk/syncropatch\_export](https://cardiac.nottingham.ac.uk/syncropatch_export)
31+
To run the tests you must first download some test data.
32+
Test data is available at [cardiac.nottingham.ac.uk/syncropatch\_export](https://cardiac.nottingham.ac.uk/syncropatch_export)
8233

83-
```
34+
```sh
8435
wget https://cardiac.nottingham.ac.uk/syncropatch_export/test_data.tar.xz -P tests/
8536
tar xvf tests/test_data.tar.xz -C tests/
37+
rm tests/test_data.tar.xz
8638
```
8739

8840
Then you can run the tests.
89-
```
41+
```sh
9042
python3 -m unittest
9143
```
9244

93-
94-
<!-- USAGE -->
9545
## Usage
9646

9747
### Running QC and post-processing
9848

99-
Quality control (QC) may be run using the criteria outlined in [Rapid Characterization of hERG Channel Kinetics I](https://doi.org/10.1016/j.bpj.2019.07.030) and [Evaluating the predictive accuracy of ion channel models using data from multiple experimental designs](https://doi.org/10.1101/2024.08.16.608289). These criteria assume the use of the `staircase` protocol for quality control, which should be the first and last protocol performed. We also assume the presence of repeats after the addition of an IKr blocker (such as dofetilide).
49+
Quality control (QC) may be run using the criteria outlined in [Rapid Characterization of hERG Channel Kinetics I](https://doi.org/10.1016/j.bpj.2019.07.029) and [Evaluating the predictive accuracy of ion channel models using data from multiple experimental designs](https://doi.org/10.1101/2024.08.16.608289). These criteria assume the use of the `staircase` protocol for quality control, which should be the first and last protocol performed. We also assume the presence of repeats after the addition of an IKr blocker (such as dofetilide).
10050

10151
Prior to performing QC and exporting, an `export_config.py` file should be added to the root of the data directory. This file (see `example_config.py`) contains a Python `dict` (`Q2S_DC`) specifying the filenames of the protocols used for QC, and names they should be outputted with, as well as a Python `dict` (`D2S`) listing the other protocols and names to be used for their output. Additionally, the `saveID` field specifies the name of the expeirment which appears in the output file names.
10252

103-
```
53+
```sh
10454
$ pcpostprocess run_herg_qc --help
10555

10656
usage: pcpostprocess run_herg_qc [-h] [-c NO_CPUS]
@@ -130,12 +80,11 @@ options:
13080
--Erev EREV The reversal potential during the experiment
13181
```
13282
133-
13483
### Exporting Summary
13584
13685
The `summarise_herg_export` command produces additionally output after `run_herg_qc` has been run.
13786
138-
```
87+
```sh
13988
$ pcpostprocess summarise_herg_export --help
14089

14190
usage: pcpostprocess summarise_herg_export [-h] [--cpus CPUS]
@@ -162,70 +111,3 @@ options:
162111
--log_level LOG_LEVEL
163112
```
164113
165-
166-
<!-- CONTRIBUTING -->
167-
## Contributing
168-
169-
Any contributions you make are **greatly appreciated**.
170-
171-
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".
172-
173-
1. Fork the Project
174-
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
175-
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
176-
4. Push to the Branch (`git push origin feature/AmazingFeature`)
177-
5. Open a Pull Request
178-
179-
<p align="right">(<a href="#readme-top">back to top</a>)</p>
180-
181-
<!-- LICENSE -->
182-
## License
183-
184-
<p align="right">(<a href="#readme-top">back to top</a>)</p>
185-
186-
187-
188-
<!-- CONTACT -->
189-
## Contact
190-
191-
Joseph Shuttleworth joseph.shuttleworth@nottingham.ac.uk
192-
193-
Project Link: [https://github.com/CardiacModelling/pcpostprocess](https://github.com/CardiacModelling/pcpostprocess)
194-
195-
<p align="right">(<a href="#readme-top">back to top</a>)</p>
196-
197-
<p align="right">(<a href="#readme-top">back to top</a>)</p>
198-
199-
200-
201-
<!-- MARKDOWN LINKS & IMAGES -->
202-
<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->
203-
[contributors-shield]: https://img.shields.io/github/contributors/CardiacModelling/pcpostprocess.svg?style=for-the-badge
204-
[contributors-url]: https://github.com/CardiacModelling/pcpostprocess/graphs/contributors
205-
[forks-shield]: https://img.shields.io/github/forks/CardiacModelling/pcpostprocess.svg?style=for-the-badge
206-
[forks-url]: https://github.com/CardiacModelling/pcpostprocess/network/members
207-
[stars-shield]: https://img.shields.io/github/stars/CardiacModelling/pcpostprocess.svg?style=for-the-badge
208-
[stars-url]: https://github.com/CardiacModelling/pcpostprocess/stargazers
209-
[issues-shield]: https://img.shields.io/github/issues/CardiacModelling/pcpostprocess.svg?style=for-the-badge
210-
[issues-url]: https://github.com/CardiacModelling/pcpostprocess/issues
211-
[license-shield]: https://img.shields.io/github/license/Cardiac/Modelling/pcpostprocess.svg?style=for-the-badge
212-
[license-url]: https://github.com/CardiacModelling/pcpostprocess/blob/master/LICENSE.txt
213-
[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge&logo=linkedin&colorB=555
214-
[linkedin-url]: https://linkedin.com/in/linkedin_username
215-
[product-screenshot]: images/screenshot.png
216-
[Next.js]: https://img.shields.io/badge/next.js-000000?style=for-the-badge&logo=nextdotjs&logoColor=white
217-
[Next-url]: https://nextjs.org/
218-
[React.js]: https://img.shields.io/badge/React-20232A?style=for-the-badge&logo=react&logoColor=61DAFB
219-
[React-url]: https://reactjs.org/
220-
[Vue.js]: https://img.shields.io/badge/Vue.js-35495E?style=for-the-badge&logo=vuedotjs&logoColor=4FC08D
221-
[Vue-url]: https://vuejs.org/
222-
[Angular.io]: https://img.shields.io/badge/Angular-DD0031?style=for-the-badge&logo=angular&logoColor=white
223-
[Angular-url]: https://angular.io/
224-
[Svelte.dev]: https://img.shields.io/badge/Svelte-4A4A55?style=for-the-badge&logo=svelte&logoColor=FF3E00
225-
[Svelte-url]: https://svelte.dev/
226-
[Laravel.com]: https://img.shields.io/badge/Laravel-FF2D20?style=for-the-badge&logo=laravel&logoColor=white
227-
[Laravel-url]: https://laravel.com
228-
[Bootstrap.com]: https://img.shields.io/badge/Bootstrap-563D7C?style=for-the-badge&logo=bootstrap&logoColor=white
229-
[Bootstrap-url]: https://getbootstrap.com
230-
[JQuery.com]: https://img.shields.io/badge/jQuery-0769AD?style=for-the-badge&logo=jquery&logoColor=white
231-
[JQuery-url]: https://jquery.com

0 commit comments

Comments
 (0)