Author: bugman Date: Fri Jan 15 10:10:26 2010 New Revision: 10222 URL: http://svn.gna.org/viewcvs/relax?rev=10222&view=rev Log: Improvements to how unresolved spin systems are handled. This corresponds to one component of the patch_II file attached to https://gna.org/task/?6847 by Michael Bieri (https://gna.org/users/michaelbieri). The situation of no unresolved spins is better handled, and the ';' character is replaced by ',' internally. Modified: branches/bieri_gui/gui_bieri/res/calc_modelfree.py branches/bieri_gui/gui_bieri/res/calc_noe.py branches/bieri_gui/gui_bieri/res/calc_rx.py branches/bieri_gui/gui_bieri/res/project.py Modified: branches/bieri_gui/gui_bieri/res/calc_modelfree.py URL: http://svn.gna.org/viewcvs/relax/branches/bieri_gui/gui_bieri/res/calc_modelfree.py?rev=10222&r1=10221&r2=10222&view=diff ============================================================================== --- branches/bieri_gui/gui_bieri/res/calc_modelfree.py (original) +++ branches/bieri_gui/gui_bieri/res/calc_modelfree.py Fri Jan 15 10:10:26 2010 @@ -74,11 +74,12 @@ selection = "BIC" #create unresolved file - filename2 = target_dir + sep + 'unresolved' - file = open(filename2, 'w') - unres = replace(unres, ",","\n") - file.write(unres) - file.close() + if not unres == '': + filename2 = target_dir + sep + 'unresolved' + file = open(filename2, 'w') + unres = replace(unres, ",","\n") + file.write(unres) + file.close() #create models list models = [] Modified: branches/bieri_gui/gui_bieri/res/calc_noe.py URL: http://svn.gna.org/viewcvs/relax/branches/bieri_gui/gui_bieri/res/calc_noe.py?rev=10222&r1=10221&r2=10222&view=diff ============================================================================== --- branches/bieri_gui/gui_bieri/res/calc_noe.py (original) +++ branches/bieri_gui/gui_bieri/res/calc_noe.py Fri Jan 15 10:10:26 2010 @@ -54,12 +54,14 @@ unres = str(unres) #create unresolved file - unres = replace(unres, ",","\n") - unres = replace(unres, " ","") - filename3 = target_dir + sep + 'unresolved' - unresolved = open(filename3, 'w') - unresolved.write(unres) - unresolved.close() + if not unres == '': + print "\nCreate unresolved file" + unres = replace(unres, ",","\n") + unres = replace(unres, " ","") + filename3 = target_dir + sep + 'unresolved' + unresolved = open(filename3, 'w') + unresolved.write(unres) + unresolved.close() pipename = 'NOE ' + str(time.asctime(time.localtime())) @@ -86,7 +88,9 @@ spectrum.error_analysis() # Deselect unresolved residues. - deselect.read(file=resultsdir + sep + 'unresolved') + if not unres == '': + print "\nDeselect residues" + selection.desel_read(file=resultsdir + sep + 'unresolved', res_num_col= 1) # Calculate the NOEs. calc() Modified: branches/bieri_gui/gui_bieri/res/calc_rx.py URL: http://svn.gna.org/viewcvs/relax/branches/bieri_gui/gui_bieri/res/calc_rx.py?rev=10222&r1=10221&r2=10222&view=diff ============================================================================== --- branches/bieri_gui/gui_bieri/res/calc_rx.py (original) +++ branches/bieri_gui/gui_bieri/res/calc_rx.py Fri Jan 15 10:10:26 2010 @@ -72,11 +72,14 @@ peakfiles = r2_list3 #create unresolved file - unres = replace(unres, ",","\n") - filename2 = target_dir + sep + 'unresolved' - file = open(filename2, 'w') - file.write(unres) - file.close() + if not unres == '': + print "\nCreating unresolved file" + unres = replace(unres, ",","\n") + unres = replace(unres, " ","") + filename2 = target_dir + sep + 'unresolved' + file = open(filename2, 'w') + file.write(unres) + file.close() pipename = 'Rx ' + str(time.asctime(time.localtime())) @@ -113,8 +116,10 @@ spectrum.error_analysis() # Deselect unresolved spins. - deselect.read(file=resultsdir + sep + 'unresolved') - + if not unres == '': + print '\nDeselect Residues' + selection.desel_read(file=resultsdir + sep + 'unresolved', res_num_col= 1) + # Set the relaxation curve type. relax_fit.select_model('exp') Modified: branches/bieri_gui/gui_bieri/res/project.py URL: http://svn.gna.org/viewcvs/relax/branches/bieri_gui/gui_bieri/res/project.py?rev=10222&r1=10221&r2=10222&view=diff ============================================================================== --- branches/bieri_gui/gui_bieri/res/project.py (original) +++ branches/bieri_gui/gui_bieri/res/project.py Fri Jan 15 10:10:26 2010 @@ -83,7 +83,7 @@ #model-free - savemodel = [str(self.modelfreefreq1.GetValue()), str(self.m_noe_1.GetValue()), str(self.m_r1_1.GetValue()), str(self.m_r2_1.GetValue()), str(self.modelfreefreq2.GetValue()), str(self.m_noe_2.GetValue()), str(self.m_r1_2.GetValue()), str(self.m_r2_2.GetValue()), str(self.modelfreefreq3.GetValue()), str(self.m_noe_3.GetValue()), str(self.m_r1_3.GetValue()), str(self.m_r2_3.GetValue()), str(self. unresolved_r21_copy_1_copy.GetValue()), str(self.resultsdir_r21_copy_2.GetValue())] + savemodel = [str(self.modelfreefreq1.GetValue()), str(self.m_noe_1.GetValue()), str(self.m_r1_1.GetValue()), str(self.m_r2_1.GetValue()), str(self.modelfreefreq2.GetValue()), str(self.m_noe_2.GetValue()), str(self.m_r1_2.GetValue()), str(self.m_r2_2.GetValue()), str(self.modelfreefreq3.GetValue()), str(self.m_noe_3.GetValue()), str(self.m_r1_3.GetValue()), str(self.m_r2_3.GetValue()), replace(str(self. unresolved_r21_copy_1_copy.GetValue()),',',';'), str(self.resultsdir_r21_copy_2.GetValue())] #results noeresult = [] @@ -164,7 +164,7 @@ self.noe_ref_1.SetValue(noes[3]) self.noe_ref_err_1.SetValue(noes[4]) self.structure_noe1.SetValue(noes[5]) - self.unres_noe1.SetValue(noes[6]) + self.unres_noe1.SetValue(replace(noes[6],';',',')) self.res_noe1.SetValue(noes[7]) # load NOE 2 @@ -175,7 +175,7 @@ self.noe_ref_1_copy.SetValue(noes[3]) self.noe_ref_err_1_copy.SetValue(noes[4]) self.structure_noe1_copy.SetValue(noes[5]) - self.unres_noe1_copy.SetValue(noes[6]) + self.unres_noe1_copy.SetValue(replace(noes[6],';',',')) self.res_noe1_copy.SetValue(noes[7]) # load NOE 3 @@ -186,44 +186,44 @@ self.noe_ref_1_copy_1.SetValue(noes[3]) self.noe_ref_err_1_copy_1.SetValue(noes[4]) self.structure_noe1_copy_1.SetValue(noes[5]) - self.unres_noe1_copy_1.SetValue(noes[6]) + self.unres_noe1_copy_1.SetValue(replace(noes[6],';',',')) self.res_noe1_copy_1.SetValue(noes[7]) #load R1 rx = stringtolist(saved[9]) self.nmrfreq_value_r11.SetValue(rx[0]) self.resultsdir_r11.SetValue(rx[1]) - self.unresolved_r11.SetValue(rx[2]) + self.unresolved_r11.SetValue(replace(rx[2],';',',')) #load R1 2 rx = stringtolist(saved[10]) self.nmrfreq_value_r11_copy.SetValue(rx[0]) self.resultsdir_r11_copy.SetValue(rx[1]) - self.unresolved_r11_copy.SetValue(rx[2]) + self.unresolved_r11_copy.SetValue(replace(rx[2],';',',')) #load R1 3 rx = stringtolist(saved[11]) self.nmrfreq_value_r21_copy_1.SetValue(rx[0]) self.resultsdir_r21_copy_1.SetValue(rx[1]) - self.unresolved_r21_copy_1.SetValue(rx[2]) + self.unresolved_r21_copy_1.SetValue(replace(rx[2],';',',')) #load R1 rx = stringtolist(saved[13]) self.nmrfreq_value_r21.SetValue(rx[0]) self.resultsdir_r21.SetValue(rx[1]) - self.unresolved_r21.SetValue(rx[2]) + self.unresolved_r21.SetValue(replace(rx[2],';',',')) #load R1 2 rx = stringtolist(saved[14]) self.nmrfreq_value_r21_copy.SetValue(rx[0]) self.resultsdir_r21_copy.SetValue(rx[1]) - self.unresolved_r21_copy.SetValue(rx[2]) + self.unresolved_r21_copy.SetValue(replace(rx[2],';',',')) #load R1 3 rx = stringtolist(saved[15]) self.nmrfreq_value_r21_copy_1.SetValue(rx[0]) self.resultsdir_r21_copy_1.SetValue(rx[1]) - self.unresolved_r21_copy_1.SetValue(rx[2]) + self.unresolved_r21_copy_1.SetValue(replace(rx[2],';',',')) #model-free openmodel = stringtolist(saved[17]) @@ -239,7 +239,7 @@ self.m_noe_3.SetValue(openmodel[9]) self.m_r1_3.SetValue(openmodel[10]) self.m_r2_3.SetValue(openmodel[11]) - self.unresolved_r21_copy_1_copy.SetValue(openmodel[12]) + self.unresolved_r21_copy_1_copy.SetValue(replace(openmodel[12], ';',',')) self.resultsdir_r21_copy_2.SetValue(openmodel[13]) #results