diff --git a/CHANGES.txt b/CHANGES.txt index 60adb5d..e043ca8 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,10 @@ -v3.3.0: +v4.0.0: + Users: + - Adapted to scipion-em-relion deprecation of relion3. + - Add warning preventing to set the box size and the cropped box size to the same value as it may cause an + internal error in relion (Thanks to DSheperd). +v3.4.0: + Note: this was supposed to be 3.3.0, but was published as 3.4.0 Users: - After having performed a refine or classification of particles, fields _rlnLogLikeliContribution, _rlnMaxValueProbDistribution and _rlnNrOfSignificantSamples are registered, so they can be plotted versus the diff --git a/reliontomo/__init__.py b/reliontomo/__init__.py index 5556a14..f64bc97 100644 --- a/reliontomo/__init__.py +++ b/reliontomo/__init__.py @@ -24,13 +24,12 @@ # ************************************************************************** _logo = "relion_logo.jpg" _references = ['Scheres2012a', 'Scheres2012b', 'Kimanius2016', 'Zivanov2018'] -__version__ = '3.4.0' +__version__ = '4.0.0' try: import pwem from reliontomo.constants import RELIONTOMO_HOME, RELIONTOMO_DEFAULT, RELION, RELIONTOMO_CUDA_LIB, V4_0 import relion - from relion import V3_1 class Plugin(relion.Plugin): _supportedVersions = [V4_0] @@ -44,8 +43,7 @@ def _defineVariables(cls): @staticmethod def isRe40(): - """We only allow one version older than 4.0, which is 3.1""" - return False if Plugin.getHome().endswith(V3_1) else True + return True if Plugin.getHome().endswith(V4_0) else False @classmethod def runRelionTomo(cls, protocol, program, args, cwd=None, numberOfMpi=1): diff --git a/reliontomo/protocols/protocol_base_make_pseusosubtomos_and_rec_particle.py b/reliontomo/protocols/protocol_base_make_pseusosubtomos_and_rec_particle.py index 18148d1..abccce5 100644 --- a/reliontomo/protocols/protocol_base_make_pseusosubtomos_and_rec_particle.py +++ b/reliontomo/protocols/protocol_base_make_pseusosubtomos_and_rec_particle.py @@ -77,6 +77,17 @@ def createOutputStep(self): return self.genRelionParticles(binningFactor=self.binningFactor.get(), boxSize=self.croppedBoxSize.get()) # -------------------------- INFO functions ------------------------------- + def _warnings(self): + warnMsg = [] + boxSize = self.boxSize.get() + croppedBoxSize = self.croppedBoxSize.get() + if boxSize == croppedBoxSize: + warnMsg.append('Setting the same value to the Box size and the Cropped box size may cause errors in ' + 'later steps of the refinement cycle.') + elif boxSize < croppedBoxSize: + warnMsg.append(f"The Box size [{boxSize} px] should be lower than the Cropped box size [{croppedBoxSize} " + f"px]. Please check these parameters' help to get more detailed information.") + return warnMsg # --------------------------- UTILS functions ----------------------------- def _genCommonCmd(self):