mailRe: r10930 - /branches/bieri_gui/auto_analyses/relax_fit.py


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

Header


Content

Posted by Edward d'Auvergne on February 26, 2010 - 09:43:
I don't thing that the GUI should be creating files, that is not its
job.  It is just an interface, for the user, that is graphical.
Instead it can create something that for the core looks like a file,
or a file object.  Here is a demonstration of all that is needed:

-----
from relax_io import DummyFileObject

# Make a file object.
file = DummyFileObject()

# The spin data.
res = [1, 2, 3, 4, 4, 5]
atom = ['N', 'N', 'N', 'NE', 'N', 'N']

# Write the spin IDs into the dummy file.
for i in range(len(res)):
    file.write(":%s@%s\n" % (res[i], atom[i]))

# Re-read the spin IDs (the other side of the API does this).
print file.readlines()
-----

Note that the GUI is going to have to come up with a way of letting
the user specify not only the residue number, but also the molecule
name and the spin name and/or number.  The residue number could also
be used.  I would suggest a small window where you can add these 5
bits of information, and bitmap '+' and '-' buttons for prettiness,
and underneath a list with the 5 elements and then the spin ID string
corresponding to these.  This could be placed into
gui_bieri.components and reused over and over again in the GUI, when
it is further developed.  The '+' button (as in the multiple peak list
selection) can add the user input text, clicking on the list can place
the values back into the fields, and the '-' button can remove that
spin ID entry selected in the lower list.  What do you think?  Maybe
the unresolved GUI element can say "Unresolved spins:  5 spins
specified." and have a button to change this.  Note that at no point
am I using the word 'residue' as you can have 2 bits of info for Trps
in proteins in an 15N relaxation analysis.

Cheers,

Edward



On 26 February 2010 00:23, Michael Bieri <michael.bieri@xxxxxx> wrote:
So best will be that the GUI creates a unresolved file in the results
directory (either empty or with the spins). Then, there will be no
confusions.

What you think about it?


Edward d'Auvergne schrieb:
For this commit, it should be changed.  If the unresolved file is not
provided, please pass in None to the class.  The user function expects
a file here (or a file object).  Therefore it is up to the GUI code to
provide a file object with this info.  This is part of keeping clean
APIs.  It is the duty of the calling code (GUI here) to provide what
the API expects.  You can use relax_io.DummyFileObject for this
purpose.  The code in auto_analyses/relax_fit.py should read (in the
1.3 line):

if self.unresolved:
    self.interpreter.deselect.read(file=self.unresolved)

Cheers,

Edward


On 25 February 2010 05:50,  <michael.bieri@xxxxxx> wrote:

Author: michaelbieri
Date: Thu Feb 25 05:50:48 2010
New Revision: 10930

URL: http://svn.gna.org/viewcvs/relax?rev=10930&view=rev
Log:
No spins are deselected if no spins / residues are indicated.

A fix has to be done if spins /residues are deselcted. Best will be to 
create a file listing these residues / spins.

Modified:
   branches/bieri_gui/auto_analyses/relax_fit.py

Modified: branches/bieri_gui/auto_analyses/relax_fit.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/bieri_gui/auto_analyses/relax_fit.py?rev=10930&r1=10929&r2=10930&view=diff
==============================================================================
--- branches/bieri_gui/auto_analyses/relax_fit.py (original)
+++ branches/bieri_gui/auto_analyses/relax_fit.py Thu Feb 25 05:50:48 2010
@@ -120,7 +120,10 @@
        self.interpreter.spectrum.error_analysis()

        # Deselect unresolved spins.
-        self.interpreter.deselect.read(file='unresolved')
+        if self.unresolved == '':
+            print ''
+        else:
+            self.interpreter.deselect.read(file='unresolved') # FIXME. 
relax should read the list without creating a file

        # Set the relaxation curve type.
        self.interpreter.relax_fit.select_model('exp')


_______________________________________________
relax (http://nmr-relax.com)

This is the relax-commits mailing list
relax-commits@xxxxxxx

To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-commits



_______________________________________________
relax (http://nmr-relax.com)

This is the relax-devel mailing list
relax-devel@xxxxxxx

To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-devel



_______________________________________________
relax (http://nmr-relax.com)

This is the relax-devel mailing list
relax-devel@xxxxxxx

To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-devel




Related Messages


Powered by MHonArc, Updated Sun Feb 28 22:40:30 2010