Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
989b1fc
Migrated data from setup.py to pyproject.toml
CeSchmitz Dec 9, 2025
7e484c0
Removed superseeded classifier from pyproject.toml
CeSchmitz Dec 9, 2025
3a7858a
Updated github link
CeSchmitz Dec 9, 2025
3c5c37e
Added package files
CeSchmitz Dec 9, 2025
6643d26
Updated dependencies
CeSchmitz Dec 9, 2025
77b2a23
testing new version
CeSchmitz Dec 9, 2025
ea63d9f
Restructed project
CeSchmitz Dec 9, 2025
2bf55dd
updated dependencies
CeSchmitz Dec 9, 2025
9e1a2a9
updated dependancies
CeSchmitz Dec 9, 2025
ec434f3
Added entry point for cli
CeSchmitz Dec 9, 2025
063427e
Fixed outdated resource path
CeSchmitz Dec 9, 2025
53995a5
update filename to match expected value
CeSchmitz Dec 9, 2025
ead79c8
added package for cli
CeSchmitz Dec 9, 2025
9a998f4
Testing auto package discovery
CeSchmitz Dec 9, 2025
071fd49
Fixed issue where data files were not installed
CeSchmitz Dec 9, 2025
91fb997
Reformatted author details
CeSchmitz Dec 9, 2025
f4acf82
resolved naming conflict
CeSchmitz Dec 9, 2025
d12668c
updated cli to use new naming
CeSchmitz Dec 9, 2025
2701f89
new version for testing on pypi
CeSchmitz Dec 9, 2025
81387d8
Updated entry point to match new name
CeSchmitz Dec 10, 2025
2e1513d
Restructed package structure
CeSchmitz Dec 10, 2025
e8f9d63
Fixed issue finding boost using outdated method
CeSchmitz Dec 10, 2025
041f06d
Fixed issuse where rpath was removed from bin
CeSchmitz Dec 10, 2025
ea19d63
Added subcommands to cli
CeSchmitz Dec 10, 2025
b187e88
Correct data files for new project structure
CeSchmitz Dec 10, 2025
5dd8f7a
Added configure function
CeSchmitz Dec 10, 2025
2d39591
Linked cli to analysis function
CeSchmitz Dec 11, 2025
bc10c95
Testing latest version of cmake
CeSchmitz Dec 11, 2025
c804719
Fixed issue when passing single evaluation accession
CeSchmitz Dec 11, 2025
25dfb54
Updated method for retriving config
CeSchmitz Dec 11, 2025
8873509
Removed hard coded path
CeSchmitz Dec 11, 2025
0a7c7f3
results now print to stdout
CeSchmitz Dec 11, 2025
8852e1a
Fixed issue with csv output
CeSchmitz Dec 11, 2025
608e3bc
Removed hardcoded path
CeSchmitz Dec 11, 2025
3cc5ed3
Added minimal example of using CRISPR-DA programmatically
CeSchmitz Dec 11, 2025
ffb820f
Removed outdated references to Viralcut
CeSchmitz Dec 11, 2025
2d2bd96
Removed outdated naming
CeSchmitz Dec 11, 2025
de07067
Removed unused file
CeSchmitz Dec 11, 2025
ba5c893
Added workflow for publishing
CeSchmitz Dec 11, 2025
2e99154
Updated work to run on tag
CeSchmitz Dec 11, 2025
1db8c65
version bump
CeSchmitz Dec 11, 2025
33a1eb1
Updated example
CeSchmitz Dec 11, 2025
b17b43a
version bump
CeSchmitz Dec 11, 2025
34e26a7
fixed issue where workflow wouldnt run
CeSchmitz Dec 11, 2025
eee40dc
version bump
CeSchmitz Dec 11, 2025
585b4c9
Updated slogan
CeSchmitz Dec 11, 2025
d9c00c1
Updated readme
CeSchmitz Dec 11, 2025
48d257a
Updated README readability
CeSchmitz Dec 16, 2025
3e99e9b
Added release workflow
CeSchmitz Dec 16, 2025
425a7da
Added workflow for testpypi
CeSchmitz Dec 16, 2025
9a53778
Testing conda workflow
CeSchmitz Dec 16, 2025
da047af
Debugging conda env in workflow
CeSchmitz Dec 16, 2025
a8e817c
Fixed issue where multiline command was incorrectly read
CeSchmitz Dec 16, 2025
652dd12
debugging conda and python interaction
CeSchmitz Dec 16, 2025
f0306b2
Resolved 'auto-activate' warning message
CeSchmitz Dec 16, 2025
a8c81f0
update command to match latest documentation
CeSchmitz Dec 16, 2025
6919f6a
testing conda activate
CeSchmitz Dec 16, 2025
9b6a840
Resolved issue where conda activate was called before init
CeSchmitz Dec 16, 2025
b307164
Resolving env naming
CeSchmitz Dec 16, 2025
8b25f4a
Resolving failing workflow
CeSchmitz Dec 16, 2025
3a987ca
Added default interactive shell to workflow
CeSchmitz Dec 16, 2025
2b571cc
Added local install and testing
CeSchmitz Dec 16, 2025
dde65eb
Added defaul;t config option
CeSchmitz Dec 16, 2025
8fbea96
Updated workflow to use default config
CeSchmitz Dec 16, 2025
052a263
Fixed type issue in default config option
CeSchmitz Dec 16, 2025
1fb7f73
Added post upload test
CeSchmitz Dec 16, 2025
12eba6e
version bump
CeSchmitz Dec 16, 2025
0cd939c
Fixed issue where enviroment.yml was missing from workflow
CeSchmitz Dec 16, 2025
22593d3
Fixed issues where dependancies were installed from testpypi
CeSchmitz Dec 16, 2025
423a8bc
Adding conda caching to test workflow
CeSchmitz Dec 16, 2025
3efa18e
Removed conda cache, added pip cache
CeSchmitz Dec 16, 2025
7566a82
Testing pip cache
CeSchmitz Dec 16, 2025
b35279c
Resolved conda-incubator/setup-miniconda@v3 warning message
CeSchmitz Dec 16, 2025
0c2335a
Added conda to release workflow
CeSchmitz Dec 16, 2025
79ad9b3
Resolved workflow warning message for all conda setups
CeSchmitz Dec 16, 2025
7c33ed3
resovled warning for release pipeline
CeSchmitz Dec 16, 2025
5f12029
Resolving warning messge for workflows
CeSchmitz Dec 16, 2025
165f0a5
Updated License name
CeSchmitz Dec 16, 2025
3b33a15
version bump
CeSchmitz Dec 16, 2025
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
103 changes: 103 additions & 0 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: Publish Python distribution to PyPI

