summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Sims <mark@nanorex.com>2008-12-26 04:44:18 +0000
committerMark Sims <mark@nanorex.com>2008-12-26 04:44:18 +0000
commit1ab0cca92dcf90ad91af92563a762f06896a6154 (patch)
treee03aa896aad31d5959d841931be47f78e5fbf5e1
parent2b494c7151af9c413cc407030fdaa74b78198c86 (diff)
downloadnanoengineer-1ab0cca92dcf90ad91af92563a762f06896a6154.tar.gz
nanoengineer-1ab0cca92dcf90ad91af92563a762f06896a6154.zip
Deprecated set_current_protein_chunk_name() and get_current_protein_chunk_name. Use ops_select_Mixin's getSelectedProteinChunk() instead.
-rw-r--r--cad/src/ne1_ui/toolbars/Ui_ProteinFlyout.py9
-rw-r--r--cad/src/protein/commands/BackrubProteinSim/BackrubProteinSim_PropertyManager.py55
-rw-r--r--cad/src/protein/commands/BuildProtein/BuildProtein_PropertyManager.py63
-rw-r--r--cad/src/protein/commands/EditResidues/EditResidues_PropertyManager.py236
-rw-r--r--cad/src/protein/commands/FixedBBProteinSim/FixedBBProteinSim_PropertyManager.py11
5 files changed, 165 insertions, 209 deletions
diff --git a/cad/src/ne1_ui/toolbars/Ui_ProteinFlyout.py b/cad/src/ne1_ui/toolbars/Ui_ProteinFlyout.py
index 3d20e7c13..4ff968a73 100644
--- a/cad/src/ne1_ui/toolbars/Ui_ProteinFlyout.py
+++ b/cad/src/ne1_ui/toolbars/Ui_ProteinFlyout.py
@@ -342,10 +342,15 @@ class ProteinFlyout(Ui_AbstractFlyout):
"""
Score the current protein sequence
"""
+ proteinChunk = self.win.assy.getSelectedProteinChunk()
+ if not proteinChunk:
+ msg = "You must select a single protein to run a Rosetta <i>Score</i> calculation."
+ self.updateMessage(msg)
+ return
+
otherOptionsText = ""
numSim = 1
- protein = self.command.propMgr.get_current_protein_chunk_name()
- argList = [numSim, otherOptionsText, protein]
+ argList = [numSim, otherOptionsText, proteinChunk.name]
from simulation.ROSETTA.rosetta_commandruns import rosettaSetup_CommandRun
if argList[0] > 0:
diff --git a/cad/src/protein/commands/BackrubProteinSim/BackrubProteinSim_PropertyManager.py b/cad/src/protein/commands/BackrubProteinSim/BackrubProteinSim_PropertyManager.py
index cb2254a8a..19a346e67 100644
--- a/cad/src/protein/commands/BackrubProteinSim/BackrubProteinSim_PropertyManager.py
+++ b/cad/src/protein/commands/BackrubProteinSim/BackrubProteinSim_PropertyManager.py
@@ -50,7 +50,7 @@ class BackrubProteinSim_PropertyManager(Command_PropertyManager):
title = "Backrub Motion"
pmName = title
- iconPath = "ui/actions/Simulation/Rosetta.png"
+ iconPath = "ui/actions/Command Toolbar/BuildProtein/Backrub.png"
def __init__( self, command ):
@@ -93,10 +93,8 @@ class BackrubProteinSim_PropertyManager(Command_PropertyManager):
change_connect(self.okButton, SIGNAL("clicked()"), self.runRosettaBackrubSim)
return
-
#Protein Display methods
-
def show(self):
"""
Shows the Property Manager. Exends superclass method.
@@ -122,11 +120,11 @@ class BackrubProteinSim_PropertyManager(Command_PropertyManager):
Add the Property Manager group boxes.
"""
self._pmGroupBox2 = PM_GroupBox( self,
- title = "Backrub specific parameters")
+ title = "Backrub Specific Parameters")
self._loadGroupBox2( self._pmGroupBox2 )
self._pmGroupBox1 = PM_GroupBox( self,
- title = "Rosetta sequence design parameters")
+ title = "Rosetta Sequence Design Parameters")
self._loadGroupBox1( self._pmGroupBox1 )
return
@@ -156,10 +154,10 @@ class BackrubProteinSim_PropertyManager(Command_PropertyManager):
self.onlybbSpinBox = PM_DoubleSpinBox( pmGroupBox,
labelColumn = 0,
label = "Only backbone rotation:",
- minimum = 0.01,
- maximum = 1.0,
- value = 0.75,
- decimals = 2,
+ minimum = 0.01,
+ maximum = 1.0,
+ value = 0.75,
+ decimals = 2,
singleStep = 0.01,
setAsDefault = False,
spanWidth = False)
@@ -167,10 +165,10 @@ class BackrubProteinSim_PropertyManager(Command_PropertyManager):
self.onlyrotSpinBox = PM_DoubleSpinBox( pmGroupBox,
labelColumn = 0,
label = "Only rotamer rotation:",
- minimum = 0.01,
- maximum = 1.0,
- decimals = 2,
- value = 0.25,
+ minimum = 0.01,
+ maximum = 1.0,
+ decimals = 2,
+ value = 0.25,
singleStep = 0.01,
setAsDefault = False,
spanWidth = False)
@@ -178,10 +176,10 @@ class BackrubProteinSim_PropertyManager(Command_PropertyManager):
self.mctempSpinBox = PM_DoubleSpinBox( pmGroupBox,
labelColumn = 0,
label = "MC simulation temperature:",
- minimum = 0.1,
- value = 0.6,
- maximum = 1.0,
- decimals = 2,
+ minimum = 0.1,
+ value = 0.6,
+ maximum = 1.0,
+ decimals = 2,
singleStep = 0.1,
setAsDefault = False,
spanWidth = False)
@@ -226,19 +224,11 @@ class BackrubProteinSim_PropertyManager(Command_PropertyManager):
"""
Get number of residues for the current protein
"""
- previousCommand = self.command.find_parent_command_named('BUILD_PROTEIN')
- if previousCommand:
- #Urmi 20080728: get the protein currently selected in the combo box
- current_protein = previousCommand.propMgr.get_current_protein_chunk_name()
- for mol in self.win.assy.molecules:
- if mol.isProteinChunk() and current_protein == mol.name:
- return len(mol.protein.get_sequence_string())
-
- else:
- return 0
+ _current_protein = self.win.assy.getSelectedProteinChunk()
+ if _current_protein:
+ return len(_current_protein.protein.get_sequence_string())
return 0
-
def _loadGroupBox1(self, pmGroupBox):
"""
Load widgets in group box.
@@ -514,11 +504,14 @@ class BackrubProteinSim_PropertyManager(Command_PropertyManager):
"""
Get all the parameters from the PM and run a rosetta simulation
"""
+ proteinChunk = self.win.assy.getSelectedProteinChunk()
+ if not proteinChunk:
+ msg = "You must select a single protein to run a Rosetta <i>Backrub</i> simulation."
+ self.updateMessage(msg)
+ return
otherOptionsText = str(self.otherCommandLineOptions.toPlainText())
numSim = self.numSimSpinBox.value()
- previousCommand = self.command.find_parent_command_named('BUILD_PROTEIN')
- protein = previousCommand.propMgr.get_current_protein_chunk_name()
- argList = [numSim, otherOptionsText, protein]
+ argList = [numSim, otherOptionsText, proteinChunk.name]
backrubSpecificArgList = self.getBackrubSpecificArgumentList()
from simulation.ROSETTA.rosetta_commandruns import rosettaSetup_CommandRun
if argList[0] > 0:
diff --git a/cad/src/protein/commands/BuildProtein/BuildProtein_PropertyManager.py b/cad/src/protein/commands/BuildProtein/BuildProtein_PropertyManager.py
index e548438df..951b14b4d 100644
--- a/cad/src/protein/commands/BuildProtein/BuildProtein_PropertyManager.py
+++ b/cad/src/protein/commands/BuildProtein/BuildProtein_PropertyManager.py
@@ -13,8 +13,6 @@ To do list:
- Bug: Cannot edit a peptide loaded from an MMP file.
- Read FASTA file via sequence editor (or another way).
- Debug_pref for debug print statements.
-- Deprecate set_current_protein_chunk_name() and get_current_protein_chunk_name.
- Use ops_select_Mixin's getSelectedProteinChunk() instead.
- Bug: Returning from Compare command unselects the two selected protein chunks.
The PM list widget shows them as selected and the compare button is enabled,
but they are not selected in the graphics area.
@@ -160,7 +158,8 @@ class BuildProtein_PropertyManager(EditCommand_PM):
#parameters remained unchanged since last call. --- [CONDITION A]
if selection_params_unchanged and structure_params_unchanged and command_stack_params_unchanged:
#This second condition above fixes bug 2888
- print "Build Protein: _update_UI_do_updates(): DO NOTHING"
+ if 0:
+ print "Build Protein: _update_UI_do_updates() - DO NOTHING"
return
self._previousStructureParams = current_struct_params
@@ -249,8 +248,6 @@ class BuildProtein_PropertyManager(EditCommand_PM):
selectedProteins = []
if self.command is not None: # and self.command.hasValidStructure():
selectedProteins = self.win.assy.getSelectedProteinChunks()
-
- #print "_currentSelectionParams(): Number of selected proteins:", len(selectedProteins)
return (selectedProteins)
def _currentStructureParams(self):
@@ -271,8 +268,6 @@ class BuildProtein_PropertyManager(EditCommand_PM):
proteinList = []
proteinList = getAllProteinChunksInPart(self.win.assy)
params = len(proteinList)
-
- print "_currentStructureParams(): params:", params
return params
def close(self):
@@ -311,7 +306,7 @@ class BuildProtein_PropertyManager(EditCommand_PM):
#if not self.command.hasValidStructure():
# return
- proteinChunk = self.getSelectedProteinChunk()
+ proteinChunk = self.win.assy.getSelectedProteinChunk()
if proteinChunk:
proteinChunk.protein.edit(self.win)
@@ -382,56 +377,4 @@ class BuildProtein_PropertyManager(EditCommand_PM):
self.proteinListWidget.clear()
return
- def set_current_protein_chunk_name(self, name):
- """
- Sets the name of the currently selected peptide. Set it to an
- empty string if there is no currently selected peptide.
-
- @return: the name of the currently selected peptide.
- @rtype: string
-
- @note: this is used widely by other commands. It will be renamed to
- setCurrentPeptideName() soon.
- """
- self.current_protein = name
- return
-
-
- def get_current_protein_chunk_name(self):
- """
- Returns the name of the currently selected peptide. Returns an
- empty string if there is no currently selected peptide.
-
- @return: the name of the currently selected peptide.
- @rtype: string
-
- @note: this is used widely by other commands. It will be renamed to
- getCurrentPeptideName() soon.
- """
- return self.current_protein
-
- def getSelectedProteinChunk(self):
- """
- Returns only the currently selected protein chunk, if any.
- @return: the currently selected protein chunk or None if no peptide
- chunks are selected. Also returns None if more than one
- peptide chunk is select.
- @rtype: L{Chunk}
- @note: use L{getSelectedProteinChunks()} to get the list of all
- selected proteins.
- @attention: A method of the same name is in the ops_select_Mixin class.
- It is my intention to use that method and deprecate this one.
- I cannot do that until I remove all uses of
- get_current_protein_chunk_name() and
- set_current_protein_chunk_name() -- Mark. 2008-12-13
- """
- selectedPeptideList = self.win.assy.getSelectedProteinChunks()
- if len(selectedPeptideList) == 1:
- self.set_current_protein_chunk_name(selectedPeptideList[0].name)
- return selectedPeptideList[0]
- else:
- self.set_current_protein_chunk_name("")
- return None
- return
-
\ No newline at end of file
diff --git a/cad/src/protein/commands/EditResidues/EditResidues_PropertyManager.py b/cad/src/protein/commands/EditResidues/EditResidues_PropertyManager.py
index 11799100c..3a6dd45ae 100644
--- a/cad/src/protein/commands/EditResidues/EditResidues_PropertyManager.py
+++ b/cad/src/protein/commands/EditResidues/EditResidues_PropertyManager.py
@@ -12,6 +12,9 @@ Build > Protein mode.
@version: $Id$
@copyright: 2008 Nanorex, Inc. See LICENSE file for details.
+To do:
+- Auto-adjust width of PM to accomodate all widgets when entering cmd or
+ after selecting a new structure.
"""
import os, sys, time, fnmatch, string, re
import foundation.env as env
@@ -76,7 +79,7 @@ class EditResidues_PropertyManager(Command_PropertyManager):
title = "Edit Residues"
pmName = title
- iconPath = "ui/actions/Edit/EditProteinDisplayStyle.png"
+ iconPath = "ui/actions/Command Toolbar/BuildProtein/Residues.png"
rosetta_all_set = "PGAVILMFWYCSTNQDEHKR"
rosetta_polar_set = "___________STNQDEHKR"
@@ -96,12 +99,8 @@ class EditResidues_PropertyManager(Command_PropertyManager):
self.showTopRowButtons( PM_DONE_BUTTON | \
PM_WHATS_THIS_BUTTON)
- msg = "Edit residues."
-
self.editingItem = False
-
- self.updateMessage(msg)
-
+ return
def connect_or_disconnect_signals(self, isConnect = True):
@@ -168,7 +167,7 @@ class EditResidues_PropertyManager(Command_PropertyManager):
change_connect(self.showSequencePushButton,
SIGNAL("clicked()"),
self._showSeqEditor)
-
+ return
def _showSeqEditor(self):
"""
@@ -177,8 +176,6 @@ class EditResidues_PropertyManager(Command_PropertyManager):
if self.showSequencePushButton.isEnabled():
self.sequenceEditor.show()
return
-
-
def show(self):
"""
@@ -188,51 +185,29 @@ class EditResidues_PropertyManager(Command_PropertyManager):
#Urmi 20080728: Set the current protein and this will be used for accessing
#various properties of this protein
self.set_current_protein()
- if self.current_protein != "":
+ if self.current_protein:
+ msg = "Editing structure <b>%s</b>." % self.current_protein.name
self.showSequencePushButton.setEnabled(True)
else:
+ msg = "Select a single structure to edit."
self.showSequencePushButton.setEnabled(False)
self.sequenceEditor.hide()
_superclass.show(self)
self._fillSequenceTable()
+ self.updateMessage(msg)
+ return
+
def set_current_protein(self):
"""
Set the current protein for which all the properties are displayed to the
one chosen in the build protein combo box
"""
- #Urmi 20080728: created this method to update accessing properties of
- #"current protein" in this mode.
- self.current_protein = ""
-
- previousCommand = self.command.find_parent_command_named('BUILD_PROTEIN')
-
- if previousCommand:
- #Urmi 20080728: get the protein currently selected in the combo box
- self.current_protein = previousCommand.propMgr.get_current_protein_chunk_name()
- else:
- # If the previous command was zoom or something, just set this to the
- # first available protein chunk, since there's no way we can access
- # the current protein in Build protein mode. [Urmi]
- #
- # Note [bruce 080801]:
- # I think this 2nd case will never run, either now (not 100% sure
- # of this), or after command stack refactoring (pretty sure).
- for mol in self.win.assy.molecules:
- if mol.isProteinChunk():
- #Urmi 20080728: set the current protein to first available
- #protein in NE-1 part
- self.current_protein = mol.name
- sequence = mol.protein.get_sequence_string()
- self.sequenceEditor.setSequence(sequence)
- secStructure = mol.protein.get_secondary_structure_string()
- self.sequenceEditor.setSecondaryStructure(secStructure)
- self.sequenceEditor.setRuler(len(secStructure))
- break
+ self.current_protein = self.win.assy.getSelectedProteinChunk()
return
-
+
def _addGroupBoxes( self ):
"""
Add the Property Manager group boxes.
@@ -440,68 +415,67 @@ class EditResidues_PropertyManager(Command_PropertyManager):
Fills in the sequence table.
"""
+ if not self.current_protein:
+ return
+ else:
+ currentProteinChunk = self.current_protein
+
self.editingItem = True
- for chunk in self.win.assy.molecules:
- #Urmi 20080728: slot connection for current protein in build protein mode
- if chunk.isProteinChunk() and chunk.name == self.current_protein:
- aa_list = chunk.protein.get_amino_acids()
- aa_list_len = len(aa_list)
- self.sequenceTable.setRowCount(aa_list_len)
- for index in range(aa_list_len):
- # Selection checkbox column
- item_widget = QTableWidgetItem("")
- item_widget.setFont(self.labelfont)
- item_widget.setCheckState(Qt.Checked)
- item_widget.setTextAlignment(Qt.AlignLeft)
- item_widget.setSizeHint(QSize(20,12))
- item_widget.setFlags(
- Qt.ItemIsSelectable |
- Qt.ItemIsEnabled |
- Qt.ItemIsUserCheckable)
- self.sequenceTable.setItem(index, 0, item_widget)
-
- # Amino acid index column
- item_widget = QTableWidgetItem(str(index+1))
- item_widget.setFont(self.labelfont)
- item_widget.setFlags(
- Qt.ItemIsSelectable |
- Qt.ItemIsEnabled)
- item_widget.setTextAlignment(Qt.AlignCenter)
- self.sequenceTable.setItem(index, 1, item_widget)
-
- # Mutation descriptor name column
- aa = self._get_aa_for_index(index)
- item_widget = QTableWidgetItem(self._get_descriptor_name(aa))
- item_widget.setFont(self.labelfont)
- item_widget.setFlags(
- Qt.ItemIsSelectable |
- Qt.ItemIsEnabled)
- item_widget.setTextAlignment(Qt.AlignCenter)
- self.sequenceTable.setItem(index, 2, item_widget)
-
- # Backrub checkbox column
- item_widget = QTableWidgetItem("")
- item_widget.setFont(self.labelfont)
- if aa.get_backrub_mode():
- item_widget.setCheckState(Qt.Checked)
- else:
- item_widget.setCheckState(Qt.Unchecked)
- item_widget.setTextAlignment(Qt.AlignLeft)
- item_widget.setSizeHint(QSize(20,12))
- item_widget.setFlags(
- Qt.ItemIsSelectable |
- Qt.ItemIsEnabled |
- Qt.ItemIsUserCheckable)
- self.sequenceTable.setItem(index, 3, item_widget)
-
- # Mutation descriptor column
- aa_string = self._get_mutation_descriptor(aa)
- item_widget = QTableWidgetItem(aa_string)
- item_widget.setFont(self.descriptorfont)
- self.sequenceTable.setItem(index, 4, item_widget)
-
- self.sequenceTable.setRowHeight(index, 16)
+ aa_list = currentProteinChunk.protein.get_amino_acids()
+ aa_list_len = len(aa_list)
+ self.sequenceTable.setRowCount(aa_list_len)
+ for index in range(aa_list_len):
+ # Selection checkbox column
+ item_widget = QTableWidgetItem("")
+ item_widget.setFont(self.labelfont)
+ item_widget.setCheckState(Qt.Checked)
+ item_widget.setTextAlignment(Qt.AlignLeft)
+ item_widget.setSizeHint(QSize(20,12))
+ item_widget.setFlags(Qt.ItemIsSelectable |
+ Qt.ItemIsEnabled |
+ Qt.ItemIsUserCheckable)
+ self.sequenceTable.setItem(index, 0, item_widget)
+
+ # Amino acid index column
+ item_widget = QTableWidgetItem(str(index+1))
+ item_widget.setFont(self.labelfont)
+ item_widget.setFlags(
+ Qt.ItemIsSelectable |
+ Qt.ItemIsEnabled)
+ item_widget.setTextAlignment(Qt.AlignCenter)
+ self.sequenceTable.setItem(index, 1, item_widget)
+
+ # Mutation descriptor name column
+ aa = self._get_aa_for_index(index)
+ item_widget = QTableWidgetItem(self._get_descriptor_name(aa))
+ item_widget.setFont(self.labelfont)
+ item_widget.setFlags(Qt.ItemIsSelectable |
+ Qt.ItemIsEnabled)
+ item_widget.setTextAlignment(Qt.AlignCenter)
+ self.sequenceTable.setItem(index, 2, item_widget)
+
+ # Backrub checkbox column
+ item_widget = QTableWidgetItem("")
+ item_widget.setFont(self.labelfont)
+ if aa.get_backrub_mode():
+ item_widget.setCheckState(Qt.Checked)
+ else:
+ item_widget.setCheckState(Qt.Unchecked)
+ item_widget.setTextAlignment(Qt.AlignLeft)
+ item_widget.setSizeHint(QSize(20,12))
+ item_widget.setFlags(Qt.ItemIsSelectable |
+ Qt.ItemIsEnabled |
+ Qt.ItemIsUserCheckable)
+ self.sequenceTable.setItem(index, 3, item_widget)
+
+ # Mutation descriptor column
+ aa_string = self._get_mutation_descriptor(aa)
+ item_widget = QTableWidgetItem(aa_string)
+ item_widget.setFont(self.descriptorfont)
+ self.sequenceTable.setItem(index, 4, item_widget)
+
+ self.sequenceTable.setRowHeight(index, 16)
self.editingItem = False
@@ -510,6 +484,7 @@ class EditResidues_PropertyManager(Command_PropertyManager):
self.sequenceTable.setColumnWidth(0, 35)
self.sequenceTable.setColumnWidth(2, 80)
self.sequenceTable.setColumnWidth(3, 35)
+ return
def _fillDescriptorsTable(self):
"""
@@ -584,22 +559,23 @@ class EditResidues_PropertyManager(Command_PropertyManager):
return self.set_names[i]
return "Custom"
- def _get_aa_for_index(self, index, expand=False):
+ def _get_aa_for_index(self, index, expand = False):
"""
Get amino acid by index.
+ @return: amino acid (Residue)
"""
- # Center on a selected amino acid.
- for chunk in self.win.assy.molecules:
- #Urmi 20080728: slot connection for current protein in build protein mode
- if chunk.isProteinChunk() and chunk.name == self.current_protein:
- chunk.protein.set_current_amino_acid_index(index)
- current_aa = chunk.protein.get_current_amino_acid()
- if expand:
- chunk.protein.collapse_all_rotamers()
- chunk.protein.expand_rotamer(current_aa)
- return current_aa
-
- return None
+
+ if not self.current_protein:
+ return None
+ else:
+ currentProteinChunk = self.current_protein
+
+ currentProteinChunk.protein.set_current_amino_acid_index(index)
+ current_aa = currentProteinChunk.protein.get_current_amino_acid()
+ if expand:
+ currentProteinChunk.protein.collapse_all_rotamers()
+ currentProteinChunk.protein.expand_rotamer(current_aa)
+ return current_aa
def _sequenceTableCellChanged(self, crow, ccol):
"""
@@ -870,4 +846,40 @@ class EditResidues_PropertyManager(Command_PropertyManager):
self.descriptor_list.append(dstr[2*i+1])
self.rosetta_set_names.append("PIKAA")
#self._addNewDescriptorTableRow(dstr[2*i], dstr[2*i+1])
+ return
+
+ def _update_UI_do_updates_TEMP(self):
+ """
+ Overrides superclass method.
+
+ @see: Command_PropertyManager._update_UI_do_updates()
+ """
+
+ self.current_protein = self.win.assy.getSelectedProteinChunk()
+
+ if self.current_protein is self.previous_protein:
+ print "_update_UI_do_updates(): DO NOTHING."
+ return
+
+ # NOTE: Changing the display styles of the protein chunks can take some
+ # time. We should put up the wait (hourglass) cursor here and restore
+ # before returning.
+
+ # Update all PM widgets that need to be since something has changed.
+ print "_update_UI_do_updates(): UPDATING the PMGR."
+ self.update_name_field()
+ self.sequenceEditor.update()
+ self.update_residue_combobox()
+
+
+ if self.previous_protein:
+ self.previous_protein.setDisplayStyle(self.previous_protein_display_style)
+
+ self.previous_protein = self.current_protein
+
+ if self.current_protein:
+ self.previous_protein_display_style = self.current_protein.getDisplayStyle()
+ self.current_protein.setDisplayStyle(diPROTEIN)
+
+ return
diff --git a/cad/src/protein/commands/FixedBBProteinSim/FixedBBProteinSim_PropertyManager.py b/cad/src/protein/commands/FixedBBProteinSim/FixedBBProteinSim_PropertyManager.py
index d409bd51f..e6a234c7e 100644
--- a/cad/src/protein/commands/FixedBBProteinSim/FixedBBProteinSim_PropertyManager.py
+++ b/cad/src/protein/commands/FixedBBProteinSim/FixedBBProteinSim_PropertyManager.py
@@ -50,7 +50,7 @@ class FixedBBProteinSim_PropertyManager(Command_PropertyManager):
title = "Fixed Backbone Design"
pmName = title
- iconPath = "ui/actions/Simulation/Rosetta.png"
+ iconPath = "ui/actions/Command Toolbar/BuildProtein/FixedBackbone.png"
def __init__( self, command ):
@@ -411,11 +411,14 @@ class FixedBBProteinSim_PropertyManager(Command_PropertyManager):
"""
Get all the parameters from the PM and run a rosetta simulation.
"""
+ proteinChunk = self.win.assy.getSelectedProteinChunk()
+ if not proteinChunk:
+ msg = "You must select a single protein to run a Rosetta <i>Fixed Backbone</i> simulation."
+ self.updateMessage(msg)
+ return
otherOptionsText = str(self.otherCommandLineOptions.toPlainText())
numSim = self.numSimSpinBox.value()
- previousCommand = self.command.find_parent_command_named('BUILD_PROTEIN')
- protein = previousCommand.propMgr.get_current_protein_chunk_name()
- argList = [numSim, otherOptionsText, protein]
+ argList = [numSim, otherOptionsText, proteinChunk.name]
from simulation.ROSETTA.rosetta_commandruns import rosettaSetup_CommandRun
if argList[0] > 0: