Skip to content

Commit

Permalink
Merge pull request #135 from vineetbansal/develop
Browse files Browse the repository at this point in the history
Testing/CI/Versioning
  • Loading branch information
zhonge committed Sep 22, 2022
2 parents 86db619 + 9ccf3e3 commit d47ddc3
Show file tree
Hide file tree
Showing 106 changed files with 3,280 additions and 46 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Docs

on:
push:
branches: [ master, develop, docs ]
tags:
- '*'

jobs:

build_docs:
runs-on: ubuntu-latest
strategy:
matrix:
python: [3.9]

steps:
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}

- name: Install Python dependencies
run: |
pip install sphinx myst-parser sphinx-book-theme
- uses: actions/checkout@v2

- name: Build docs
run: |
# Unless we add a .nojekyll to the base of the deployment folder, the underscores in foldernames
# like _static/ etc. pose problems on GH Pages.
cd docs && make html && touch _build/html/.nojekyll
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: docs/_build/html
branch: gh-pages
37 changes: 37 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: CI

on:
push:
branches: [ master, develop ]
pull_request:
branches: [ master, develop ]

jobs:
run_tests:

runs-on: ubuntu-latest
strategy:
matrix:
python: [3.7, 3.8, 3.9]
fail-fast: false

steps:
- uses: actions/checkout@v2

- name: Upgrade setuptools
run: |
pip3 install wheel --upgrade
pip3 install setuptools --upgrade
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}

