Skip to content

Commit

Permalink
squashing colab int commits
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher JF Cameron authored and Christopher JF Cameron committed Sep 30, 2023
1 parent 59ea262 commit 52678a6
Show file tree
Hide file tree
Showing 5 changed files with 760 additions and 11 deletions.
26 changes: 22 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,18 +119,33 @@ A REPIC Docker image is published on both [DockerHub](https://hub.docker.com/r/c
2. [Install and set up NVIDIA Container Toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html) for building and running GPU-accelerated containers
3. Pull REPIC Docker image and convert to Singularity image format (SIF) (requires >8 Gb of memory and ~40 mins for conversion):
```
apptainer pull docker://cjfcameron/repic:main
apptainer pull docker://cjfcameron/repic
```
If SIF file creation is taking a long time, increase the ```mksquashfs mem``` parameter in the Apptainer config file (apptainer.conf). See [here](https://apptainer.org/docs/admin/1.0/configfiles.html) for more information.

4. Run container with GPU acceleration (example [iter_pick.py](https://github.com/ccameron/REPIC/blob/main/repic/commands/iter_pick.py) command shown below):
```
apptainer run --nv --bind <file_path>/REPIC/examples:/examples repic_main.sif repic iter_pick /examples/10057/iter_config.json 4 100
apptainer run --nv --bind <file_path>/REPIC/examples:/examples repic_latest.sif repic iter_pick /examples/10057/iter_config.json 4 100
```
</p></details>

**<details><summary>Run using Google Colab</summary><p>**

A [Jupyter Notebook](https://jupyter.org/) for installing and running REPIC on [Google Colab](https://colab.google/) is included in the REPIC GitHub repo: [repic_colab.ipynb](https://github.com/ccameron/REPIC/blob/main/repic_colab.ipynb)

To open the notebook in Google Colab:

1. Navigate a browser to: https://colab.google/
2. Select "Open Colab", then "GitHub"
3. Enter the REPIC GitHub web URL: https://github.com/ccameron/REPIC.git
4. Select the "repic_colab.ipynb" Jupyter Notebook

</p></details>

**<details><summary>Run using Scipion plugin</summary><p>**

:warning: **WARNING**: Scipion plugin currently only contains REPIC one-shot mode

REPIC is available as a [Scipion](https://scipion.i2pc.es/) plugin: [https://github.com/scipion-em/scipion-em-repic](https://github.com/scipion-em/scipion-em-repic)

See [here](https://scipion-em.github.io/docs/release-3.0.0/docs/scipion-modes/how-to-install.html#installing-other-plugins) for information about installing plugins for Scipion.
Expand Down Expand Up @@ -188,7 +203,7 @@ repic iter_config examples/10057/ 176 224 <file_path>/gmodel_phosnet_202005_N63_

A configuration file ``` iter_config.json ``` will be created in the current working directory.

3. Pick particles by iterative ensemble learning using a Python script wrapper [iter_pick.py](https://github.com/ccameron/REPIC/blob/main/repic/commands/iter_pick.py) of [run.sh](https://github.com/ccameron/REPIC/blob/main/repic/iterative_particle_picking/run.sh) (expected run time: 20-30 min/iteration):
3. Pick particles by iterative ensemble learning using [iter_pick.py](https://github.com/ccameron/REPIC/blob/main/repic/commands/iter_pick.py), a wrapper of [run.sh](https://github.com/ccameron/REPIC/blob/main/repic/iterative_particle_picking/run.sh) (expected run time: 20-30 min/iteration):

```
repic iter_pick ./iter_config.json 4 100
Expand Down Expand Up @@ -273,7 +288,7 @@ done

` <relion_path>/relion/CtfFind/job00[0-9]/*<mrc_suffix> ` should list all CTFFIND4 output files in RELION's ` CtfFind/ `.

2. Iteratively pick particles using a Python script wrapper [iter_pick.py](https://github.com/ccameron/REPIC/blob/main/repic/commands/iter_pick.py) of [run.sh](https://github.com/ccameron/REPIC/blob/main/repic/iterative_particle_picking/run.sh):
2. Iteratively pick particles using [iter_pick.py](https://github.com/ccameron/REPIC/blob/main/repic/commands/iter_pick.py), a wrapper of [run.sh](https://github.com/ccameron/REPIC/blob/main/repic/iterative_particle_picking/run.sh):
```
usage: repic iter_pick [-h] [--semi_auto] [--score] [--out_file_path OUT_FILE_PATH] config_file num_iter train_size
Expand Down Expand Up @@ -308,6 +323,9 @@ For other concerns, please email [Christopher JF Cameron](mailto:christopher.cam

## Releases

### new
- Google Colab integrated

### v0.2.1
- Scipion plugin created
- Docker/Singularity/Apptainer integrated
Expand Down
9 changes: 5 additions & 4 deletions conda-build/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@ package:

source:
url: https://github.com/ccameron/REPIC/archive/v{{ version }}.zip
sha256: 1c6a1701ecc58e4732d82a3b8ef20b473974e662e40a4c42944482aeae325c0f
sha256: fd77f660bf6e1fe10138c145d2aa67b69fd4ff30f249047ee49460a185407633

requirements:
host:
- python >=3.8.16
- pip

run:
- python
- python >=3.8.16
- matplotlib-base >=3.2.2
- mrcfile >=1.4.3
- networkx >=2.8.4
Expand All @@ -29,6 +28,8 @@ build:
entry_points:
- repic = repic.main:main
script: {{ PYTHON }} -m pip install . --ignore-installed --no-deps -vv
run_exports:
- {{ pin_subpackage('repic', max_pin="x") }}

test:
commands:
Expand All @@ -39,7 +40,7 @@ about:
license: BSD-3-Clause
license_family: BSD
license_file: LICENSE
summary: REPIC - an ensemble learning approach for cryo-EM particle picking.
summary: REPIC - an ensemble learning approach to cryo-EM particle picking.
description: REliable PIcking by Consensus (REPIC) is an ensemble learning approach to cryogenic-electron microscopy (cryo-EM) particle picking. It identifies particles common to multiple picked particle sets (i.e., consensus particles) using graph theory and integer linear programming (ILP). Picked particle sets may be found by a human specialist (manual), template matching, mathematical function (e.g., RELION's Laplacian-of-Gaussian auto-picking), or machine-learning method. REPIC expects particle sets to be in BOX file format (*.box) where each particle has coordinates, a detection box size (in pixels), and (optional) a score [0-1].
dev_url: https://github.com/ccameron/REPIC
doc_url: https://repic.readthedocs.io/en/latest/
Expand Down
4 changes: 3 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,12 @@ def get_version():

extensions = [
'autoapi.extension',
'sphinx.ext.napoleon'
'sphinx.ext.napoleon',
'sphinx_search.extension'
]
autoapi_dirs = ['../repic']
autoapi_type = "python"
autoapi_ignore = ['../repic/__init__.py']

templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
Expand Down
6 changes: 4 additions & 2 deletions docs/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ channels:
- conda-forge
- defaults
dependencies:
- python=3.8
- python
- pip
- astroid==2.15.8 # https://github.com/readthedocs/sphinx-autoapi/issues/407
- repic
- pandoc
- sphinx==6.2.1
- sphinx
- sphinx_rtd_theme
- sphinx-autoapi
- pip:
Expand Down
Loading

0 comments on commit 52678a6

Please sign in to comment.