@@ -27,7 +27,9 @@ public struct Settings
27
27
use_quant_b , use_lib_free_b , met_exc_b , carbamet_b , oxid_b , opt_training_b ;
28
28
public decimal prec_fdr_d , prot_fdr_d , mass_acc_d , mass_acc_ms1_d ;
29
29
public int quant_i ;
30
- public bool pdf_rep_b , prosit_b ;
30
+ public bool pdf_rep_b , prosit_b , predictor_b ;
31
+ public bool ram_b ;
32
+ public bool reannotate_b ;
31
33
}
32
34
33
35
public partial class Form1 : Form
@@ -39,27 +41,14 @@ public Form1()
39
41
40
42
public string curr_dir ;
41
43
42
- private void Form1_Load ( object sender , EventArgs e )
43
- {
44
- int cores = 0 ;
45
- foreach ( var pr in new System . Management . ManagementObjectSearcher ( "Select * from Win32_Processor" ) . Get ( ) )
46
- cores += int . Parse ( pr [ "NumberOfCores" ] . ToString ( ) ) ;
47
- ThreadsUpDown . Value = cores ;
48
- ThreadsUpDown . Maximum = Environment . ProcessorCount ;
49
- EnzymeCombo . SelectedIndex = 0 ;
50
- PGBox . SelectedIndex = 3 ;
51
- QuantBox . SelectedIndex = 0 ;
52
- curr_dir = System . IO . Directory . GetCurrentDirectory ( ) ;
53
- OutputText . Text = curr_dir + "\\ report.tsv" ;
54
- }
55
-
56
44
bool running = false , finished = false , in_pipeline = false , finished_pipeline = false ;
57
45
Process process = new Process ( ) ;
58
46
List < Settings > Pipeline = new List < Settings > ( ) ;
59
47
List < string > PipNames = new List < string > ( ) ;
60
48
int pip_last_index = 0 , processed = 0 ;
61
49
string stats_file , report_file , pdf_file ;
62
-
50
+ Settings DefaultConfig = new Settings ( ) ;
51
+
63
52
private void SaveSettings ( ref Settings S )
64
53
{
65
54
S . diann_s = ExeText . Text ;
@@ -74,7 +63,7 @@ private void SaveSettings(ref Settings S)
74
63
S . fasta_s = FastaText . Text ;
75
64
S . use_lib_free_b = LibraryFreeBox . Checked ;
76
65
S . out_lib_s = OutputLibText . Text ;
77
- S . learn_lib_s = LearnLibText . Text ;
66
+ S . learn_lib_s = "" ;
78
67
S . protease_i = EnzymeCombo . SelectedIndex ;
79
68
S . missed_i = MissedCleavageUpDown . Value ;
80
69
S . pep_min_i = PepLenMin . Value ;
@@ -87,7 +76,7 @@ private void SaveSettings(ref Settings S)
87
76
S . carbamet_b = CysteineBox . Checked ;
88
77
S . varmod_i = VarModsUpDown . Value ;
89
78
S . oxid_b = OxidationBox . Checked ;
90
- S . opt_training_b = OptimiseTrainingBox . Checked ;
79
+ S . opt_training_b = false ;
91
80
S . scan_i = WindowUpDown . Value ;
92
81
S . mass_acc_d = MassAccUpDown . Value ;
93
82
S . mass_acc_ms1_d = MassAccMs1UpDown . Value ;
@@ -104,6 +93,24 @@ private void SaveSettings(ref Settings S)
104
93
S . quant_i = QuantBox . SelectedIndex ;
105
94
S . pdf_rep_b = PDFRepBox . Checked ;
106
95
S . prosit_b = PrositBox . Checked ;
96
+ S . predictor_b = PredictorBox . Checked ;
97
+ S . ram_b = RAMBox . Checked ;
98
+ S . reannotate_b = ReannotateBox . Checked ;
99
+ }
100
+
101
+ private void Form1_Load ( object sender , EventArgs e )
102
+ {
103
+ int cores = 0 ;
104
+ foreach ( var pr in new System . Management . ManagementObjectSearcher ( "Select * from Win32_Processor" ) . Get ( ) )
105
+ cores += int . Parse ( pr [ "NumberOfCores" ] . ToString ( ) ) ;
106
+ ThreadsUpDown . Value = cores ;
107
+ ThreadsUpDown . Maximum = Environment . ProcessorCount ;
108
+ EnzymeCombo . SelectedIndex = 0 ;
109
+ PGBox . SelectedIndex = 3 ;
110
+ QuantBox . SelectedIndex = 0 ;
111
+ curr_dir = System . IO . Directory . GetCurrentDirectory ( ) ;
112
+ OutputText . Text = curr_dir + "\\ report.tsv" ;
113
+ SaveSettings ( ref DefaultConfig ) ;
107
114
}
108
115
109
116
private void LoadSettings ( Settings S )
@@ -119,7 +126,6 @@ private void LoadSettings(Settings S)
119
126
FastaText . Text = S . fasta_s ;
120
127
LibraryFreeBox . Checked = S . use_lib_free_b ;
121
128
OutputLibText . Text = S . out_lib_s ;
122
- LearnLibText . Text = S . learn_lib_s ;
123
129
EnzymeCombo . SelectedIndex = S . protease_i ;
124
130
MissedCleavageUpDown . Value = S . missed_i ;
125
131
PepLenMin . Value = S . pep_min_i ;
@@ -132,7 +138,6 @@ private void LoadSettings(Settings S)
132
138
CysteineBox . Checked = S . carbamet_b ;
133
139
VarModsUpDown . Value = S . varmod_i ;
134
140
OxidationBox . Checked = S . oxid_b ;
135
- OptimiseTrainingBox . Checked = S . opt_training_b ;
136
141
WindowUpDown . Value = S . scan_i ;
137
142
MassAccUpDown . Value = S . mass_acc_d ;
138
143
MassAccMs1UpDown . Value = S . mass_acc_ms1_d ;
@@ -149,6 +154,9 @@ private void LoadSettings(Settings S)
149
154
QuantBox . SelectedIndex = S . quant_i ;
150
155
PDFRepBox . Checked = S . pdf_rep_b ;
151
156
PrositBox . Checked = S . prosit_b ;
157
+ PredictorBox . Checked = S . predictor_b ;
158
+ RAMBox . Checked = S . ram_b ;
159
+ ReannotateBox . Checked = S . reannotate_b ;
152
160
153
161
if ( ! System . IO . Directory . Exists ( S . temp_folder_s ) ) TempFolderBox . Text = S . temp_folder_s = "" ;
154
162
}
@@ -294,6 +302,7 @@ private void RunProcess(bool convert, Settings S)
294
302
process . StartInfo . Arguments += " --out-gene \" " + report + ".genes.tsv\" " ;
295
303
process . StartInfo . Arguments += " --qvalue " + Convert . ToString ( 0.01 * ( double ) S . prec_fdr_d , new System . Globalization . CultureInfo ( "en-US" ) ) ;
296
304
305
+ if ( S . ram_b ) process . StartInfo . Arguments += " --min-corr 1.0 --corr-diff 1.0" ;
297
306
if ( S . pdf_rep_b )
298
307
{
299
308
stats_file = "\" " + report + ".stats.tsv\" " ;
@@ -308,7 +317,9 @@ private void RunProcess(bool convert, Settings S)
308
317
process . StartInfo . Arguments += " --out-lib \" " + S . out_lib_s + "\" " ;
309
318
process . StartInfo . Arguments += " --gen-spec-lib" ;
310
319
}
311
- if ( S . prosit_b ) process . StartInfo . Arguments += " --prosit" ;
320
+ if ( S . predictor_b ) process . StartInfo . Arguments += " --predictor" ;
321
+ if ( S . prosit_b ) process . StartInfo . Arguments += " --prosit" ;
322
+ if ( S . reannotate_b ) process . StartInfo . Arguments += " --reannotate" ;
312
323
313
324
if ( S . fasta_s != "" )
314
325
{
@@ -507,15 +518,6 @@ private void FastaButton_Click(object sender, EventArgs e)
507
518
}
508
519
}
509
520
510
- private void LearnLibButton_Click ( object sender , EventArgs e )
511
- {
512
- OpenFileDialog libDialog = new OpenFileDialog ( ) ;
513
- libDialog . Filter = "Spectral library files (*.txt, *.csv, *.tsv, *.xls, *.speclib)|*.txt;*.csv;*.tsv;*.xls;*.speclib|All files (*.*)|*.*" ;
514
- libDialog . FilterIndex = 0 ;
515
- if ( libDialog . ShowDialog ( ) == DialogResult . OK )
516
- LearnLibText . Text = libDialog . FileName ;
517
- }
518
-
519
521
private void OutputLibButton_Click ( object sender , EventArgs e )
520
522
{
521
523
SaveFileDialog outDialog = new SaveFileDialog ( ) ;
@@ -727,6 +729,7 @@ private void LibraryFreeBox_CheckedChanged(object sender, EventArgs e)
727
729
if ( LibraryFreeBox . Checked )
728
730
{
729
731
GenLibBox . Checked = true ;
732
+ PredictorBox . Checked = true ;
730
733
if ( OutputLibText . Text == "" ) OutputLibText . Text = curr_dir + "\\ lib.tsv" ;
731
734
}
732
735
}
@@ -746,28 +749,33 @@ private void OutputLibText_TextChanged(object sender, EventArgs e)
746
749
else GenLibBox . Checked = false ;
747
750
}
748
751
749
- private void OptimiseTrainingBox_CheckedChanged ( object sender , EventArgs e )
752
+ private void OutputText_TextChanged ( object sender , EventArgs e )
750
753
{
751
- if ( OptimiseTrainingBox . Checked )
754
+
755
+ }
756
+
757
+ private void PredictorBox_CheckedChanged ( object sender , EventArgs e )
758
+ {
759
+ if ( PredictorBox . Checked )
752
760
{
753
761
GenLibBox . Checked = true ;
762
+ if ( LibText . Text == "" && FastaText . Text != "" ) LibraryFreeBox . Checked = true ;
754
763
if ( OutputLibText . Text == "" ) OutputLibText . Text = curr_dir + "\\ lib.tsv" ;
755
764
}
756
765
}
757
766
758
- private void LearnLibText_TextChanged ( object sender , EventArgs e )
767
+ private void PrositBox_CheckedChanged ( object sender , EventArgs e )
759
768
{
760
- if ( LearnLibText . Text != "" )
769
+ if ( PrositBox . Checked )
761
770
{
762
- LibraryFreeBox . Checked = true ;
763
771
GenLibBox . Checked = true ;
764
- if ( OutputLibText . Text == "" ) OutputLibText . Text = curr_dir + " \\ lib.tsv" ;
772
+ if ( LibText . Text == "" && FastaText . Text != "" ) LibraryFreeBox . Checked = true ;
765
773
}
766
774
}
767
775
768
- private void OutputText_TextChanged ( object sender , EventArgs e )
776
+ private void ResetButton_Click ( object sender , EventArgs e )
769
777
{
770
-
778
+ LoadSettings ( DefaultConfig ) ;
771
779
}
772
780
773
781
private void OpenPipelineButton_Click ( object sender , EventArgs e )
0 commit comments