diff options
author | Piotr Rotkiewicz <piotr@pirx.com> | 2008-04-09 16:02:40 +0000 |
---|---|---|
committer | Piotr Rotkiewicz <piotr@pirx.com> | 2008-04-09 16:02:40 +0000 |
commit | 1a4d6f222c8a645022ccf2e3be4a24091506ca6a (patch) | |
tree | 963397459b90abe4459619320ba167cd34002b29 | |
parent | c02aebf839f502cfe42daa626d738a0a6b18b3aa (diff) | |
download | nanoengineer-theirix-1a4d6f222c8a645022ccf2e3be4a24091506ca6a.tar.gz nanoengineer-theirix-1a4d6f222c8a645022ccf2e3be4a24091506ca6a.zip |
=Enables Peptide Generator by default.
-rwxr-xr-x | cad/src/commands/InsertPeptide/PeptideGenerator.py | 45 | ||||
-rwxr-xr-x | cad/src/commands/InsertPeptide/PeptideGeneratorPropertyManager.py | 14 | ||||
-rwxr-xr-x | cad/src/ne1_startup/startup_misc.py | 59 | ||||
-rwxr-xr-x | cad/src/ui/actions/Tools/Build Structures/Peptide.png | bin | 328 -> 333 bytes |
4 files changed, 72 insertions, 46 deletions
diff --git a/cad/src/commands/InsertPeptide/PeptideGenerator.py b/cad/src/commands/InsertPeptide/PeptideGenerator.py index 55aaeddd9..7b6ca8b0c 100755 --- a/cad/src/commands/InsertPeptide/PeptideGenerator.py +++ b/cad/src/commands/InsertPeptide/PeptideGenerator.py @@ -292,20 +292,20 @@ TRP_ZMATRIX = [ ( 4, "H ", "H", "", 3, 2, 1, 1.010, 119.800, 0.000 ), ( 5, "CA ", "C", "sp3", 3, 2, 1, 1.449, 121.900, 180.000 ), ( 6, "HA ", "H", "", 5, 3, 2, 1.090, 109.500, 300.000 ), - ( 7, "CB ", "C", "sp2", 5, 3, 2, 1.525, 111.100, 60.000 ), + ( 7, "CB ", "C", "sp3", 5, 3, 2, 1.525, 111.100, 60.000 ), ( 8, "HB2", "H", "", 7, 5, 3, 1.090, 109.500, 300.000 ), ( 9, "HB3", "H", "", 7, 5, 3, 1.090, 109.500, 60.000 ), - ( 10, "CG ", "C", "sp2", 7, 5, 3, 1.510, 115.000, 180.000 ), - ( 11, "CD1", "C", "sp2", 10, 7, 5, 1.340, 127.000, 180.000 ), + ( 10, "CG ", "C", "sp3", 7, 5, 3, 1.510, 115.000, 180.000 ), + ( 11, "CD1", "C", "sp3", 10, 7, 5, 1.340, 127.000, 180.000 ), ( 12, "HD1", "H", "", 11, 10, 7, 1.090, 120.000, 0.000 ), - ( 13, "NE1", "N", "sp2", 11, 10, 7, 1.430, 107.000, 180.000 ), + ( 13, "NE1", "N", "sp3", 11, 10, 7, 1.430, 107.000, 180.000 ), ( 14, "HE1", "H", "", 13, 11, 10, 1.010, 125.500, 180.000 ), - ( 15, "CE2", "C", "", 13, 11, 10, 1.310, 109.000, 0.000 ), - ( 16, "CZ2", "C", "", 15, 13, 11, 1.400, 128.000, 180.000 ), + ( 15, "CE2", "C", "sp2", 13, 11, 10, 1.310, 109.000, 0.000 ), + ( 16, "CZ2", "C", "sp2", 15, 13, 11, 1.400, 128.000, 180.000 ), ( 17, "HZ2", "H", "", 16, 15, 13, 1.090, 120.000, 0.000 ), ( 18, "CH2", "C", "sp2", 16, 15, 13, 1.390, 116.000, 180.000 ), - ( 19, "HH2", "H", "", 18, 16, 15, 1.090, 120.000, 180.000 ), - ( 20, "CZ3", "C", "sp2", 18, 16, 15, 1.350, 121.000, 0.000 ), + ( 19, "HH2", "H", "", 18, 16, 15, 1.090, 120.000, 180.000 ), + ( 20, "CZ3", "C", "sp2", 18, 16, 15, 1.350, 121.000, 0.000 ), ( 21, "HZ3", "H", "", 20, 18, 16, 1.090, 120.000, 180.000 ), ( 22, "CE3", "C", "sp2", 20, 18, 16, 1.410, 122.000, 0.000 ), ( 23, "HE3", "H", "", 22, 20, 18, 1.090, 120.000, 180.000 ), @@ -322,7 +322,7 @@ TYR_ZMATRIX = [ ( 4, "H ", "H", "", 3, 2, 1, 1.010, 119.800, 0.000 ), ( 5, "CA ", "C", "sp3", 3, 2, 1, 1.449, 121.900, 180.000 ), ( 6, "HA ", "H", "", 5, 3, 2, 1.090, 109.500, 300.000 ), - ( 7, "CB ", "C", "sp2", 5, 3, 2, 1.525, 111.100, 60.000 ), + ( 7, "CB ", "C", "sp3", 5, 3, 2, 1.525, 111.100, 60.000 ), ( 8, "HB2", "H", "", 7, 5, 3, 1.090, 109.500, 300.000 ), ( 9, "HB3", "H", "", 7, 5, 3, 1.090, 109.500, 60.000 ), ( 10, "CG ", "C", "sp2", 7, 5, 3, 1.510, 109.470, 180.000 ), @@ -334,9 +334,9 @@ TYR_ZMATRIX = [ ( 16, "OH ", "O", "sp3", 15, 13, 11, 1.360, 120.000, 180.000 ), ( 17, "HH ", "H", "", 16, 15, 13, 0.960, 113.000, 0.000 ), ( 18, "CE2", "C", "sp2", 15, 13, 11, 1.400, 120.000, 0.000 ), - ( 19, "HE2", "H", "", 18, 15, 13, 1.090, 120.000, 180.000 ), - ( 20, "CD2", "C", "sp2", 18, 15, 13, 1.400, 120.000, 0.000 ), - ( 21, "HD2", "H", "", 20, 18, 15, 1.090, 120.000, 180.000 ), + ( 19, "HE2", "H", "", 18, 15, 13, 1.090, 120.000, 180.000 ), + ( 20, "CD2", "C", "sp2", 18, 15, 13, 1.400, 120.000, 0.000 ), + ( 21, "HD2", "H", "", 20, 18, 15, 1.090, 120.000, 180.000 ), ( 22, "C ", "C", "sp2", 5, 3, 2, 1.522, 111.100, 180.000 ), ( 23, "O ", "O", "sp2", 22, 5, 3, 1.229, 120.500, 0.000 ), ] @@ -407,7 +407,7 @@ HIS_ZMATRIX = [ ( 4, "H ", "H", "", 3, 2, 1, 1.010, 119.800, 0.000 ), ( 5, "CA ", "C", "sp3", 3, 2, 1, 1.449, 121.900, 180.000 ), ( 6, "HA ", "H", "", 5, 3, 2, 1.090, 109.500, 300.000 ), - ( 7, "CB ", "C", "sp2", 5, 3, 2, 1.525, 111.100, 60.000 ), + ( 7, "CB ", "C", "sp3", 5, 3, 2, 1.525, 111.100, 60.000 ), ( 8, "HB2", "H", "", 7, 5, 3, 1.090, 109.500, 300.000 ), ( 9, "HB3", "H", "", 7, 5, 3, 1.090, 109.500, 60.000 ), ( 10, "CG ", "C", "sp2", 7, 5, 3, 1.510, 115.000, 180.000 ), @@ -689,6 +689,7 @@ class PeptideGenerator(PeptideGeneratorPropertyManager, GeneratorBaseClass): # add a new atom to the molecule atom = Atom(atom_name, V(self.coords[n][0], self.coords[n][1], self.coords[n][2]), mol) atom.set_atomtype_but_dont_revise_singlets(atom_type) + if name=="CA ": # set c-alpha flag for visualization atom.is_calpha = True else: @@ -725,15 +726,29 @@ class PeptideGenerator(PeptideGeneratorPropertyManager, GeneratorBaseClass): self.prev_coords[2][1] = position[1] self.prev_coords[2][2] = position[2] - # generate the chain + # Generate the peptide chain. self.length = 1 for index, phi, psi in self.peptide_cache: name, short_name, symbol, zmatrix, size = AMINO_ACIDS[index] self._buildResiduum(mol, zmatrix, size, phi, psi) - # Compute bonds. This should be replaced by a proper bond assignment. + # Compute bonds (slow!) + # This should be replaced by a proper bond assignment. inferBonds(mol) + # Assign proper bond orders. + for atom in mol.atoms.itervalues(): + if atom.bonds: + for bond in atom.bonds: + if bond.atom1.getAtomTypeName()=="sp2" and \ + bond.atom2.getAtomTypeName()=="sp2": + if ((bond.atom1.element.symbol=="C" and + bond.atom2.element.symbol=="C")): + bond.set_v6(V_AROMATIC) + else: + bond.set_v6(V_DOUBLE) + + return mol def addAminoAcid(self, index): diff --git a/cad/src/commands/InsertPeptide/PeptideGeneratorPropertyManager.py b/cad/src/commands/InsertPeptide/PeptideGeneratorPropertyManager.py index 502bc016f..631edd8e3 100755 --- a/cad/src/commands/InsertPeptide/PeptideGeneratorPropertyManager.py +++ b/cad/src/commands/InsertPeptide/PeptideGeneratorPropertyManager.py @@ -196,7 +196,19 @@ class PeptideGeneratorPropertyManager(PM_Dialog): Adds a new amino acid to the peptide molecule. """ button, idx, short_name, dum, name, symbol, x, y = AA_BUTTON_LIST[aaTypeIndex] - self.sequenceEditor.insertHtml(symbol, False, 4, 10, False) + if self.ss_idx==0: + aa_txt = "<font color=red>" + elif self.ss_idx==1: + aa_txt = "<font color=orange>" + elif self.ss_idx==2: + aa_txt = "<font color=green>" + elif self.ss_idx==3: + aa_txt = "<font color=blue>" + else: + aa_txt = "<font color=black>" + + aa_txt += symbol+"</font>" + self.sequenceEditor.insertHtml(aa_txt, False, 4, 10, False) self.addAminoAcid(aaTypeIndex) def _startOverClicked(self): diff --git a/cad/src/ne1_startup/startup_misc.py b/cad/src/ne1_startup/startup_misc.py index 52fd5809e..96a83380d 100755 --- a/cad/src/ne1_startup/startup_misc.py +++ b/cad/src/ne1_startup/startup_misc.py @@ -38,13 +38,13 @@ def call_module_init_functions(): #bruce 071005 split this out of main_startup.s # as a clarification. Likely desirable change (###TODO): register a model updater in assy, # which calls the bond updater presently registered by bond_updater.initialize.) # [bruce 070925 comment] - + import model_updater.master_model_updater as master_model_updater master_model_updater.initialize() - + import model.assembly model.assembly.Assembly.initialize() - + import PM.GroupButtonMixin as GroupButtonMixin GroupButtonMixin.GroupButtonMixin.initialize() @@ -72,9 +72,9 @@ def register_MMP_RecordParsers(): #bruce 071019 pass # TODO: add more of these. - + return - + # (MWsemantics.__init__ is presumably run after the above functions and before the following ones.) def pre_main_show( win): @@ -91,13 +91,13 @@ def pre_main_show( win): from platform.PlatformDependent import screen_pos_size ((x0, y0), (screen_w, screen_h)) = screen_pos_size() # note: y0 is nonzero on mac, due to menubar at top of screen. - + # use 85% of screen width and 90% of screen height, or more if that would be # less than 780 by 560 pixels, but never more than the available space. norm_w = int( min(screen_w - 2, max(780, screen_w * 0.85))) norm_h = int( min(screen_h - 2, max(560, screen_h * 0.90))) #bruce 050118 reduced max norm_h to never overlap mac menubar (bugfix?) - + # determine normal window origin # [bruce 041230 changed this to center it, but feel free to change this back # by changing the next line to center_it = 0] @@ -113,7 +113,7 @@ def pre_main_show( win): want_y = 36 # Top (36 pixels) norm_x = min( want_x, (screen_w - norm_w)) + x0 norm_y = min( want_y, (screen_h - norm_h)) + y0 - + # Set the main window geometry, hopefully before the caller shows the window from PyQt4.Qt import QRect win.setGeometry(QRect(norm_x, norm_y, norm_w, norm_h)) @@ -140,7 +140,7 @@ def pre_main_show( win): # provided they are fully supported (not experimental, unlikely to cause bugs when added) # and won't take a lot of runtime to add. Otherwise they can be added after the # main window is shown. [bruce 071005 comment] ###@@@ - + return # from pre_main_show # This is debugging code used to find out the origin and size of the fullscreen window @@ -155,23 +155,23 @@ def _initialize_custom_display_modes(win): # They must match the order of related display style list-index definitions # in constants.py. # [bruce 080212 comment; related code has comments with same signature] - + # diDNACYLINDER import graphics.display_styles.DnaCylinderChunks as DnaCylinderChunks #mark 2008-02-11 - + # diCYLINDER import graphics.display_styles.CylinderChunks as CylinderChunks #bruce 060609 from utilities.debug_prefs import debug_pref, Choice_boolean_False enable_CylinderChunks = debug_pref("enable CylinderChunks next session?", - Choice_boolean_False, - non_debug = True, - prefs_key = True) + Choice_boolean_False, + non_debug = True, + prefs_key = True) win.dispCylinderAction.setText("Cylinder (experimental)") win.dispCylinderAction.setEnabled(enable_CylinderChunks) win.dispCylinderAction.setVisible(enable_CylinderChunks) if enable_CylinderChunks: win.displayStylesToolBar.addAction(win.dispCylinderAction) - + # diSURFACE import graphics.display_styles.SurfaceChunks as SurfaceChunks #mark 060610 enable_SurfaceChunks = debug_pref("enable SurfaceChunks next session?", @@ -183,7 +183,7 @@ def _initialize_custom_display_modes(win): win.dispSurfaceAction.setVisible(enable_SurfaceChunks) if enable_SurfaceChunks: win.displayStylesToolBar.addAction(win.dispSurfaceAction) - + return # == @@ -199,7 +199,7 @@ def post_main_show( win): # NOTE: if possible, new code should be added into one of the following # functions, or into a new function called by this one, rather than # directly into this function. - + # TODO: rebuild pyx modules if necessary and safe -- but only for # developers, not end-users # TODO: initialize Python extensions: ## import experimental/pyrex_test/extensions.py @@ -234,24 +234,23 @@ def _init_command_Atom_Generator(): from utilities.debug_prefs import debug_pref, Choice_boolean_False from commands.BuildAtom.AtomGenerator import enableAtomGenerator _atomGeneratorIsEnabled = \ - debug_pref("Atom Generator example code: enabled?", - Choice_boolean_False, - non_debug = True, - prefs_key = "A9/Atom Generator Visible", - call_with_new_value = enableAtomGenerator ) + debug_pref("Atom Generator example code: enabled?", + Choice_boolean_False, + non_debug = True, + prefs_key = "A9/Atom Generator Visible", + call_with_new_value = enableAtomGenerator ) enableAtomGenerator(_atomGeneratorIsEnabled) return def _init_command_Peptide_Generator(): # piotr 080304 # This function enables an experimental peptide generator. - from utilities.debug_prefs import debug_pref, Choice_boolean_False + from utilities.debug_prefs import debug_pref, Choice_boolean_True from commands.InsertPeptide.PeptideGenerator import enablePeptideGenerator _peptideGeneratorIsEnabled = \ - debug_pref("Peptide Generator: enabled?", - Choice_boolean_False, - non_debug = True, - prefs_key = "A9/Peptide Generator Visible", - call_with_new_value = enablePeptideGenerator ) + debug_pref("Peptide Generator: enabled?", + Choice_boolean_True, + prefs_key = "A10/Peptide Generator Visible", + call_with_new_value = enablePeptideGenerator ) enablePeptideGenerator(_peptideGeneratorIsEnabled) return @@ -281,7 +280,7 @@ def _set_mainwindow_splitter_position( win): pixels. This should be called after all visible changes to the main window. - + @param win: the single Main Window object. @type win: L{MWsemantics} """ @@ -310,7 +309,7 @@ def _set_mainwindow_splitter_position( win): # Since we want the default width of the PropMgr to be <pmDefaultWidth>, # I compute the new glpane width = magic_combined_width - pmDefaultWidth. # Note: the resize is visible at startup. - + pw = win.activePartWindow() from PM.PropMgr_Constants import pmDefaultWidth w1, w2 = pw.pwSplitter.sizes() diff --git a/cad/src/ui/actions/Tools/Build Structures/Peptide.png b/cad/src/ui/actions/Tools/Build Structures/Peptide.png Binary files differindex 79e7b899c..ab62409b9 100755 --- a/cad/src/ui/actions/Tools/Build Structures/Peptide.png +++ b/cad/src/ui/actions/Tools/Build Structures/Peptide.png |