From e786ed45c8664a8abd05e1aacd3e0cd5666e5544 Mon Sep 17 00:00:00 2001
From: Olivier Langella <olivier.langella@u-psud.fr>
Date: Sat, 14 Oct 2017 19:04:28 +0200
Subject: [PATCH] WIP: refinement module

---
 src/core/tandem_run/tandemparameters.cpp      |   6 +-
 .../edit_tandem_preset_dialog.ui              | 506 ++++++++++++++++--
 .../edittandempresetdialog.cpp                |  72 ++-
 3 files changed, 521 insertions(+), 63 deletions(-)

diff --git a/src/core/tandem_run/tandemparameters.cpp b/src/core/tandem_run/tandemparameters.cpp
index aa73215be..3a3cc9ebe 100644
--- a/src/core/tandem_run/tandemparameters.cpp
+++ b/src/core/tandem_run/tandemparameters.cpp
@@ -95,13 +95,13 @@ void TandemParameters::setParamLabelValue(const QString & label, const QString &
             throw pappso::ExceptionNotPossible(QObject::tr("%1 value must be Daltons or ppm (not %2)").arg(label).arg(value));
         }
     }
-    if ((label == "spectrum, parent monoisotopic mass isotope error") || (label == "spectrum, use neutral loss window") || (label == "spectrum, use contrast angle") || (label == "protein, cleavage semi") || (label == "protein, quick acetyl") || (label == "protein, quick pyrolidone")  || (label == "protein, stP bias") || (label == "scoring, cyclic permutation") || (label == "scoring, include reverse") || (label == "scoring, y ions") || (label == "scoring, b ions") || (label == "scoring, c ions") || (label == "scoring, z ions") || (label == "scoring, a ions") || (label == "scoring, x ions") || (label == "refine")) {
+    if ((label == "spectrum, parent monoisotopic mass isotope error") || (label == "spectrum, use neutral loss window") || (label == "spectrum, use contrast angle") || (label == "protein, cleavage semi") || (label == "protein, quick acetyl") || (label == "protein, quick pyrolidone")  || (label == "protein, stP bias") || (label == "scoring, cyclic permutation") || (label == "scoring, include reverse") || (label == "scoring, y ions") || (label == "scoring, b ions") || (label == "scoring, c ions") || (label == "scoring, z ions") || (label == "scoring, a ions") || (label == "scoring, x ions") || (label == "refine") || (label == "refine, use potential modifications for full refinement") || (label == "refine, cleavage semi") ) {
         if ((value != "yes") && (value != "no")) {
             throw pappso::ExceptionNotPossible(QObject::tr("%1 value must be yes or no (not %2)").arg(label).arg(value));
         }
     }
-    
-    
+
+
     if ((label == "spectrum, parent monoisotopic mass error minus") || (label == "spectrum, parent monoisotopic mass error plus")|| (label == "spectrum, dynamic range") || (label == "spectrum, minimum parent m+h") || (label == "protein, cleavage C-terminal mass change")|| (label == "protein, cleavage N-terminal mass change") || (label == "protein, C-terminal residue modification mass") || (label == "protein, N-terminal residue modification mass") || (label == "refine, maximum valid expectation value")) {
         bool ok;
         value.toDouble(&ok);
diff --git a/src/gui/edit_tandem_preset_dialog/edit_tandem_preset_dialog.ui b/src/gui/edit_tandem_preset_dialog/edit_tandem_preset_dialog.ui
index 35eb9eca7..546bd9a2f 100644
--- a/src/gui/edit_tandem_preset_dialog/edit_tandem_preset_dialog.ui
+++ b/src/gui/edit_tandem_preset_dialog/edit_tandem_preset_dialog.ui
@@ -1708,14 +1708,119 @@
               <property name="geometry">
                <rect>
                 <x>0</x>
-                <y>0</y>
-                <width>1012</width>
-                <height>468</height>
+                <y>-96</y>
+                <width>998</width>
+                <height>564</height>
                </rect>
               </property>
               <layout class="QVBoxLayout" name="verticalLayout_14">
                <item>
                 <layout class="QGridLayout" name="gridLayout_5">
+                 <item row="12" column="1">
+                  <widget class="QLineEdit" name="refpmmotif2_edit"/>
+                 </item>
+                 <item row="8" column="2">
+                  <widget class="QPushButton" name="refpmm1_push_button">
+                   <property name="text">
+                    <string>?</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="11" column="1">
+                  <widget class="QLineEdit" name="refpmmotif1_edit"/>
+                 </item>
+                 <item row="12" column="2">
+                  <widget class="QPushButton" name="refpmmotif2_push_button">
+                   <property name="text">
+                    <string>?</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="12" column="0">
+                  <widget class="QLabel" name="label_59">
+                   <property name="text">
+                    <string>Potential modifications motif 2</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="13" column="1">
+                  <layout class="QHBoxLayout" name="horizontalLayout_22">
+                   <item>
+                    <widget class="QRadioButton" name="rupmffr_yes_radio_button">
+                     <property name="text">
+                      <string>yes</string>
+                     </property>
+                     <attribute name="buttonGroup">
+                      <string notr="true">rupmffr_button_group</string>
+                     </attribute>
+                    </widget>
+                   </item>
+                   <item>
+                    <widget class="QRadioButton" name="rupmffr_no_radio_button">
+                     <property name="text">
+                      <string>no</string>
+                     </property>
+                     <attribute name="buttonGroup">
+                      <string notr="true">rupmffr_button_group</string>
+                     </attribute>
+                    </widget>
+                   </item>
+                   <item>
+                    <spacer name="horizontalSpacer_20">
+                     <property name="orientation">
+                      <enum>Qt::Horizontal</enum>
+                     </property>
+                     <property name="sizeHint" stdset="0">
+                      <size>
+                       <width>40</width>
+                       <height>20</height>
+                      </size>
+                     </property>
+                    </spacer>
+                   </item>
+                  </layout>
+                 </item>
+                 <item row="13" column="0">
+                  <widget class="QLabel" name="label_60">
+                   <property name="text">
+                    <string>Use potential modifications in refinement module</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="8" column="0">
+                  <widget class="QLabel" name="label_55">
+                   <property name="text">
+                    <string>Alter potential modifications 1</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="6" column="0">
+                  <widget class="QLabel" name="label_53">
+                   <property name="text">
+                    <string>Alter fixed modifications 2</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="7" column="0">
+                  <widget class="QLabel" name="label_54">
+                   <property name="text">
+                    <string>Alter potential modifications</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="6" column="2">
+                  <widget class="QPushButton" name="refmm2_push_button">
+                   <property name="text">
+                    <string>?</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="6" column="1">
+                  <widget class="QLineEdit" name="refmm2_edit"/>
+                 </item>
+                 <item row="5" column="1">
+                  <widget class="QLineEdit" name="refmm1_edit"/>
+                 </item>
                  <item row="1" column="0">
                   <widget class="QLabel" name="label_48">
                    <property name="text">
@@ -1737,10 +1842,13 @@
                    </property>
                   </widget>
                  </item>
+                 <item row="1" column="1">
+                  <widget class="QLineEdit" name="rmvev_edit"/>
+                 </item>
                  <item row="0" column="0">
                   <widget class="QLabel" name="label_29">
                    <property name="text">
-                    <string>Control the use of the refinment module</string>
+                    <string>Use of the refinement module</string>
                    </property>
                   </widget>
                  </item>
@@ -1788,8 +1896,8 @@
                    </item>
                   </layout>
                  </item>
-                 <item row="1" column="1">
-                  <widget class="QLineEdit" name="rmvev_edit"/>
+                 <item row="2" column="1">
+                  <widget class="QLineEdit" name="refpntm_edit"/>
                  </item>
                  <item row="3" column="0">
                   <widget class="QLabel" name="label_50">
@@ -1798,6 +1906,9 @@
                    </property>
                   </widget>
                  </item>
+                 <item row="3" column="1">
+                  <widget class="QLineEdit" name="refpctm_edit"/>
+                 </item>
                  <item row="2" column="2">
                   <widget class="QPushButton" name="refpntm_push_button">
                    <property name="text">
@@ -1805,22 +1916,23 @@
                    </property>
                   </widget>
                  </item>
-                 <item row="3" column="2">
-                  <widget class="QPushButton" name="refpctm_push_button">
+                 <item row="10" column="0">
+                  <widget class="QLabel" name="label_57">
                    <property name="text">
-                    <string>?</string>
+                    <string>Potential modifications motif</string>
                    </property>
                   </widget>
                  </item>
-                 <item row="2" column="1">
-                  <widget class="QLineEdit" name="refpntm_edit"/>
-                 </item>
-                 <item row="3" column="1">
-                  <widget class="QLineEdit" name="refpctm_edit"/>
-                 </item>
                  <item row="4" column="1">
                   <widget class="QLineEdit" name="refmm_edit"/>
                  </item>
+                 <item row="3" column="2">
+                  <widget class="QPushButton" name="refpctm_push_button">
+                   <property name="text">
+                    <string>?</string>
+                   </property>
+                  </widget>
+                 </item>
                  <item row="4" column="0">
                   <widget class="QLabel" name="label_51">
                    <property name="text">
@@ -1828,6 +1940,9 @@
                    </property>
                   </widget>
                  </item>
+                 <item row="7" column="1">
+                  <widget class="QLineEdit" name="refpmm_edit"/>
+                 </item>
                  <item row="5" column="0">
                   <widget class="QLabel" name="label_52">
                    <property name="text">
@@ -1842,32 +1957,172 @@
                    </property>
                   </widget>
                  </item>
-                 <item row="6" column="0">
-                  <widget class="QLabel" name="label_53">
+                 <item row="8" column="1">
+                  <widget class="QLineEdit" name="refpmm1_edit"/>
+                 </item>
+                 <item row="5" column="2">
+                  <widget class="QPushButton" name="refmm1_push_button">
                    <property name="text">
-                    <string>Alter fixed modifications 2</string>
+                    <string>?</string>
                    </property>
                   </widget>
                  </item>
-                 <item row="5" column="2">
-                  <widget class="QPushButton" name="refmm1_push_button">
+                 <item row="9" column="1">
+                  <widget class="QLineEdit" name="refpmm2_edit"/>
+                 </item>
+                 <item row="9" column="0">
+                  <widget class="QLabel" name="label_56">
+                   <property name="text">
+                    <string>Alter potential modifications 2</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="7" column="2">
+                  <widget class="QPushButton" name="refpmm_push_button">
                    <property name="text">
                     <string>?</string>
                    </property>
                   </widget>
                  </item>
-                 <item row="6" column="2">
-                  <widget class="QPushButton" name="refmm2_push_button">
+                 <item row="9" column="2">
+                  <widget class="QPushButton" name="refpmm2_push_button">
                    <property name="text">
                     <string>?</string>
                    </property>
                   </widget>
                  </item>
-                 <item row="5" column="1">
-                  <widget class="QLineEdit" name="refmm1_edit"/>
+                 <item row="10" column="1">
+                  <widget class="QLineEdit" name="refpmmotif_edit"/>
                  </item>
-                 <item row="6" column="1">
-                  <widget class="QLineEdit" name="refmm2_edit"/>
+                 <item row="11" column="0">
+                  <widget class="QLabel" name="label_58">
+                   <property name="text">
+                    <string>Potential modifications motif 1</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="10" column="2">
+                  <widget class="QPushButton" name="refpmmotif_push_button">
+                   <property name="text">
+                    <string>?</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="11" column="2">
+                  <widget class="QPushButton" name="refpmmotif1_push_button">
+                   <property name="text">
+                    <string>?</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="13" column="2">
+                  <widget class="QPushButton" name="rupmffr_push_button">
+                   <property name="text">
+                    <string>?</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="14" column="0">
+                  <widget class="QLabel" name="label_61">
+                   <property name="text">
+                    <string>Use semi-enzymatic cleavage rules</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="14" column="2">
+                  <widget class="QPushButton" name="rcsemi_push_button">
+                   <property name="text">
+                    <string>?</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="14" column="1">
+                  <layout class="QHBoxLayout" name="horizontalLayout_23">
+                   <item>
+                    <widget class="QRadioButton" name="rcsemi_yes_radio_button">
+                     <property name="text">
+                      <string>yes</string>
+                     </property>
+                     <attribute name="buttonGroup">
+                      <string notr="true">rcsemi_button_group</string>
+                     </attribute>
+                    </widget>
+                   </item>
+                   <item>
+                    <widget class="QRadioButton" name="rcsemi_no_radio_button">
+                     <property name="text">
+                      <string>no</string>
+                     </property>
+                     <attribute name="buttonGroup">
+                      <string notr="true">rcsemi_button_group</string>
+                     </attribute>
+                    </widget>
+                   </item>
+                   <item>
+                    <spacer name="horizontalSpacer_21">
+                     <property name="orientation">
+                      <enum>Qt::Horizontal</enum>
+                     </property>
+                     <property name="sizeHint" stdset="0">
+                      <size>
+                       <width>40</width>
+                       <height>20</height>
+                      </size>
+                     </property>
+                    </spacer>
+                   </item>
+                  </layout>
+                 </item>
+                 <item row="15" column="0">
+                  <widget class="QLabel" name="label_62">
+                   <property name="text">
+                    <string>Cleavage at each residues</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="15" column="2">
+                  <widget class="QPushButton" name="ruc_push_button">
+                   <property name="text">
+                    <string>?</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="15" column="1">
+                  <layout class="QHBoxLayout" name="horizontalLayout_24">
+                   <item>
+                    <widget class="QRadioButton" name="ruc_yes_radio_button">
+                     <property name="text">
+                      <string>yes</string>
+                     </property>
+                     <attribute name="buttonGroup">
+                      <string notr="true">ruc_button_group</string>
+                     </attribute>
+                    </widget>
+                   </item>
+                   <item>
+                    <widget class="QRadioButton" name="ruc_no_radio_button">
+                     <property name="text">
+                      <string>no</string>
+                     </property>
+                     <attribute name="buttonGroup">
+                      <string notr="true">ruc_button_group</string>
+                     </attribute>
+                    </widget>
+                   </item>
+                   <item>
+                    <spacer name="horizontalSpacer_22">
+                     <property name="orientation">
+                      <enum>Qt::Horizontal</enum>
+                     </property>
+                     <property name="sizeHint" stdset="0">
+                      <size>
+                       <width>40</width>
+                       <height>20</height>
+                      </size>
+                     </property>
+                    </spacer>
+                   </item>
+                  </layout>
                  </item>
                 </layout>
                </item>
@@ -2870,8 +3125,8 @@
    <slot>doHelp()</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>999</x>
-     <y>183</y>
+     <x>1017</x>
+     <y>104</y>
     </hint>
     <hint type="destinationlabel">
      <x>1130</x>
@@ -2886,8 +3141,8 @@
    <slot>doHelp()</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>1021</x>
-     <y>224</y>
+     <x>1017</x>
+     <y>138</y>
     </hint>
     <hint type="destinationlabel">
      <x>1076</x>
@@ -2902,8 +3157,8 @@
    <slot>doHelp()</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>1000</x>
-     <y>252</y>
+     <x>1017</x>
+     <y>172</y>
     </hint>
     <hint type="destinationlabel">
      <x>1070</x>
@@ -2918,8 +3173,8 @@
    <slot>doHelp()</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>963</x>
-     <y>286</y>
+     <x>1017</x>
+     <y>206</y>
     </hint>
     <hint type="destinationlabel">
      <x>1064</x>
@@ -2934,8 +3189,8 @@
    <slot>doHelp()</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>1007</x>
-     <y>320</y>
+     <x>1017</x>
+     <y>240</y>
     </hint>
     <hint type="destinationlabel">
      <x>1523</x>
@@ -2950,8 +3205,8 @@
    <slot>doHelp()</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>993</x>
-     <y>356</y>
+     <x>1017</x>
+     <y>274</y>
     </hint>
     <hint type="destinationlabel">
      <x>1523</x>
@@ -2966,8 +3221,8 @@
    <slot>doHelp()</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>960</x>
-     <y>396</y>
+     <x>1017</x>
+     <y>308</y>
     </hint>
     <hint type="destinationlabel">
      <x>993</x>
@@ -2975,6 +3230,150 @@
     </hint>
    </hints>
   </connection>
+  <connection>
+   <sender>refpmm_push_button</sender>
+   <signal>clicked()</signal>
+   <receiver>EditTandemPresetView</receiver>
+   <slot>doHelp()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>1017</x>
+     <y>342</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>1132</x>
+     <y>813</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>refpmm1_push_button</sender>
+   <signal>clicked()</signal>
+   <receiver>EditTandemPresetView</receiver>
+   <slot>doHelp()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>1017</x>
+     <y>376</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>1090</x>
+     <y>791</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>refpmm2_push_button</sender>
+   <signal>clicked()</signal>
+   <receiver>EditTandemPresetView</receiver>
+   <slot>doHelp()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>1017</x>
+     <y>410</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>1076</x>
+     <y>798</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>refpmmotif_push_button</sender>
+   <signal>clicked()</signal>
+   <receiver>EditTandemPresetView</receiver>
+   <slot>doHelp()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>1017</x>
+     <y>444</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>1001</x>
+     <y>999</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>refpmmotif1_push_button</sender>
+   <signal>clicked()</signal>
+   <receiver>EditTandemPresetView</receiver>
+   <slot>doHelp()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>1017</x>
+     <y>478</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>933</x>
+     <y>948</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>refpmmotif2_push_button</sender>
+   <signal>clicked()</signal>
+   <receiver>EditTandemPresetView</receiver>
+   <slot>doHelp()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>1017</x>
+     <y>512</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>920</x>
+     <y>916</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>rupmffr_push_button</sender>
+   <signal>clicked()</signal>
+   <receiver>EditTandemPresetView</receiver>
+   <slot>doHelp()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>1017</x>
+     <y>546</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>807</x>
+     <y>1069</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>rcsemi_push_button</sender>
+   <signal>clicked()</signal>
+   <receiver>EditTandemPresetView</receiver>
+   <slot>doHelp()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>1017</x>
+     <y>580</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>789</x>
+     <y>874</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>ruc_push_button</sender>
+   <signal>clicked()</signal>
+   <receiver>EditTandemPresetView</receiver>
+   <slot>doHelp()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>965</x>
+     <y>597</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>865</x>
+     <y>1011</y>
+    </hint>
+   </hints>
+  </connection>
  </connections>
  <slots>
   <slot>doCopy()</slot>
@@ -2987,23 +3386,26 @@
   <slot>doSelectDir()</slot>
  </slots>
  <buttongroups>
+  <buttongroup name="sci_button_group"/>
+  <buttongroup name="sbi_button_group"/>
+  <buttongroup name="pqp_button_group"/>
   <buttongroup name="syi_button_group"/>
-  <buttongroup name="szi_button_group"/>
-  <buttongroup name="refine_button_group"/>
-  <buttongroup name="spmmeu_button_group"/>
+  <buttongroup name="spmmie_button_group"/>
+  <buttongroup name="sfmmeu_button_group"/>
   <buttongroup name="pstpb_button_group"/>
+  <buttongroup name="pqa_button_group"/>
+  <buttongroup name="sxi_button_group"/>
+  <buttongroup name="sir_button_group"/>
+  <buttongroup name="sunlw_button_group"/>
+  <buttongroup name="spmmeu_button_group"/>
   <buttongroup name="sai_button_group"/>
   <buttongroup name="pcsemi_button_group"/>
-  <buttongroup name="pqp_button_group"/>
-  <buttongroup name="sbi_button_group"/>
   <buttongroup name="suca_button_group"/>
-  <buttongroup name="sir_button_group"/>
+  <buttongroup name="refine_button_group"/>
+  <buttongroup name="rupmffr_button_group"/>
   <buttongroup name="scp_button_group"/>
-  <buttongroup name="sci_button_group"/>
-  <buttongroup name="spmmie_button_group"/>
-  <buttongroup name="sxi_button_group"/>
-  <buttongroup name="sfmmeu_button_group"/>
-  <buttongroup name="sunlw_button_group"/>
-  <buttongroup name="pqa_button_group"/>
+  <buttongroup name="szi_button_group"/>
+  <buttongroup name="ruc_button_group"/>
+  <buttongroup name="rcsemi_button_group"/>
  </buttongroups>
 </ui>
diff --git a/src/gui/edit_tandem_preset_dialog/edittandempresetdialog.cpp b/src/gui/edit_tandem_preset_dialog/edittandempresetdialog.cpp
index c1659f113..cd614096c 100644
--- a/src/gui/edit_tandem_preset_dialog/edittandempresetdialog.cpp
+++ b/src/gui/edit_tandem_preset_dialog/edittandempresetdialog.cpp
@@ -354,16 +354,31 @@ void EditTandemPresetDialog::doHelp() {
     {
         html_doc.setFileName(":/tandem/resources/html_doc/refpctm.html");
     }
-if ((senderObjName == "refmm_push_button")|| (senderObjName == "refmm1_push_button")|| (senderObjName == "refmm2_push_button"))
+    if ((senderObjName == "refmm_push_button")|| (senderObjName == "refmm1_push_button")|| (senderObjName == "refmm2_push_button"))
     {
         html_doc.setFileName(":/tandem/resources/html_doc/refmm.html");
     }
-
-
-    _tandem_params.setParamLabelValue("residue, potential modification mass", ui->rpmm_edit->text());
-    _tandem_params.setParamLabelValue("residue, potential modification mass 1", ui->rpmm1_edit->text());
-    _tandem_params.setParamLabelValue("residue, potential modification mass 2", ui->rpmm2_edit->text());
-
+    if ((senderObjName == "refpmm_push_button")|| (senderObjName == "refpmm1_push_button")|| (senderObjName == "refpmm2_push_button"))
+    {
+        html_doc.setFileName(":/tandem/resources/html_doc/refpmm.html");
+    }
+    if ((senderObjName == "refpmmotif_push_button")|| (senderObjName == "refpmmotif1_push_button")|| (senderObjName == "refpmmotif2_push_button"))
+    {
+        html_doc.setFileName(":/tandem/resources/html_doc/refpmmotif.html");
+    }
+    if(senderObjName == "rupmffr_push_button")
+    {
+        html_doc.setFileName(":/tandem/resources/html_doc/rupmffr.html");
+    }
+    if(senderObjName == "rcsemi_push_button")
+    {
+        html_doc.setFileName(":/tandem/resources/html_doc/rcsemi.html");
+    }
+    if(senderObjName == "ruc_push_button")
+    {
+        html_doc.setFileName(":/tandem/resources/html_doc/ruc.html");
+    }
+    
     if (html_doc.open(QFile::ReadOnly | QFile::Text)) {
         QTextStream in(&html_doc);
         ui->doc_plain_text_edit->setHtml(in.readAll());
@@ -498,7 +513,24 @@ void EditTandemPresetDialog::readUi() {
         _tandem_params.setParamLabelValue("refine, modification mass", ui->refmm_edit->text());
         _tandem_params.setParamLabelValue("refine, modification mass 1", ui->refmm1_edit->text());
         _tandem_params.setParamLabelValue("refine, modification mass 2", ui->refmm2_edit->text());
-        
+        _tandem_params.setParamLabelValue("refine, potential modification mass", ui->refpmm_edit->text());
+        _tandem_params.setParamLabelValue("refine, potential modification mass 1", ui->refpmm1_edit->text());
+        _tandem_params.setParamLabelValue("refine, potential modification mass 2", ui->refpmm2_edit->text());
+        _tandem_params.setParamLabelValue("refine, potential modification motif", ui->refpmmotif_edit->text());
+        _tandem_params.setParamLabelValue("refine, potential modification motif 1", ui->refpmmotif1_edit->text());
+        _tandem_params.setParamLabelValue("refine, potential modification motif 2", ui->refpmmotif2_edit->text());
+        _tandem_params.setParamLabelValue("refine, use potential modifications for full refinement", "no");
+        if (ui->rupmffr_yes_radio_button->isChecked()) {
+            _tandem_params.setParamLabelValue("refine, use potential modifications for full refinement", "yes");
+        }
+        _tandem_params.setParamLabelValue("refine, cleavage semi", "no");
+        if (ui->rcsemi_yes_radio_button->isChecked()) {
+            _tandem_params.setParamLabelValue("refine, cleavage semi", "yes");
+        }
+        _tandem_params.setParamLabelValue("refine, unanticipated cleavage", "no");
+        if (ui->ruc_yes_radio_button->isChecked()) {
+            _tandem_params.setParamLabelValue("refine, unanticipated cleavage", "yes");
+        }
 
     }
     catch (pappso::PappsoException & error) {
@@ -740,14 +772,38 @@ void EditTandemPresetDialog::populate() {
     //<note type="input" label="refine, modification mass 2"></note>
     ui->refmm2_edit->setText(_tandem_params.getValue("refine, modification mass 2"));
     //<note type="input" label="refine, potential modification mass">15.99491@M</note>
+    ui->refpmm_edit->setText(_tandem_params.getValue("refine, potential modification mass"));
     //<note type="input" label="refine, potential modification mass 1"></note>
+    ui->refpmm1_edit->setText(_tandem_params.getValue("refine, potential modification mass 1"));
     //<note type="input" label="refine, potential modification mass 2"></note>
+    ui->refpmm2_edit->setText(_tandem_params.getValue("refine, potential modification mass 2"));
     //<note type="input" label="refine, potential modification motif"></note>
+    ui->refpmmotif_edit->setText(_tandem_params.getValue("refine, potential modification motif"));
     //<note type="input" label="refine, potential modification motif 1"></note>
+    ui->refpmmotif1_edit->setText(_tandem_params.getValue("refine, potential modification motif 1"));
     //<note type="input" label="refine, potential modification motif 2"></note>
+    ui->refpmmotif2_edit->setText(_tandem_params.getValue("refine, potential modification motif 2"));
     //<note type="input" label="refine, use potential modifications for full refinement">yes</note>
+    ui->rupmffr_yes_radio_button->setChecked(true);
+    ui->rupmffr_no_radio_button->setChecked(false);
+    if ( _tandem_params.getValue("refine, use potential modifications for full refinement") == "no" ) { // -1 for not found
+        ui->rupmffr_yes_radio_button->setChecked(false);
+        ui->rupmffr_no_radio_button->setChecked(true);
+    }
     //<note type="input" label="refine, cleavage semi">no</note>
+    ui->rcsemi_yes_radio_button->setChecked(true);
+    ui->rcsemi_no_radio_button->setChecked(false);
+    if ( _tandem_params.getValue("refine, cleavage semi") == "no" ) { // -1 for not found
+        ui->rcsemi_yes_radio_button->setChecked(false);
+        ui->rcsemi_no_radio_button->setChecked(true);
+    }
     //<note type="input" label="refine, unanticipated cleavage">no</note>
+    ui->ruc_yes_radio_button->setChecked(true);
+    ui->ruc_no_radio_button->setChecked(false);
+    if ( _tandem_params.getValue("refine, unanticipated cleavage") == "no" ) { // -1 for not found
+        ui->ruc_yes_radio_button->setChecked(false);
+        ui->ruc_no_radio_button->setChecked(true);
+    }
     //<note type="input" label="refine, spectrum synthesis">yes</note>
     //<note type="input" label="refine, point mutations">no</note>
 
-- 
GitLab