mailRe: A global working directory.


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

Header


Content

Posted by Edward d'Auvergne on January 27, 2010 - 09:46:
I would like to introduce the following GUI concept into your code for
simplifying program usage.  That is of a variable in the main class
called self.cwd (accessible in the analysis modules as self.gui.cwd).
This variable is changed every time a file dialog is accessed.  That
way if I run relax from say my home directory and then navigate to a
distant directory containing all the relaxation data and where the
results should go, then each time I open a file dialog, I won't have
to navigate back there.
This is not necessary! If we don't specify a starting directory in
openfile() and the other file modules, that's exactly what happens.
wx.Filedialog remembers the last folder location.

openfile('select file to open','', 'save.relaxGUI', 'relaxGUI files
(*.relaxGUI)|*.relaxGUI|all files (*.*)|*.*')

Note, this command would try to open a file in a directory, where you
navigated just before. Just replace the directory string with '' should
do it.

I had tried this, but it didn't work.  My testing was on the 9 '+'
buttons in the automatic model-free protocol frame.  I would run relax
from the installation directory where I am coding, and then navigate
to the directory with the OMP data.  Then clicking on the next '+'
button would return me to the installation directory.

I've fixed this in the code now.  Have a look at the openfile()
function, and the model_*() methods in the model-free module.  I
physically set the cwd using the os.chdir() command, everytime
openfile() is called without a directory arg (and using os.getcwd() to
get the cwd).  This doesn't use a variable in the relax data store,
just the internal Python working directory.


I have to implement this anyway as the
structure_pdb() method requires an initial directory which is no
longer set to the res_noe1 value from the NOE analyses tab.  Note that
I would not, and should not expect that changing the PDB file in the
model-free analysis tab would change the PDB file in all other
analyses (I will be breaking this behaviour).  Do you have any ideas
for this?


We can split these, but I taught it makes sense to always use the same
PDB file.

In a basic analysis this might be the case, but people always do
things in ways you don't expect.  For example if I run the automatic
model-free protocol 20 times, once for each structure of an ensemble,
and then would like to compare the results.  This would require 20
model-free frames, with 20 different structures.  I've implemented
this support in the relax data store.  The structure
'ds.relax_gui.analyses' is a list, and each element is a container.
If you save the program state and open the resultant file, you'll see
this structure.  To get the PDB file for the NOE analysis number 3 in
the current hardcoded and fixed analysis frame layout, you would type
'ds.relax_gui.analyses[2].structure_file'.  Well, this still has to be
implemented.

Regards,

Edward



Related Messages


Powered by MHonArc, Updated Wed Jan 27 10:20:57 2010