mailr28159 - in /trunk: lib/structure/internal/object.py pipe_control/structure/main.py user_functions/structure.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on December 30, 2015 - 14:53:
Author: bugman
Date: Wed Dec 30 14:53:33 2015
New Revision: 28159

URL: http://svn.gna.org/viewcvs/relax?rev=28159&view=rev
Log:
Creation of the structure.delete_ss user function.

This simply resets the helices and sheets data structures in the internal 
structural object to [].

Modified:
    trunk/lib/structure/internal/object.py
    trunk/pipe_control/structure/main.py
    trunk/user_functions/structure.py

Modified: trunk/lib/structure/internal/object.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/lib/structure/internal/object.py?rev=28159&r1=28158&r2=28159&view=diff
==============================================================================
--- trunk/lib/structure/internal/object.py      (original)
+++ trunk/lib/structure/internal/object.py      Wed Dec 30 14:53:33 2015
@@ -1779,6 +1779,18 @@
                     self.sheets.pop(i)
 
 
+    def delete_ss(self, verbosity=1):
+        """Deletion of all secondary structure information.
+
+        @keyword verbosity: The amount of information to print to screen.  
Zero corresponds to minimal output while higher values increase the amount of 
output.  The default value is 1.
+        @type verbosity:    int
+        """
+
+        # Reset the structures.
+        self.helices = []
+        self.sheets = []
+
+
     def empty(self):
         """Report if the structural data structure is empty or not.
 

Modified: trunk/pipe_control/structure/main.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/pipe_control/structure/main.py?rev=28159&r1=28158&r2=28159&view=diff
==============================================================================
--- trunk/pipe_control/structure/main.py        (original)
+++ trunk/pipe_control/structure/main.py        Wed Dec 30 14:53:33 2015
@@ -608,6 +608,26 @@
         # Delete bond vectors.
         if hasattr(interatom, 'vector'):
             del interatom.vector
+
+
+def delete_ss(verbosity=1):
+    """Delete all secondary structure information.
+
+    @keyword verbosity: The amount of information to print to screen.  Zero 
corresponds to minimal output while higher values increase the amount of 
output.  The default value is 1.
+    @type verbosity:    int
+    """
+
+    # Test if the current data pipe exists.
+    check_pipe()
+
+    # Run the object method.
+    if hasattr(cdp, 'structure'):
+        if verbosity:
+            print("Deleting secondary structure information from the current 
pipe.")
+        cdp.structure.delete_ss(verbosity=verbosity)
+    elif verbosity:
+        print("No structures are present.")
+
 
 
 def displacement(pipes=None, models=None, molecules=None, atom_id=None, 
centroid=None):

Modified: trunk/user_functions/structure.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/user_functions/structure.py?rev=28159&r1=28158&r2=28159&view=diff
==============================================================================
--- trunk/user_functions/structure.py   (original)
+++ trunk/user_functions/structure.py   Wed Dec 30 14:53:33 2015
@@ -611,6 +611,25 @@
 uf.menu_text = "&delete"
 uf.gui_icon = "oxygen.actions.list-remove"
 uf.wizard_size = (800, 550)
+uf.wizard_apply_button = False
+uf.wizard_image = WIZARD_IMAGE_PATH + 'structure' + sep + '2JK4.png'
+
+
+# The structure.delete_ss user function.
+uf = uf_info.add_uf('structure.delete_ss')
+uf.title = "Delete secondary structure information."
+uf.title_short = "Secondary structure deletion."
+# Description.
+uf.desc.append(Desc_container())
+uf.desc[-1].add_paragraph("This will delete all secondary structure 
information from the current data pipe.")
+# Prompt examples.
+uf.desc.append(Desc_container("Prompt examples"))
+uf.desc[-1].add_paragraph("To delete all secondary structure, simply type:")
+uf.desc[-1].add_prompt("relax> structure.delete_ss()")
+uf.backend = pipe_control.structure.main.delete_ss
+uf.menu_text = "&delete_ss"
+uf.gui_icon = "oxygen.actions.list-remove"
+uf.wizard_size = (600, 400)
 uf.wizard_apply_button = False
 uf.wizard_image = WIZARD_IMAGE_PATH + 'structure' + sep + '2JK4.png'
 




Related Messages


Powered by MHonArc, Updated Wed Dec 30 15:00:04 2015