Skip to content

Commit

Permalink
Compatibility with cryoSPARC v4.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
fonsecareyna82 committed Jan 25, 2024
1 parent 0316992 commit 5ed4f86
Show file tree
Hide file tree
Showing 15 changed files with 35 additions and 42 deletions.
2 changes: 2 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
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
Expand Down
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ You will need to use `3.0.0 <https://scipion-em.github.io/docs/release-3.0.0/doc

**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
Expand Down
2 changes: 1 addition & 1 deletion cryosparc2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 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
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class ProtCryoSparc3DFlexDataPrepare(ProtCryosparcBase):
_label = '3D flex data prepare'
_devStatus = BETA
_protCompatibility = [V4_1_0, V4_1_1, V4_1_2, V4_2_0, V4_2_1, V4_3_1,
V4_4_0]
V4_4_0, V4_4_1]

# --------------------------- DEFINE param functions ----------------------
def _defineFileNames(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class ProtCryoSparc3DFlexMeshPrepare(ProtCryosparcBase):
_label = '3D flex mesh prepare'
_devStatus = BETA
_protCompatibility = [V4_1_0, V4_1_1, V4_1_2, V4_2_0, V4_2_1, V4_3_1,
V4_4_0]
V4_4_0, V4_4_1]

# --------------------------- DEFINE param functions ----------------------
def _defineFileNames(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class ProtCryoSparc3DFlexReconstruction(ProtCryosparcBase):
"""
_label = '3D flex reconstruction'
_devStatus = BETA
_protCompatibility = [V4_1_0, V4_1_1, V4_1_2, V4_2_0, V4_2_1, V4_3_1, V4_4_0]
_protCompatibility = [V4_1_0, V4_1_1, V4_1_2, V4_2_0, V4_2_1, V4_3_1, V4_4_0, V4_4_1]

# --------------------------- DEFINE param functions ----------------------
def _defineFileNames(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class ProtCryoSparc3DFlexTraining(ProtCryosparcBase):
"""
_label = '3D flex training'
_devStatus = BETA
_protCompatibility = [V4_1_0, V4_1_1, V4_1_2, V4_2_0, V4_2_1, V4_3_1, V4_4_0]
_protCompatibility = [V4_1_0, V4_1_1, V4_1_2, V4_2_0, V4_2_1, V4_3_1, V4_4_0, V4_4_1]

# --------------------------- DEFINE param functions ----------------------
def _defineFileNames(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,11 @@
# *
# **************************************************************************
import os.path
import zipfile

from pwem.objects import Volume, SetOfVolumes
from pyworkflow import BETA
from pyworkflow.protocol.params import (PointerParam, FloatParam,
LEVEL_ADVANCED, EnumParam, IntParam,
LEVEL_ADVANCED, EnumParam,
Positive, BooleanParam, StringParam)
from pwem.protocols import ProtRefine3D

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class ProtCryoSparcGlobalCtfRefinement(ProtCryosparcBase, pwprot.ProtParticles):
_label = 'global ctf refinement'
_className = "ctf_refine_global"
_protCompatibility = [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]
newParamsName = []

def _initialize(self):
Expand Down
36 changes: 15 additions & 21 deletions cryosparc2/protocols/protocol_cryosparc_helical_refinement.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class ProtCryoSparcHelicalRefine3D(ProtCryoSparc3DHomogeneousRefine):
_label = '3D helical refinement'
_fscColumns = 4
_protCompatibility = [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_0, V4_1_1, V4_1_2, V4_2_0, V4_2_1, V4_3_1, V4_4_0, V4_4_1]
_className = "helix_refine"

def _defineParams(self, form):
Expand Down Expand Up @@ -241,26 +241,20 @@ def processStep(self):
def _validate(self):
validateMsgs = cryosparcValidate()
if not validateMsgs:
csVersion = getCryosparcVersion()
if [version for version in self._protCompatibility
if parse_version(version) >= parse_version(csVersion)]:
validateMsgs = gpusValidate(self.getGpuList(), checkSingleGPU=True)
if not validateMsgs:
if self.referenceVolume.get() is None and not self.use_cylindrical_model.get():
validateMsgs.append("Cannot generate initial model "
"without in-plane rotation "
"information. Please input an "
"initial model from a previous ab-initio or "
"refinement protocol, or activate the "
"'Generate a cylindrical initial "
"model?' parameter")

if self.use_cylindrical_model.get() and self.filament_outer_diameter.get() is None:
validateMsgs.append("Must set the filament outer diameter to use a cylindrical model")

else:
validateMsgs.append("The protocol is not compatible with the "
"cryoSPARC version %s" % csVersion)
validateMsgs = gpusValidate(self.getGpuList(), checkSingleGPU=True)
if not validateMsgs:
if self.referenceVolume.get() is None and not self.use_cylindrical_model.get():
validateMsgs.append("Cannot generate initial model "
"without in-plane rotation "
"information. Please input an "
"initial model from a previous ab-initio or "
"refinement protocol, or activate the "
"'Generate a cylindrical initial "
"model?' parameter")

if self.use_cylindrical_model.get() and self.filament_outer_diameter.get() is None:
validateMsgs.append("Must set the filament outer diameter to use a cylindrical model")

return validateMsgs

def _defineParamsName(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class ProtCryoSparcHomogeneousReconstruct(ProtCryosparcBase):
_fscColumns = 6
_protCompatibility = [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_3_1, V4_4_0, V4_4_1]
ewsParamsName = []

def _initialize(self):
Expand Down Expand Up @@ -355,10 +355,8 @@ def _validate(self):
validateMsgs = cryosparcValidate()
if not validateMsgs:
csVersion = getCryosparcVersion()
if [version for version in self._protCompatibility
if parse_version(version) >= parse_version(csVersion)]:
validateMsgs = gpusValidate(self.getGpuList(),
checkSingleGPU=True)
if [version for version in self._protCompatibility if parse_version(version) <= parse_version(csVersion)]:
validateMsgs = gpusValidate(self.getGpuList(), checkSingleGPU=True)
if not validateMsgs:
particles = self._getInputParticles()
if not particles.hasCTF():
Expand Down
5 changes: 2 additions & 3 deletions cryosparc2/protocols/protocol_cryosparc_homogeneous_refine.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class ProtCryoSparc3DHomogeneousRefine(ProtCryosparcBase):
_className = "homo_refine_new"
ewsParamsName = []
_protCompatibility = [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]

# --------------------------- DEFINE param functions ----------------------
def _defineFileNames(self):
Expand Down Expand Up @@ -509,8 +509,7 @@ def _validate(self):
validateMsgs = cryosparcValidate()
if not validateMsgs:
csVersion = getCryosparcVersion()
if [version for version in self._protCompatibility
if parse_version(version) >= parse_version(csVersion)]:
if [version for version in self._protCompatibility if parse_version(version) <= parse_version(csVersion)]:
validateMsgs = gpusValidate(self.getGpuList())
if not validateMsgs:
particles = self._getInputParticles()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class ProtCryoSparcNew3DClassification(ProtCryosparcBase):
_label = '3D Classification'
_className = "class_3D"
_protCompatibility = [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_0, V4_1_1, V4_1_2, V4_2_0, V4_2_1, V4_3_1, V4_4_0, V4_4_1]

def _initialize(self):
self._defineFileNames()
Expand Down Expand Up @@ -486,8 +486,7 @@ def _validate(self):
validateMsgs = cryosparcValidate()
if not validateMsgs:
csVersion = getCryosparcVersion()
if [version for version in self._protCompatibility
if parse_version(version) >= parse_version(csVersion)]:
if [version for version in self._protCompatibility if parse_version(version) <= parse_version(csVersion)]:
validateMsgs = gpusValidate(self.getGpuList(),
checkSingleGPU=True)
if not validateMsgs:
Expand Down
4 changes: 2 additions & 2 deletions cryosparc2/protocols/protocol_cryosparc_new_local_refine.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class ProtCryoSparcLocalRefine(ProtCryosparcBase, ProtOperateParticles):
"""
_label = 'local refinement'
_protCompatibility = [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_0, V4_1_1, V4_1_2, V4_2_0, V4_2_1, V4_3_1, V4_4_0, V4_4_1]
_className = "new_local_refine"
_fscColumns = 6

Expand Down Expand Up @@ -279,7 +279,7 @@ def _validate(self):
if not validateMsgs:
csVersion = getCryosparcVersion()
if [version for version in self._protCompatibility
if parse_version(version) >= parse_version(csVersion)]:
if parse_version(version) <= parse_version(csVersion)]:
validateMsgs = gpusValidate(self.getGpuList(),
checkSingleGPU=True)
if not validateMsgs:
Expand Down

0 comments on commit 5ed4f86

Please sign in to comment.