Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jj deprecate re3 and improve warns #97

Merged
merged 3 commits into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion CHANGES.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 2 additions & 4 deletions reliontomo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down