- name: Install cryoDRGN with dev dependencies
run: |
python -m pip install .[dev]
- name: Pytest
run: |
pytest
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[![CI](https://github.com/zhonge/cryodrgn/actions/workflows/main.yml/badge.svg)](https://github.com/zhonge/cryodrgn/actions/workflows/main.yml)

# :snowflake::dragon: cryoDRGN: Deep Reconstructing Generative Networks for cryo-EM heterogeneous reconstruction

CryoDRGN is a neural network based algorithm for heterogeneous cryo-EM reconstruction. In particular, the method models a *continuous* distribution over 3D structures by using a neural network based representation for the volume.
Expand All @@ -12,13 +14,14 @@ Reconstructing continuous distributions of 3D protein structure from cryo-EM ima
Ellen D. Zhong, Tristan Bepler, Joseph H. Davis*, Bonnie Berger*.
ICLR 2020, Spotlight presentation, https://arxiv.org/abs/1909.05215

## Tutorial:

An online overview and walkthrough of cryoDRGN installation, training, and analysis is available here:
https://www.notion.so/cryoDRGN-tutorial-b932c021cb2c415282f182048bac16ff
## Documentation:

The latest documentation for cryoDRGN is available [here](https://zhonge.github.io/cryodrgn/). This includes an overview and walkthrough of cryoDRGN installation, training and analysis.

A more in-depth manuscript version of the tutorial is available [here](https://www.biorxiv.org/content/10.1101/2022.08.09.503342v1).

A more in-depth manuscript version of the tutorial is available here:
https://www.biorxiv.org/content/10.1101/2022.08.09.503342v1
Old Documentation pages are available at [notion.so](https://www.notion.so/cryoDRGN-tutorial-b932c021cb2c415282f182048bac16ff).

A quick start is provided below.

Expand Down Expand Up @@ -102,7 +105,7 @@ The official version 1.0 release. This version introduces several new tools for

<details><summary>Version 0.2.0</summary>

* New interface and proper python packaing with setup.py. This version has identical functionality and argument usage as previous versions, however tools are now available from a common entry point. See:
* New interface and proper python packaging with `setup.py`. This version has identical functionality and argument usage as previous versions, however tools are now available from a common entry point. See:

`$ cryodrgn <command> -h`

Expand Down Expand Up @@ -135,7 +138,7 @@ To install cryoDRGN, git clone the source code and install the following depende
git clone https://github.com/zhonge/cryodrgn.git
cd cryodrgn
git checkout 1.1.0 # or latest version
python setup.py install
pip install .

A detailed installation and testing guide is provided here: https://www.notion.so/cryoDRGN-installation-with-anaconda-4cff0367d9b241bb8d902efe339d01e6

Expand Down
9 changes: 8 additions & 1 deletion cryodrgn/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
import os

__version__ = '1.1.0'
# The _version.py file is managed by setuptools-scm
# and is not in version control.
try:
from ._version import version as __version__
except ModuleNotFoundError:
# We're likely running as a source package without installation
__version__ = 'src'

_ROOT = os.path.abspath(os.path.dirname(__file__))
2 changes: 1 addition & 1 deletion cryodrgn/commands_utils/write_star.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def main(args):
for i in range(2):
data[POSE_HDRS[3+i]] = trans[:,i]
df = pd.DataFrame(data=data)
headers = HEADERS + POSE_HDRS if args.poses else HEADERS
headers = HEADERS + POSE_HDRS if args.poses else HEADERS.copy()

if args.keep_micrograph:
assert args.ref_star, "Must provide reference .star file with micrograph coordinates"
Expand Down
8 changes: 8 additions & 0 deletions cryodrgn/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,11 @@ def zero_sphere(vol):
vol[tmp] = 0
return vol

def assert_pkl_close(pkl_a, pkl_b, atol=1e-4):
a = pickle.load(open(pkl_a, 'rb'))
b = pickle.load(open(pkl_b, 'rb'))
if isinstance(a, tuple):
for _a, _b in zip(a, b):
assert np.linalg.norm(_a - _b) < atol
else:
assert np.linalg.norm(a - b) < atol
24 changes: 24 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build
HTMLCOPYDIR = _build/html

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
ifneq ("$(HTMLCOPYDIR)", "$(BUILDDIR)/html")
cp -rT $(BUILDDIR)/html $(HTMLCOPYDIR)
endif
33 changes: 33 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = 'CryoDRGN'
copyright = '2022, Ellen Zhong'
author = 'Ellen Zhong'
release = '1.1.1'

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = ['myst_parser']

source_suffix = {
'.rst': 'restructuredtext',
'.md': 'markdown',
}

templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']



# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = 'sphinx_book_theme'
html_static_path = ['_static']
26 changes: 26 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
.. CryoDRGN documentation master file, created by
sphinx-quickstart on Mon Sep 12 11:12:23 2022.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to CryoDRGN's documentation!
====================================

.. toctree::
:maxdepth: 1
:caption: Contents:

pages/intro
pages/installation
pages/empiar_tutorial
pages/landscape_analysis
pages/large_datasets
pages/faq


Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
set BUILDDIR=_build

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)

if "%1" == "" goto help

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
Binary file added docs/pages/assets/Untitled.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/pages/assets/Untitled_1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/pages/assets/Untitled_10.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/pages/assets/Untitled_11.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/pages/assets/Untitled_12.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/pages/assets/Untitled_13.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/pages/assets/Untitled_14.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/pages/assets/Untitled_15.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/pages/assets/Untitled_16.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/pages/assets/Untitled_17.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/pages/assets/Untitled_18.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/pages/assets/Untitled_19.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/pages/assets/Untitled_2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/pages/assets/Untitled_20.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/pages/assets/Untitled_21.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/pages/assets/Untitled_22.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/pages/assets/Untitled_23.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/pages/assets/Untitled_24.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/pages/assets/Untitled_25.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/pages/assets/Untitled_26.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/pages/assets/Untitled_27.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/pages/assets/Untitled_28.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/pages/assets/Untitled_29.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/pages/assets/Untitled_3.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/pages/assets/Untitled_30.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/pages/assets/Untitled_31.png
Binary file added docs/pages/assets/Untitled_32.png
Binary file added docs/pages/assets/Untitled_33.png
Binary file added docs/pages/assets/Untitled_34.png
Binary file added docs/pages/assets/Untitled_35.png
Binary file added docs/pages/assets/Untitled_36.png
Binary file added docs/pages/assets/Untitled_37.png
Binary file added docs/pages/assets/Untitled_38.png
Binary file added docs/pages/assets/Untitled_39.png
Binary file added docs/pages/assets/Untitled_4.png
Binary file added docs/pages/assets/Untitled_40.png
Binary file added docs/pages/assets/Untitled_41.png
Binary file added docs/pages/assets/Untitled_42.png
Binary file added docs/pages/assets/Untitled_43.png
Binary file added docs/pages/assets/Untitled_44.png
Binary file added docs/pages/assets/Untitled_45.png
Binary file added docs/pages/assets/Untitled_46.png
Binary file added docs/pages/assets/Untitled_47.png
Binary file added docs/pages/assets/Untitled_48.png
Binary file added docs/pages/assets/Untitled_49.png
Binary file added docs/pages/assets/Untitled_5.png
Binary file added docs/pages/assets/Untitled_50.png
Binary file added docs/pages/assets/Untitled_51.png
Binary file added docs/pages/assets/Untitled_52.png
Binary file added docs/pages/assets/Untitled_53.png
Binary file added docs/pages/assets/Untitled_54.png
Binary file added docs/pages/assets/Untitled_55.png
Binary file added docs/pages/assets/Untitled_56.png
Binary file added docs/pages/assets/Untitled_57.png
Binary file added docs/pages/assets/Untitled_58.png
Binary file added docs/pages/assets/Untitled_59.png
Binary file added docs/pages/assets/Untitled_6.png
Binary file added docs/pages/assets/Untitled_60.png
Binary file added docs/pages/assets/Untitled_61.png
Binary file added docs/pages/assets/Untitled_62.png
Binary file added docs/pages/assets/Untitled_63.png
Binary file added docs/pages/assets/Untitled_64.png
Binary file added docs/pages/assets/Untitled_65.png
Binary file added docs/pages/assets/Untitled_66.png
Binary file added docs/pages/assets/Untitled_67.png
Binary file added docs/pages/assets/Untitled_68.png
Binary file added docs/pages/assets/Untitled_7.png
Binary file added docs/pages/assets/Untitled_8.png
Binary file added docs/pages/assets/Untitled_9.png
Binary file added docs/pages/assets/preprocess1.png
Binary file added docs/pages/assets/preprocess2.png

0 comments on commit d47ddc3

Please sign in to comment.