Skip to content

Commit

Permalink
Merge pull request #155 from scipion-em/devel
Browse files Browse the repository at this point in the history
Compatibility with cryoSPARC v4.4.1
  • Loading branch information
fonsecareyna82 authored Jan 25, 2024
2 parents 916612f + 5ed4f86 commit f21e32f
Show file tree
Hide file tree
Showing 21 changed files with 1,319 additions and 290 deletions.
9 changes: 9 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
Dec 22, 2023 - **v4.0.10**
Compatibility with cryoSPARC v4.4.1

Add new protocols:
* **3D Variability Analysis**: Protocol to compute the principle modes of variability with a dataset of aligned particles
* **3D Variability Display**: Protocol to create various versions of a 3D variability result that can be used for display
* **Blob Picker**: Automatically picks particles by searching for Gaussian signals.
* **Patch CTF Estimation**: Patch-based CTF estimation automatically estimates defocus variation for tilted, bent, deformed samples and is accurate for all particle sizes and types including flexible and membrane proteins.

Nov 17, 2023 - **v4.0.9**
Compatibility with cryoSPARC v4.4.0
Handling aborted protocols/jobs
Expand Down
27 changes: 16 additions & 11 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,31 @@ You will need to use `3.0.0 <https://scipion-em.github.io/docs/release-3.0.0/doc
* **Symmetry Expansion**: Duplicate particles around a point-group symmetry.
* **Homogeneous Reconstruction**: Reconstruct half-maps from input particles with alignments
* **3D Classification**: Classify particles into multiple 3D classes and optimize 3D class densities (currently, without re-aligning particle pose or shift).
* **3D Variability Analysis**: Protocol to compute the principle modes of variability with a dataset of aligned particles
* **3D Variability Display**: Protocol to create various versions of a 3D variability result that can be used for display
* **Blob Picker**: Automatically picks particles by searching for Gaussian signals.
* **Patch CTF Estimation**: Patch-based CTF estimation automatically estimates defocus variation for tilted, bent, deformed samples and is accurate for all particle sizes and types including flexible and membrane proteins.

**Latest plugin version**
==========================

**v4.0.10**
-----------
* **new** Compatibility with cryoSPARC v4.4.1
* **new** Add new protocols:

* **3D Variability Analysis**: Protocol to compute the principle modes of variability with a dataset of aligned particles
* **3D Variability Display**: Protocol to create various versions of a 3D variability result that can be used for display
* **Blob Picker**: Automatically picks particles by searching for Gaussian signals.




**v4.0.9**
-----------
* **new** Compatibility with cryoSPARC v4.4.0
* **fixed** Handling aborted protocols/jobs

**v4.0.8**
-----------
* **new** Compatibility with cryoSPARC v4.3.1
* **removed** Deprecated protocols removed: Legacy Refine, Legacy no uniform refine, Legacy naive local refine.

**v4.0.7**
-----------
* **new** : Compatibility with cryoSPARC v4.2.1
* **new** Plugin operation in a cluster
* **fixed** Fixed an installation error
* **fixed** Fixed an error related with the calculation of the particles shifts

**Installing the plugin**
=========================
Expand Down
4 changes: 2 additions & 2 deletions cryosparc2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

from .constants import *

__version__ = '4.0.9'
__version__ = '4.0.10'
_references = ['Punjani2017', 'Brubaker2017', 'daniel_asarnow_2019_3576630']
_logo = 'cryosparc2_logo.png'

Expand All @@ -42,7 +42,7 @@ class Plugin(em.Plugin):
_pathVars = [CRYOSPARC_HOME]
_supportedVersions = [V3_0_0, V3_0_1, V3_1_0, V3_2_0, V3_3_0, V3_3_1,
V3_3_2, V4_0_0, V4_0_1, V4_0_2, V4_0_3, V4_1_0,
V4_1_1, V4_1_2, V4_2_0, V4_2_1, V4_3_1, V4_4_0]
V4_1_1, V4_1_2, V4_2_0, V4_2_1, V4_3_1, V4_4_0, V4_4_1]

@classmethod
def _defineVariables(cls):
Expand Down
5 changes: 3 additions & 2 deletions cryosparc2/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def getPyemEnvName(version):
V4_2_1 = 'V4.2.1'
V4_3_1 = 'V4.3.1'
V4_4_0 = 'V4.4.0'
V4_4_1 = 'V4.4.1'

# Symmetry dict
CS_SYM_NAME = dict()
Expand Down Expand Up @@ -125,9 +126,9 @@ def getPyemEnvName(version):
ANGDIST_CHIMERA = 1

# VOLUME_SLICES = 0
VOLUME_CHIMERA = 1
VOLUME_CHIMERA = 0
VOLUME_CRYOSPARC = 0
DATA_VIEWER = 0
DATA_VIEWER = 1

fscValues = dict()
fscValues['fsc_nomask'] = 'No mask'
Expand Down
11 changes: 9 additions & 2 deletions cryosparc2/protocols/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,18 @@
from .protocol_cryosparc_symmetry_expansion import ProtCryoSparcSymmetryExpansion
from .protocol_cryosparc_homogeneous_reconstruction import ProtCryoSparcHomogeneousReconstruct
from .protocol_cryosparc_new_3D_classification import ProtCryoSparcNew3DClassification
"""

from .protocol_cryosparc_3d_variability import ProtCryoSparc3DVariability
from .protocol_cryosparc_3d_variability_display import ProtCryoSparc3DVariabilityAnalisys
from .protocol_cryosparc_3d_variability_display import ProtCryoSparc3DVariabilityDisplay

from .protocol_cryosparc_blob_picker import ProtCryoSparcBlobPicker
from .protocol_cryosparc_patch_ctf_estimation import ProtCryoSparcPatchCTFEstimate

"""
from .protocol_cryosparc_3D_flex_data_prepare import ProtCryoSparc3DFlexDataPrepare
from .protocol_cryosparc_3D_flex_mesh_prepare import ProtCryoSparc3DFlexMeshPrepare
from .protocol_cryosparc_3D_flex_training import ProtCryoSparc3DFlexTraining
from .protocol_cryosparc_3D_flex_reconstruction import ProtCryoSparc3DFlexReconstruction
"""


22 changes: 19 additions & 3 deletions cryosparc2/protocols/protocol_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
doImportParticlesStar, doImportVolumes, killJob, clearJob,
get_job_streamlog, getSystemInfo, getJobStatus,
STOP_STATUSES, getCryosparcVersion, getProjectInformation,
getCryosparcProjectId, _getLicenceFromFile)
getCryosparcProjectId, _getLicenceFromFile, doImportMicrographs)


class ProtCryosparcBase(pw.EMProtocol):
Expand Down Expand Up @@ -118,6 +118,11 @@ def convertInputStep(self):
self._importMask()
else:
self.mask = pwobj.String()

micrographs = self._getInputMicrographs()
if micrographs is not None:
self._importMicrographs()

self._store(self)

def _getScaledAveragesFile(self, csAveragesFile, force=False):
Expand Down Expand Up @@ -187,9 +192,14 @@ def _getInputMask(self):
return self.refMask.get()
return None

def _getInputMicrographs(self):
if self.hasAttribute('inputMicrographs'):
return self.inputMicrographs.get()
return None

def _initializeVolumeSuffix(self):
"""
Create a output volume suffix depend of the CS version
Create an output volume suffix depend on the CS version
"""
cryosparcVersion = parse_version(getCryosparcVersion())
self.outputVolumeSuffix = '.imported_volume.map'
Expand Down Expand Up @@ -243,13 +253,19 @@ def _importMask(self):
self.mask = pwobj.String(str(importMaskJob.get()) + self.outputMaskSuffix)

def _importParticles(self):

# import_particles_star
importedParticlesJob = doImportParticlesStar(self)
self.currenJob = pwobj.String(str(importedParticlesJob.get()))
self.particles = pwobj.String(str(importedParticlesJob.get()) +
'.imported_particles')

def _importMicrographs(self):
importedMicrographsJob = doImportMicrographs(self)
self.currenJob = pwobj.String(str(importedMicrographsJob.get()))
self.micrographs = pwobj.String(str(importedMicrographsJob.get()) +
'.imported_micrographs')


def setAborted(self):
""" Set the status to aborted and updated the endTime. """
pw.EMProtocol.setAborted(self)
Expand Down
Loading

0 comments on commit f21e32f

Please sign in to comment.