Skip to content

Commit

Permalink
Merge pull request #44 from SwiftSeal/tests
Browse files Browse the repository at this point in the history
Add tests and improve multithreading
  • Loading branch information
SwiftSeal authored Jan 15, 2025
2 parents c3397c3 + c792058 commit 07d7247
Show file tree
Hide file tree
Showing 54 changed files with 5,648 additions and 3,353 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# SCM syntax highlighting
pixi.lock linguist-language=YAML linguist-generated=true
2 changes: 1 addition & 1 deletion .github/workflows/check_version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ jobs:
exit 1
fi
env:
PYTHONPATH: ${{ github.workspace }}
PYTHONPATH: ${{ github.workspace }}
8 changes: 5 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# custom

test/
models/
tests/output

.DS_Store

Expand Down Expand Up @@ -164,4 +163,7 @@ cython_debug/
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
#.idea/
# pixi environments
.pixi
*.egg-info
18 changes: 18 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.9.1
hooks:
# Run the linter.
- id: ruff
# Run the formatter.
- id: ruff-format
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
![Conda Version](https://img.shields.io/conda/vn/bioconda/resistify)
![Conda Downloads](https://img.shields.io/conda/dn/bioconda/resistify)
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/swiftseal/resistify/blob/main/assets/resistify.ipynb)
[![Pixi Badge](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/prefix-dev/pixi/main/assets/badge/v0.json)](https://pixi.sh)

</div>

Expand All @@ -22,7 +23,7 @@ conda create -n resistify bioconda::resistify
conda activate resistify
```

> [!NOTE]
> [!NOTE]
> If you want to use the GPU-accelerated pipelines, conda may fail to install a GPU-ready version of `pytorch`. If this occurs, try installing `pytorch-gpu bioconda::resistify` instead.
When using `conda`, please ensure that your Bioconda has been [configured correctly](https://bioconda.github.io/#usage).
Expand All @@ -35,7 +36,7 @@ To use these with - for example - `singularity`, simply run:
If you are having issues with `conda`, you can instead try installing directly from the repository:

```sh
pip install https://github.com/SwiftSeal/resistify/archive/refs/tags/v1.1.1.tar.gz
pip install https://github.com/SwiftSeal/resistify/archive/refs/tags/v1.1.2.tar.gz
```

Note that `resistify` requires `hmmer` to be installed and available in your system's PATH, which will not be installed automatically when using `pip`.
Expand Down Expand Up @@ -74,7 +75,7 @@ Together, this evidence is used to classify NLRs according to their domain archi

### Identifying PRRs

> [!IMPORTANT]
> [!IMPORTANT]
> This pipeline is currently in development - due to other commitments I can't currently benchmark this properly and make no guarantees to its accuracy yet! Feedback is appreciated.
To predict PRRs within a set of protein sequences, simply run:
Expand Down Expand Up @@ -107,6 +108,7 @@ Sequences are classified as being either RLPs or RLKs depending on the presence
This only applies to the `--coconat` and PRR pipelines! The standard NLR pipeline does not require any external databases.

By default, `Resistify` will automatically download the models required for CoConat and TMbed to your `$HOME/.cache` directory.
This default can be changed by adjusting the environment variable `$HF_HOME` to your preferred location.
If you'd like to manually install the databases instead, you can use the `resistify download_models` utility to download these to a directory of your choice.
To provide these local models to the CoCoNat and TMbed processes, simply pass the path of the models directory via the `--models` argument.
Approximately 13G of disk space is required.
Expand Down Expand Up @@ -297,8 +299,9 @@ The following are some quick benchmarks of the various `resistify` pipelines aga
| Pipeline | Resources | CPU time | Real time | MaxRSS |
| --- | --- | --- | --- | --- |
| `nlr` | 32T AMD EPYC 7543 | 05:14:47 | 00:12:42 | 15.0G |
| `nlr --retain` | 32T AMD EPYC 7543 | 1-01:51:50 | 01:07:42 | 13.1G |
| `nlr --coconat` | 32T AMD EPYC 7543 | 12:12:02 | 00:26:08 | 14.9G |
| `prr` | 16T AMD EPYC 7543, NVIDIA A100 80GB | 23:14:05 | 00:59:40 | 8.4G
| `prr` | 16T AMD EPYC 7543, NVIDIA A100 80GB | 23:14:05 | 00:59:40 | 8.4G |

## Contributing

Expand Down
10 changes: 5 additions & 5 deletions assets/diagram.txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
e.g., resistify nlr proteins.fa -o results/───────────────────┐
e.g., resistify nlr proteins.fa -o results/───────────────────┐
│ │ ┌───────────────▼────────────────┐
┌────────────┼───────┘ │* NLR identification │
│ │ ┌────────────────────┐ │* NLR classification │
│ ┌─▼─┐ │* hmmsearch │ │* CC, TIR, RPW8 │
│ ┌─►│NLR├─►│* NLRexpress ├─►│* NB-ARC domains │
│ │ └───┘ │* CoCoNat (optional)│ │* Motif and domain annotations │
┌───▼─────┐ │ └────────────────────┘ └────────────────────────────────┘
│Resistify├─┤
│Resistify├─┤
└─────────┘ │ ┌────────────────────┐ ┌────────────────────────────────┐
│ ┌───┐ │* hmmsearch │ │* RLK/RLP identification │
┻┳│ └─►│PRR├─►│* NLRexpress (LRR) ├─►│* Extracellular classification │
┳┻│_∆_ └───┘ │* TMbed │ │* Signal peptide identification │
┻┳│o~o) └────────────────────┘ │* Motif and domain annotations │
┳┻│⊂J └────────────────────────────────┘
┻┳│j It's quick!
┻┳│j It's quick!
┻┳│ It's easy to install! ..^____/
┳┻│ It's accurate! `-. ___ )
┳┻│ || ||
┻┳│^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
┳┻│ || ||
┻┳│^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
16 changes: 0 additions & 16 deletions assets/test_nlr.sh

This file was deleted.

12 changes: 0 additions & 12 deletions assets/test_prr.sh

This file was deleted.

Loading

0 comments on commit 07d7247

Please sign in to comment.