Skip to content

Commit

Permalink
Merge pull request #234 from scipion-em/devel
Browse files Browse the repository at this point in the history
3.0.0b5
  • Loading branch information
azazellochg authored Oct 26, 2020
2 parents ec72a60 + 04cb088 commit de082a4
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 14 deletions.
4 changes: 2 additions & 2 deletions relion/convert/convert31.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,8 +572,8 @@ def rowToCtf(row, ctf):
ctf.setResolution(row.rlnCtfMaxResolution or 0)
ctf.setFitQuality(row.rlnCtfFigureOfMerit or 0)

if getattr(row, 'rlnCtfPhaseShift', False):
ctf.setPhaseShift(row.rlnCtfPhaseShift)
if getattr(row, 'rlnPhaseShift', False):
ctf.setPhaseShift(row.rlnPhaseShift)
ctf.standardize()

if hasattr(row, 'rlnCtfImage'):
Expand Down
2 changes: 1 addition & 1 deletion relion/convert/convert_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def _ctfToRow(self, ctf, row):
phaseShift = ctf.getPhaseShift()

if phaseShift is not None:
row['rlnCtfPhaseShift'] = phaseShift
row['rlnPhaseShift'] = phaseShift


class ReaderBase:
Expand Down
11 changes: 6 additions & 5 deletions relion/protocols/protocol_assign_optic_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,12 @@ def createOutputStep(self, inputId):
for row in micTable}

# check if MTF file exists
for i in og:
if not pwutils.exists(i.rlnMtfFileName):
self.warning("MTF file %s not found for %s" % (
i.rlnMtfFileName, i.rlnOpticsGroupName
))
if og.hasColumn('rlnMtfFileName'):
for i in og:
if not pwutils.exists(i.rlnMtfFileName):
self.warning("MTF file %s not found for %s" % (
i.rlnMtfFileName, i.rlnOpticsGroupName
))

def updateItem(item, row):
micName = getMicName(item)
Expand Down
3 changes: 2 additions & 1 deletion relion/protocols/protocol_bayesian_polishing.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,8 @@ def convertInputStep(self, movId, partId, postId):
moviesPixelSize = inputMovies.getSamplingRate()
binningFactor = inputParts.getSamplingRate() / moviesPixelSize

writer = convert.createWriter()
og = convert.OpticsGroups.fromImages(inputMovies)
writer = convert.createWriter(optics=og)
writer.writeSetOfMicrographs(inputMovies,
self._getFileName('input_mics'),
postprocessImageRow=self._updateMic)
Expand Down
3 changes: 3 additions & 0 deletions relion/protocols/protocol_reconstruct.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ def _insertReconstructStep(self):
if self.ctfIntactFirstPeak:
params += ' --ctf_intact_first_peak'

if imgSet.isPhaseFlipped():
params += ' --ctf_phase_flipped'

if self.extraParams.hasValue():
params += " " + self.extraParams.get()

Expand Down
11 changes: 7 additions & 4 deletions relion/viewers/viewer_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,11 @@ def _defineParams(self, form):
default=ANGDIST_2DPLOT,
display=params.EnumParam.DISPLAY_HLIST,
label='Display angular distribution',
help='*2D plot*: display angular distribution as interative 2D in matplotlib.\n'
help='*2D plot*: display angular distribution as interactive 2D in matplotlib.\n'
'*chimera*: display angular distribution using Chimera with red spheres.')
group.addParam('spheresScale', params.IntParam, default=-1,
expertLevel=LEVEL_ADVANCED,
condition='displayAngDist == %d' % ANGDIST_CHIMERA,
label='Spheres distance',
help='If the value is -1 then the distance is set '
'to 0.75 * xVolDim')
Expand Down Expand Up @@ -366,13 +367,15 @@ def _showPMax(self, paramName=None):
tablePMax = Table(columns=labels)

for it in self._getAllIters():
if it == 1: # skip iter1 with Pmax=1
continue
# always list all iterations
prefix = self.protocol.PREFIXES[0]
fn = self.protocol._getFileName(prefix + 'model', iter=it)
table = Table(fileName=fn, tableName='model_general')
row = table[0]
tablePMax.addRow(it, row.rlnAveragePmax,
row.rlnLogLikelihood)
tablePMax.addRow(int(it), float(row.rlnAveragePmax),
float(row.rlnLogLikelihood))

fn = self.protocol._getFileName('all_avgPmax')
with open(fn, 'w') as f:
Expand All @@ -382,7 +385,7 @@ def _showPMax(self, paramName=None):
xplotter.createSubPlot("Avg PMax per Iterations", "Iterations",
"Avg PMax")
xplotter.plotMd(tablePMax, 'rlnIterationNumber',
'rlnAveragePmax', 'g')
'rlnAveragePmax')
xplotter.showLegend(['rlnAveragePmax'])

return [self.createDataView(fn), xplotter]
Expand Down
1 change: 1 addition & 0 deletions relion/viewers/viewer_ctfrefine.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ def _defineParams(self, form):
form.addSection(label="Results")
form.addParam('useMatplotlib', params.BooleanParam, default=True,
label='Use matplotlib for display',
condition="not {}".format(showDefocus),
help='If False, images will be displayed with ImageJ')

form.addParam('displayAnisoMag', params.LabelParam,
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
# For a discussion on single-sourcing the version across setup.py and the
# project code, see
# https://packaging.python.org/en/latest/single_source_version.html
version='3.0.0b4', # Required
version='3.0.0b5', # Required

# This is a one-line description or tagline of what your project does. This
# corresponds to the "Summary" metadata field:
Expand Down

0 comments on commit de082a4

Please sign in to comment.