on:
release:
types: [published]

permissions:
contents: read

jobs:
build:
name: Build distribution
runs-on: ubuntu-latest
defaults:
run:
shell: bash -el {0}
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: crispr-da
environment-file: environment.yml
auto-activate-base: false
conda-remove-defaults: "true"
- name: Test installed tools
run: |
conda info
conda env list
cmake --version
make --version
which python3
- name: Install pypa/build
run: python3 -m pip install build
- name: Build a binary wheel and a source tarball
run: python3 -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v5
with:
name: release-dists
path: dist/
- name: Install locally using distribution files
run: python3 -m pip install dist/*.whl
- name: Build dependancies
run: crispr_da config -d
- name: Get tool version
run: |
crispr_da -h
crispr_da --version

publish-to-pypi:
name: Publish Python distribution to PyPI
needs:
- build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/crispr-da
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- name: Download all the dists
uses: actions/download-artifact@v6
with:
name: release-dists
path: dist/
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

install-from-pypi:
name: Install Python distribution from PyPI
needs:
- publish-to-pypi
runs-on: ubuntu-latest
defaults:
run:
shell: bash -el {0}
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: crispr-da
environment-file: environment.yml
auto-activate-base: false
conda-remove-defaults: "true"
- name: Test installed tools
run: |
conda info
conda env list
cmake --version
make --version
which python3
- name: Install from PyPI
run: pip install crispr-da
- name: Build dependancies
run: crispr_da config -d
- name: Get tool version
run: |
crispr_da -h
crispr_da --version
110 changes: 110 additions & 0 deletions .github/workflows/publish-to-testpypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
name: Publish Python distribution to TestPyPI

on: push

jobs:
build:
name: Build distribution
runs-on: ubuntu-latest
defaults:
run:
shell: bash -el {0}
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: crispr-da
environment-file: environment.yml
auto-activate-base: false
conda-remove-defaults: "true"
- name: Test installed tools
run: |
conda info
conda env list
cmake --version
make --version
which python3
- name: Get pip cache dir
id: pip-cache
run: |
echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
- name: Restore pip cache
uses: actions/cache@v4
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}
- name: Install pypa/build
run: python3 -m pip install build
- name: Build a binary wheel and a source tarball
run: python3 -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v5
with:
name: prerelease-dists
path: dist/
- name: Install locally using distribution files
run: python3 -m pip install dist/*.whl
- name: Build dependancies
run: crispr_da config -d
- name: Get tool version
run: |
crispr_da -h
crispr_da --version

publish-to-testpypi:
name: Publish Python distribution to TestPyPI
if: startsWith(github.ref, 'refs/tags')
needs:
- build
runs-on: ubuntu-latest
environment:
name: testpypi
url: https://test.pypi.org/p/crispr-da
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- name: Download all the dists
uses: actions/download-artifact@v6
with:
name: prerelease-dists
path: dist/
- name: Publish distribution to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/

install-from-testpypi:
name: Install Python distribution from TestPyPI
needs:
- publish-to-testpypi
runs-on: ubuntu-latest
defaults:
run:
shell: bash -el {0}
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: crispr-da
environment-file: environment.yml
auto-activate-base: false
conda-remove-defaults: "true"
- name: Test installed tools
run: |
conda info
conda env list
cmake --version
make --version
which python3
- name: Install from TestPyPI
run: pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple crispr-da
- name: Build dependancies
run: crispr_da config -d
- name: Get tool version
run: |
crispr_da -h
crispr_da --version
2 changes: 1 addition & 1 deletion LICENCE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
3-Clause BSD License
BSD 3-Clause "New" or "Revised" License

Copyright (c) 2025-, Carl Schmitz, Jake Bradford, Dimitri Perrin

Expand Down
129 changes: 79 additions & 50 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,81 +1,110 @@
# CRISPR-DA
CRISPR-Cas9 sgRNA design across many genomes
Adapting CRISPR gRNA design for detection assays.

## Installation
## Preamble

1. Clone the repository from GitHub
>CRISPR-Cas systems offer a viable alternative to traditional detection and diagnosis methods. However, their effectiveness relies heavily on the selection of appropriate guide RNA sequences. Existing gRNA design tools were primarily developed for gene editing and are not always directly applicable to CRISPR-based detection assays. In particular, alignment-based methods are still used to estimate gRNA specificity, even though they can miss a substantial portion of off-target sites. In this work, we introduce CRISPR-DA, a CRISPR gRNA design tool for detection assays. We show that it provides a better assessment of gRNA specificity than BLAST, which detected only 33.27 % and 0.43 % of cross-species off-targets in two datasets. Additionally, CRISPR-DA ran two and six times faster than BLAST on these datasets, respectively. Our method incorporates advances from gene-editing guide RNA design tools, including uncertainty-informed guide RNA design, to improve the selection of guides with high on-target activity. CRISPR-DA is available at https://github.com/bmds-lab/CRISPR-DA.

```
git clone https://github.com/bmds-lab/CRISPR-DA
```

2. Install using pip
## Licence
BSD 3-Clause "New" or "Revised" License

```
cd CRISPR-DA
python3.8 -m pip install -e .
```

3. Run an example
See `LICENCE` and https://opensource.org/license/BSD-3-Clause for more details.

```
cd examples
python3.8 design_for_covid_spike_protein.py
```
## Dependencies

## Utilities
### Option 1. Using Anaconda (Recommended)
1. Download the `environment.yml` file from GitHub.

### CRISPR-DA CLI
2. Download and install [Anaconda](https://www.anaconda.com/download).

#### Usage
3. Setup conda enviroment.
```
conda env create -f <path/to/downloaded/environment.yml>
```

### Option 2. Install dependencies manually
1. Download and install the following (The software/program version provided were using during testing but there "should" be no problem using newer version).
- [Python](https://www.python.org/)>=3.12
- [CMake](https://cmake.org/)>=4.1.2
- [Boost](https://www.boost.org/)>=1.82
- [Make](https://www.gnu.org/software/make/)>=4.2.1
NOTE: You can replace Make with whichever build system you like (E.g. [Ninja](https://ninja-build.org/)).

## Installation

### From [PyPi](https://pypi.org/project/crispr-da/) using pip (Recommended)
1. Install using pip.
```
pip install crispr-da
```
$ CRISPR_DA --help
usage: CRISPR_DA [-h] -g GENEID -a ACCESSIONS [ACCESSIONS ...] [-o OUTPUT]

CRISPR-DA: for designing CRISPR-Cas9 sgRNA when many genomes are to be considered.
2. Run `config` to install required binaries and initialise configuration file.
```
crispr_da config
```

optional arguments:
-h, --help show this help message and exit
-g GENEID, --geneid GENEID
The NCBI gene ID to extract potential CRISPR target sites from
-a ACCESSIONS [ACCESSIONS ...], --accessions ACCESSIONS [ACCESSIONS ...]
A list of NCBI accessions to score CRISPR sites against
-o OUTPUT, --output OUTPUT
Output files prefix (e.g. `/home/user/results/covid` would become `/home/user/results/covid-guides.csv`, etc.). Default is
`--geneid`.
```
### From source
1. Clone the repository from GitHub.
```
git clone https://github.com/bmds-lab/CRISPR-DA
```

#### Example
2. Build distribution files.
```
python3 -m build
```
NOTE: It may be useful to ensure the latest version of PyPA's build is install. Simply run `python3 -m pip install --upgrade build`.

3. Install CRISPR-DA using distribution files and pip.
```
$ CRISPR_DA -g 43740568 -a GCA_000820495.2 GCA_000838265.1 -o spike
python3 -m pip install ./dist/*.whl
```

Output file `spike-guides.md` (minimised for this readme):
4. Run `config` to install required binaries and initialise configuration file.
```
crispr_da config
```

## CRISPR-DA CLI

| seq | start | end | ssline_1 | ssStructure | strand | acceptedByMm10db | passedG20 | acceptedBySgRnaScorer | consensusCount | ssEnergy | passedAvoidLeadingT | passedSecondaryStructure | AT | sgrnascorer2score | passedATPercent | passedTTTT |
|:------------------------|--------:|------:|:---------------------------|:---------------------------|:---------|-------------------:|------------:|------------------------:|-----------------:|-----------:|----------------------:|:---------------------------|-----:|--------------------:|------------------:|-------------:|
| TACACTAATTCTTTCACACGTGG | 81 | 104 | GACACUAAUUCUUUCACAGUGCUUUU | ..((((..(((......(((().... | + | 0 | 1 | 1 | 2 | -19.2 | 0 | ! | 65 | 1.00437 | 1 | 1 |
| CTCAGTTTTACATTCAACTCAGG | 134 | 157 | GUCAGUUUUACAUUCAACGUGCUUUU | ..((.((((........(((.).... | + | 0 | 0 | 0 | 0 | -19.2 | 1 | 0 | 65 | -0.537641 | 1 | 0 |
### Usage

```
$ crispr_da -h
usage: crispr_da [-h] [-v] {config,analyse} ...

CRISPR-DA: gRNA design for detection assays.

Output file `spike-scores.md` (minimised for this readme):
options:
-h, --help show this help message and exit
-v, --version Print CRISPR-DA version

subcommands:
{config,analyse}
config Run config
analyse Run analysis
```

| accession | TACACTAATTCTTTCACACG | CTGGGACCAATGGTACTAAG | GAGAAGTCTAACATAATAAG | GAAGTCAGACAAATCGCTCC |
|:----------------|:-----------------------|:-----------------------|:-----------------------|:-----------------------|
| GCA_000820495.2 | (100.0, 100.0) | (100.0, 100.0) | (100.0, 100.0) | (100.0, 100.0) |
| GCA_000838265.1 | (100.0, 100.0) | (100.0, 100.0) | (100.0, 100.0) | (100.0, 100.0) |
### Example

```
$ crispr_da analyse --target_gene_id 43740568 --evaluation_accessions GCA_000820495.2 GCA_000838265.1
```

## Dependencies
Expected output format (minimised for this readme):

- Python 3.7 +
| accession | TACACTAATTCTTTCACACGTGG | ... | CTTTCTTTTCCAATGTTACTTGG |
|:----------------|:------------------------|:------|:------------------------|
| GCA_000820495.2 | (100.0, 100.0) | ... | (100.0, 100.0) |
| GCA_000838265.1 | (100.0, 100.0) | ... | (100.0, 100.0) |

- [Pandas](https://pypi.org/project/pandas/)
## CRISPR-DA Python Library

- [NCBI Dataset PyLib](https://pypi.org/project/ncbi-datasets-pylib/)
### Usage
CRISPR-DA can also be access using Python.
```
from crispr_da import run_analysis
```

### Example
An minimal example has been included in the `examples/design_for_covid_spike_protein.py`
Binary file removed crisprda/__pycache__/__init__.cpython-312.pyc
Binary file not shown.
Binary file removed crisprda/__pycache__/config.cpython-312.pyc
Binary file not shown.
Binary file removed crisprda/__pycache__/data.cpython-312.pyc
Binary file not shown.
Loading
Loading