Skip to content

Commit d08a9f7

Browse files
authored
Merge pull request #731 from ComputationalCryoEM/develop
Develop ~> Master v0.10.0 Release
2 parents 1bff8d3 + 0bd790b commit d08a9f7

File tree

115 files changed

+4991
-2014
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+4991
-2014
lines changed

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 0.9.2
2+
current_version = 0.10.0
33
commit = True
44
tag = True
55

CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# @global-owner1 and @global-owner2 will be requested for
77
# review when someone opens a pull request.
88
# * @global-owner1 @global-owner2
9-
* @janden
9+
* @janden @garrettwrong
1010

1111
# Order is important; the last matching pattern takes the most
1212
# precedence. When someone opens a pull request that only

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[![codecov](https://codecov.io/gh/ComputationalCryoEM/ASPIRE-Python/branch/master/graph/badge.svg?token=3XFC4VONX0)](https://codecov.io/gh/ComputationalCryoEM/ASPIRE-Python)
66
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.5657281.svg)](https://doi.org/10.5281/zenodo.5657281)
77

8-
# ASPIRE - Algorithms for Single Particle Reconstruction - v0.9.2
8+
# ASPIRE - Algorithms for Single Particle Reconstruction - v0.10.0
99

1010
This is the Python version to supersede the [Matlab ASPIRE](https://github.com/PrincetonUniversity/aspire).
1111

@@ -20,7 +20,7 @@ For more information about the project, algorithms, and related publications ple
2020
Please cite using the following DOI. This DOI represents all versions, and will always resolve to the latest one.
2121

2222
```
23-
ComputationalCryoEM/ASPIRE-Python: v0.9.2 https://doi.org/10.5281/zenodo.5657281
23+
ComputationalCryoEM/ASPIRE-Python: v0.10.0 https://doi.org/10.5281/zenodo.5657281
2424
2525
```
2626

azure-pipelines.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ schedules:
99

1010
jobs:
1111
- job:
12-
displayName: ubuntu-latest
12+
displayName: ubuntu-22.04
1313
pool:
14-
vmImage: 'ubuntu-latest'
14+
vmImage: 'ubuntu-22.04'
1515
strategy:
1616
matrix:
1717
Python37:
@@ -31,9 +31,9 @@ jobs:
3131
displayName: pytest
3232
3333
- job:
34-
displayName: ubuntu-18.04
34+
displayName: ubuntu-20.04
3535
pool:
36-
vmImage: 'ubuntu-18.04'
36+
vmImage: 'ubuntu-20.04'
3737
strategy:
3838
matrix:
3939
Python37:
@@ -86,9 +86,9 @@ jobs:
8686
displayName: pytest
8787
8888
- job:
89-
displayName: macOS-10.15
89+
displayName: macOS-11
9090
pool:
91-
vmImage: 'macOS-10.15'
91+
vmImage: 'macOS-11'
9292
strategy:
9393
matrix:
9494
Python37:

docs/source/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,14 @@
7474
# built documents.
7575
#
7676
# The full version, including alpha/beta/rc tags.
77-
release = version = "0.9.2"
77+
release = version = "0.10.0"
7878

7979
# The language for content autogenerated by Sphinx. Refer to documentation
8080
# for a list of supported languages.
8181
#
8282
# This is also used if you do content translation via gettext catalogs.
8383
# Usually you set "language" from the command line for these cases.
84-
language = None
84+
language = 'en'
8585

8686
# List of patterns, relative to source directory, that match files and
8787
# directories to ignore when looking for source files.

docs/source/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Aspire v0.9.2
1+
Aspire v0.10.0
22
==============
33

44
Algorithms for Single Particle Reconstruction

docs/source/quickstart.rst

Lines changed: 60 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ CRYO projections (MRC files).
99
aspire <command>
1010
1111
Running the ``aspire`` module as a script allows one to run different stages of the Cryo-EM data pipeline.
12-
Substitute ``<command>`` with one of the available ``aspire`` commands. Use the ``-h`` flag to display all available commands.
12+
Substitute ``<command>`` with one of the available ``aspire`` commands. Use ``aspire --help`` to display all available commands and ``aspire <command> --help`` to display configurable options for a particular ``<command>``.
1313

1414
Currently, the following operations can be run with ASPIRE:
1515

@@ -28,73 +28,94 @@ For example, to run the command on sample data included in ASPIRE (a single ``sa
2828
mkdir apple_output
2929
aspire apple --mrc_path /path/to/aspire/data/sample.mrc --output_dir particles
3030
31-
Use the ``--help`` argument with the command to see the several options associated with this command.
31+
2. Particle Extraction
32+
######################
3233

33-
2. Simulation
34-
#############
34+
Given a dataset of full micrographs (``*.mrc`` file) and corresponding coordinate files containing the locations
35+
of picked particles in the ``*.mrc``, the ``extract-particles`` command extracts the particles into one or more ``.mrcs``
36+
stacks and generates a ``.star`` file.
3537

36-
The ``simulation`` command simulates a virtual particle made up of multiple gaussian blobs, generates of set of (noisy) images,
37-
runs the ASPIRE pipeline to determine the estimated mean volume and estimated covariance on the mean volume,
38-
and runs evaluations on these estimated quantities (against the `true` values which we know from the simulation).
38+
Example usage:
39+
40+
.. code-block::
41+
42+
aspire extract-particles --mrc_paths=my/data/sample.mrc --coord_paths=my/data/coords/sample.coord --starfile_out=my_dataset_stack.star --particle_size=256 --centers
43+
44+
3. Estimate Contrast Transfer Function
45+
######################################
46+
47+
The ``estimate-ctf`` command estimates the CTF from experimental data and saves the CTF as an ``.mrc`` file. For example,
3948

4049
.. code-block:: console
4150
42-
aspire simulation
51+
aspire estimate-ctf --data_folder path_to_input_data_folder
4352
44-
Use the ``--help`` argument to look for configurable options. You can select the no. of distinct gaussian blobs, the no. of images,
45-
the resolution of the (square) images generated etc.
53+
.. note::
4654

47-
3. Reconstructing a mean volume with covariance
48-
###############################################
55+
This command expects data files are in the directory prescribed by ``--data_folder``,
56+
and will process all files with the extension ``.mrc`` and ``.mrcs`` contained there.
57+
This command will output ``.mrc`` files to a ``--output_dir`` (``./results`` by default).
4958

50-
The ``cov3d`` command takes in a ``*.star`` file, processes the images (``*.mrcs`` files) found in the starfile, and runs the ASPIRE pipeline
51-
to determine the estimated mean volume and estimated covariance on the mean volume. No results are saved currently, but this command is
52-
a good way to exercise most parts of the ASPIRE pipeline.
59+
4. Image Preprocessing
60+
######################
5361

54-
For example, to run the command on a sample data included in ASPIRE:
62+
The ``preprocess`` command takes in a ``*.star`` file representing particle stacks and applies a selection of preprocessing
63+
methods such as phase flipping, downsampling, normalization to background noise, noise whitening, and contrast inversion.
64+
Resulting images are saved as a starfile.
65+
66+
For example, to run the command on sample data included in ASPIRE:
5567

5668
.. code-block:: console
5769
58-
aspire cov3d --starfile /path/to/aspire/data/sample_relion_data.star --pixel_size 1.338 --max_resolution 8 --cg_tol 0.2
70+
aspire preprocess --starfile_in path/to/aspire/data/sample_relion_data.star --starfile_out preprocess_output.star --downsample 8
5971
60-
.. note::
72+
5. Image Denoising
73+
##################
6174

62-
Pay special attention to the flags specified in the example above. The ``--max_resolution 8``
63-
flag down-samples images to 8x8 pixels (needed otherwise you may run out of memory, and/or the script may take way
64-
too long to execute). ``--cg_tol 0.2`` sets very liberal (and unrealistic) limits on optimization convergence
65-
tolerance, which is needed for such a small dataset. For real datasets, you typically *do not* want to override this
66-
parameter.
75+
The ``denoise`` command takes in a ``*.star`` file, downsamples the images (``*.mrcs`` files) found in the starfile
76+
to a desired resolution, then estimates the noise of the images and whitens that noise using the covariance
77+
Weiner filtering method. The denoised images (``*.mrcs``) and a corresponding starfile are saved in an output folder.
6778

68-
Use the ``--help`` argument to look for configurable options.
79+
For example, to run the command on sample data included in ASPIRE:
6980

70-
4. Crop a set of projections
71-
############################
81+
.. code-block:: console
7282
73-
The ``crop`` command crops a stack of projections of an mrc file to squares of a given size (in pixels). For example,
83+
mkdir denoise_output
84+
aspire denoise --starfile_in path/to/aspire/data/sample_relion_data.star --starfile_out denoise_output/denoised_images.star
7485
75-
.. code-block:: console
86+
6. Orientation Estimation
87+
#########################
7688

77-
aspire --debug -v 3 crop demo.mrc 42
89+
The ``orient3d`` command takes in a ``*.star`` file contaning images and performs an orientation estimation using the
90+
common lines algorithm employing synchronization and voting described at :cite:`DBLP:journals/siamis/ShkolniskyS12`.
91+
The estimated rotations are saved in a starfile along with the original images.
7892

79-
.. note::
93+
For example, to run the command on sample data included in ASPIRE:
8094

81-
This command will crop images found in `demo.mrc` to images of size 42x42, in debug mode and with maximum verbosity.
95+
.. code-block:: console
8296
83-
5. Estimate Contrast Transfer Function
84-
######################################
97+
aspire orient3d --starfile_in path/to/aspire/data/sample_relion_data.star --starfile_out orient3d_output.star
8598
86-
The ``estimate-ctf`` command estimates the CTF from experimental data and returns the CTF as a mrc file. For example,
99+
7. Reconstructing a mean volume with covariance
100+
###############################################
101+
102+
The ``cov3d`` command takes in a ``*.star`` file, processes the images (``*.mrcs`` files) found in the starfile, and runs the ASPIRE pipeline
103+
to determine the estimated mean volume and estimated covariance on the mean volume. No results are saved currently, but this command is
104+
a good way to exercise most parts of the ASPIRE pipeline.
105+
106+
For example, to run the command on a sample data included in ASPIRE:
87107

88108
.. code-block:: console
89109
90-
python -m aspire estimate-ctf --data_folder path_to_input_data_folder
110+
aspire cov3d --starfile /path/to/aspire/data/sample_relion_data.star --pixel_size 1.338 --max_resolution 8 --cg_tol 0.2
91111
92112
.. note::
93113

94-
This command expects data files are in the directory prescribed by ``--data_folder``,
95-
and will process all files with the extension ``.mrc`` and ``.mrcs`` contained there.
96-
This command will output mrc files to a ``--output_dir``, set to ``./results`` by default.
97-
114+
Pay special attention to the flags specified in the example above. The ``--max_resolution 8``
115+
flag down-samples images to 8x8 pixels (needed otherwise you may run out of memory, and/or the script may take way
116+
too long to execute). ``--cg_tol 0.2`` sets very liberal (and unrealistic) limits on optimization convergence
117+
tolerance, which is needed for such a small dataset. For real datasets, you typically *do not* want to override this
118+
parameter.
98119

99120
Arguments, options and flags
100121
############################

docs/source/references.bib

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,19 @@ @article{DBLP:journals/siamis/SingerS11
4545
biburl = {https://dblp.org/rec/bib/journals/siamis/SingerS11},
4646
bibsource = {dblp computer science bibliography, https://dblp.org}
4747
}
48+
49+
@article{DBLP:journals/siamis/ShkolniskyS12,
50+
author = {Yoel Shkolnisky and
51+
Amit Singer},
52+
title = {Viewing Direction Estimation in Cryo-EM Using Synchronization},
53+
journal = {{SIAM} J. Imaging Sci.},
54+
volume = {5},
55+
number = {3},
56+
pages = {1088--1110},
57+
year = {2012},
58+
url = {https://doi.org/10.1137/120863642},
59+
doi = {10.1137/120863642},
60+
timestamp = {Tue, 14 Jul 2020 14:30:31 +0200},
61+
biburl = {https://dblp.org/rec/journals/siamis/ShkolniskyS12.bib},
62+
bibsource = {dblp computer science bibliography, https://dblp.org}
63+
}

gallery/experiments/experimental_abinitio_pipeline.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070

7171
# Peek
7272
if interactive:
73-
src.images(0, 10).show()
73+
src.images[:10].show()
7474

7575
# Use phase_flip to attempt correcting for CTF.
7676
logger.info("Perform phase flip to input images.")
@@ -87,7 +87,7 @@
8787

8888
# Peek, what do the whitened images look like...
8989
if interactive:
90-
src.images(0, 10).show()
90+
src.images[:10].show()
9191

9292
# # Optionally invert image contrast, depends on data convention.
9393
# # This is not needed for 10028, but included anyway.
@@ -117,7 +117,7 @@
117117
classification_src = cwf_denoiser.denoise()
118118
# Peek, what do the denoised images look like...
119119
if interactive:
120-
classification_src.images(0, 10).show()
120+
classification_src.images[:10].show()
121121

122122
# Use regular `src` for the alignment and composition (averaging).
123123
composite_basis = FFBBasis2D((src.L,) * 2, dtype=src.dtype)
@@ -147,7 +147,7 @@
147147
classes, reflections, distances = rir.classify()
148148
avgs = rir.averages(classes, reflections, distances)
149149
if interactive:
150-
avgs.images(0, 10).show()
150+
avgs.images[:10].show()
151151

152152
# %%
153153
# Common Line Estimation
@@ -172,7 +172,7 @@
172172
logger.info("Begin Volume reconstruction")
173173

174174
# Assign the estimated rotations to the class averages
175-
avgs.rots = rots_est
175+
avgs.rotations = rots_est
176176

177177
# Create a reasonable Basis for the 3d Volume
178178
basis = FFBBasis3D((img_size,) * 3, dtype=src.dtype)

gallery/experiments/preprocess_imgs_exp.py.dontrun

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,29 +28,29 @@ source = RelionSource(
2828
nimgs_ext = 1
2929

3030
print('Obtain original images')
31-
imgs_od = source.images(start=0, num=nimgs_ext)
31+
imgs_od = source.images[:nimgs_ext]
3232

3333
print('Perform phase flip to input images')
3434
source.phase_flip()
35-
imgs_pf = source.images(start=0, num=nimgs_ext)
35+
imgs_pf = source.images[:nimgs_ext]
3636

3737
max_resolution = 60
3838
print(f'Downsample resolution to {max_resolution} X {max_resolution}')
3939
source.downsample(max_resolution)
40-
imgs_ds = source.images(start=0, num=nimgs_ext)
40+
imgs_ds = source.images[:nimgs_ext]
4141

4242
print('Normalize images to noise background')
4343
source.normalize_background()
44-
imgs_nb = source.images(start=0, num=nimgs_ext)
44+
imgs_nb = source.images[:nimgs_ext]
4545

4646
print('Whiten noise of images')
4747
noise_estimator = WhiteNoiseEstimator(source)
4848
source.whiten(noise_estimator.filter)
49-
imgs_wt = source.images(start=0, num=nimgs_ext)
49+
imgs_wt = source.images[:nimgs_ext]
5050

5151
print('Invert global density contrast')
5252
source.invert_contrast()
53-
imgs_rc = source.images(start=0, num=nimgs_ext)
53+
imgs_rc = source.images[:nimgs_ext]
5454

5555
# plot the first images
5656
print('plot the first images')

0 commit comments

Comments
 (0)