Author: bugman Date: Sun Mar 4 09:24:21 2007 New Revision: 3075 URL: http://svn.gna.org/viewcvs/relax?rev=3075&view=rev Log: Updated the data model redesign planning document. All discussions on the relax-devel mailing list (https://mail.gna.org/public/relax-devel/) should now be included. Modified: 1.3/docs/data_model_redesign Modified: 1.3/docs/data_model_redesign URL: http://svn.gna.org/viewcvs/relax/1.3/docs/data_model_redesign?rev=3075&r1=3074&r2=3075&view=diff ============================================================================== --- 1.3/docs/data_model_redesign (original) +++ 1.3/docs/data_model_redesign Sun Mar 4 09:24:21 2007 @@ -28,18 +28,61 @@ # Preparation. ############## +1 [Done]. Firstly release relax version 1.3.0 prior to any changes (to allow a functional version which handles RNA better, has the tensor PDB representation code, etc). -* Firstly release relax version 1.3.0 prior to any changes (to allow a functional version which handles RNA better, has the tensor PDB representation code, etc). +2. Redesign 'self.relax.data'. -* Redesign 'self.relax.data'. +3. Create the data pipe looping function for the 'pipes' argument (Chris MacRaild, https://mail.gna.org/public/relax-devel/2006-10/msg00060.html, Message-id: <1160562239.14487.98.camel@mrspell>). The user functions could be implemented as functors (Chris MacRaild, https://mail.gna.org/public/relax-devel/2007-01/msg00020.html, Message-ID: <1168432131.7569.338.camel@mrspell>). The design will need to take into account the user function docstrings, relax help system, and the relax manual docstring fetching code. -* Rename 'prompt/run.py' to 'prompt/pipe.py'. Rename 'generic_fns/runs.py' to 'generic_fns/pipes.py'. +4. Create the spin_loop function (Edward d'Auvergne, https://mail.gna.org/public/relax-devel/2006-10/msg00057.html, Message-id: <1160557041.9523.74.camel@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>). Use a generator function, using the yield statement, to return the spin data containers which are essentially pointers to the data (Gary Thompson, https://mail.gna.org/public/relax-devel/2007-01/msg00014.html, Message-id: <f001463a0701071417w6bd7927cp8fdd052e698575ec@xxxxxxxxxxxxxx>). The implementation was essentially given by Chris MacRaild at https://mail.gna.org/public/relax-devel/2007-01/msg00036.html (Message-ID: <1168883717.7569.511.camel@mrspell>). -* Create the data pipe looping function for the 'pipes' argument (Chris MacRaild, https://mail.gna.org/public/relax-devel/2006-10/msg00060.html, Message-id: <1160562239.14487.98.camel@mrspell>). +5. Implement a parser for the following molecule/residue/spin selection syntax (Gary Thompson, https://mail.gna.org/public/relax-devel/2007-01/msg00014.html, Message-id: <f001463a0701071417w6bd7927cp8fdd052e698575ec@xxxxxxxxxxxxxx>): + #<molecule number> | <molecule_name>:<residue_selection>[,<residue_selection>...]@<atom_selection> [,<atom_selection>] + residue_selection=<residue_number> | <residue_range> | <residue_type> + residue_selection=<residue_number>-<residue_number> + atom_selection=<string_and_wildcards> +This syntax will need to be properly referenced (in addition to being fully described) in the user function docstrings. I.e. the reference for Molmol syntax, the reference for UCSF syntax, etc. We need to find the source and name of the syntax. -* Create the spin loop function (Edward d'Auvergne, https://mail.gna.org/public/relax-devel/2006-10/msg00057.html, Message-id: <1160557041.9523.74.camel@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>). +6. Convert the methods of the class 'Selection' from the file 'generic_fns/selection.py' into methods and then add the following functions (Chris MacRaild at https://mail.gna.org/public/relax-devel/2007-01/msg00036.html Message-ID: <1168883717.7569.511.camel@mrspell>; Edward d'Auvergne, https://mail.gna.org/public/relax-devel/2007-01/msg00041.html, Message-ID: <7f080ed10701190408i8a5dee3y8ccbe1aba11bcba@xxxxxxxxxxxxxx>): + parse_token() + tokenise() -* Create a function for returning specific spin data. +7. Create the spin_command function (Chris MacRaild, https://mail.gna.org/public/relax-devel/2007-01/msg00036.html, Message-ID: <1168883717.7569.511.camel@mrspell>). + +8. Rename 'prompt/run.py' to 'prompt/pipe.py'. Rename 'generic_fns/runs.py' to 'generic_fns/pipes.py'. + +9. Create the new pipe user functions (from the old run user functions): + pipe.copy() # Create a new pipe with the current contents of another pipe. + pipe.create() # Create a new pipe. Switch to this pipe by default. + pipe.current() # Print the current pipe name. + pipe.delete() # Delete the pipe. + pipe.delete_all() # Delete all pipes. Essentially deleting 'self.relax.data'. + pipe.hybridise() # Fuse two pipes into the current pipe. Overlapping data in the two pipes must be identical! + pipe.list() # Print the details of all pipes. + pipe.switch() # Switch to a different pipe. + +10. Create the 'molecule' user function class: + molecule.add() + molecule.copy() # Copy the molecule information (name and num) from another pipe. + molecule.delete() + molecule.info() # Print the molecule info. +The molecule.add() user function should be used to create all the residue and spin structures for that molecule from a loaded structure. This can be done through an API to allow users to code their own PDB readers (which could in future be incorporated into relax). For more information see Gary Thompson's post at https://mail.gna.org/public/relax-devel/2007-01/msg00014.html (Message-ID: <f001463a0701071417w6bd7927cp8fdd052e698575ec@xxxxxxxxxxxxxx>). The user function should also allow for the creation of an empty molecule data container to allow for analyses whereby no structure is needed (relaxation curve-fitting, NOE calculation, model-free analysis with isotropic diffusion, etc.). The sequence user function class can then be used to load the sequence (or spin.read()). + +11. Create the 'residue' user function class: + residue.create() # This is currently named 'sequence.add()'. + residue.delete() + residue.merge() + residue.rename() + residue.renumber() + +12. Create the 'spin' user function class: + spin.copy() # Copy the spin info (name and num) from another pipe. + spin.create() + spin.delete() + spin.display() + spin.read() + spin.sort() + spin.write() @@ -48,19 +91,28 @@ The following are the steps to be taken for the function to function, file to file incremental conversion of the old system to the new system. For each function: -* Rewrite the function docstring expanding to better describe what the function is doing. Convert to the epytext format for describing what data is input, what data is returned, etc. +1. Rewrite the function docstring expanding to better describe what the function is doing. Convert to the epytext format for describing what data is input, what data is returned, etc. -* User function docstrings should not be converted to epytext format. The variable __doctype__ should be set to 'plaintext' just after each docstring so that the API documentation can properly interpret the docstring. +2. User function docstrings should not be converted to epytext format. The variable __doctype__ should be set to 'plaintext' just after each docstring so that the API documentation can properly interpret the docstring. -* Write a unit test for the function. This must be done prior to modifying the code. +3. Write unit tests for the function to check all its expected behaviour. This must be done prior to modifying the code. -* Remove all the 'run' arguments and the code accessing it. +4. Remove all the 'run' arguments and the code accessing it. -* Add the 'pipes' argument to each user function in the 'prompt' directory to allow looping over a number of data pipes (Chris MacRaild, https://mail.gna.org/public/relax-devel/2006-10/msg00060.html, Message-id: <1160562239.14487.98.camel@mrspell>). +5. Add the 'pipes' argument to each user function in the 'prompt' directory to allow looping over a number of data pipes (Chris MacRaild, https://mail.gna.org/public/relax-devel/2006-10/msg00060.html, Message-id: <1160562239.14487.98.camel@mrspell>). -* Use the following code at the start if 'self.relax.data' is accessed by the function: +6. Use the following code at the start if 'self.relax.data' is accessed by the function: ----- # Alias the data for the current data pipe. data = self.relax.data[self.relax.pipe] ----- Then access the object 'data' throughout the function. + + + +# Bugs and improvements. +######################## + +If bugs are found in the code the a bug report should be added to the relax bug tracker (https://gna.org/bugs/?group=relax). The bug should be fixed and, if the 1.2 line is affected as well, then the revision can be requested to be back ported. + +As large amounts of old code will be read, ideas for improvements will be inevitable. If small, these improvements can be implemented on the spot. Otherwise if the idea is large and disruptive, it can be lodged as a task (https://gna.org/task/?group=relax).