Skip to content

Commit eb4b419

Browse files
committed
deep learning for spectra and RTs
1 parent 17286e9 commit eb4b419

17 files changed

+3578
-3090
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
*.db
2222
*.ipch
2323
*.cache
24+
*.msi
25+
2426

2527

2628

DIA-NN GUI manual.pdf

38.1 KB
Binary file not shown.

GUI/GUI/DIA-NN GUI.csproj

+16-26
Original file line numberDiff line numberDiff line change
@@ -27,29 +27,18 @@
2727
<UseApplicationTrust>false</UseApplicationTrust>
2828
<BootstrapperEnabled>true</BootstrapperEnabled>
2929
</PropertyGroup>
30-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
31-
<PlatformTarget>AnyCPU</PlatformTarget>
32-
<DebugSymbols>true</DebugSymbols>
33-
<DebugType>full</DebugType>
34-
<Optimize>false</Optimize>
35-
<OutputPath>bin\Debug\</OutputPath>
36-
<DefineConstants>DEBUG;TRACE</DefineConstants>
37-
<ErrorReport>prompt</ErrorReport>
38-
<WarningLevel>4</WarningLevel>
30+
<PropertyGroup>
31+
<ApplicationIcon>DIA-NN.ico</ApplicationIcon>
3932
</PropertyGroup>
40-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
41-
<PlatformTarget>x64</PlatformTarget>
42-
<DebugType>pdbonly</DebugType>
43-
<Optimize>true</Optimize>
33+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Deploy|AnyCPU'">
4434
<OutputPath>..\..\</OutputPath>
4535
<DefineConstants>TRACE</DefineConstants>
46-
<ErrorReport>prompt</ErrorReport>
47-
<WarningLevel>4</WarningLevel>
48-
<Prefer32Bit>false</Prefer32Bit>
36+
<Optimize>true</Optimize>
37+
<DebugType>pdbonly</DebugType>
38+
<PlatformTarget>x64</PlatformTarget>
4939
<GenerateSerializationAssemblies>On</GenerateSerializationAssemblies>
50-
</PropertyGroup>
51-
<PropertyGroup>
52-
<ApplicationIcon>icon.ico</ApplicationIcon>
40+
<ErrorReport>prompt</ErrorReport>
41+
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
5342
</PropertyGroup>
5443
<ItemGroup>
5544
<Reference Include="System" />
@@ -101,12 +90,6 @@
10190
<ItemGroup>
10291
<None Include="App.config" />
10392
</ItemGroup>
104-
<ItemGroup>
105-
<None Include="Resources\Icon.ico" />
106-
</ItemGroup>
107-
<ItemGroup>
108-
<None Include="icon.ico" />
109-
</ItemGroup>
11093
<ItemGroup>
11194
<BootstrapperPackage Include=".NETFramework,Version=v4.6.1">
11295
<Visible>False</Visible>
@@ -119,9 +102,16 @@
119102
<Install>false</Install>
120103
</BootstrapperPackage>
121104
</ItemGroup>
105+
<ItemGroup>
106+
<Folder Include="Resources\" />
107+
</ItemGroup>
108+
<ItemGroup>
109+
<Content Include="DIA-NN.ico" />
110+
<Content Include="DNN.ico" />
111+
</ItemGroup>
122112
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
123113
<PropertyGroup>
124114
<PostBuildEvent>
125-
</PostBuildEvent>
115+
</PostBuildEvent>
126116
</PropertyGroup>
127117
</Project>

GUI/GUI/Form1.Designer.cs

+80-61
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

GUI/GUI/Form1.cs

+46-38
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ public struct Settings
2727
use_quant_b, use_lib_free_b, met_exc_b, carbamet_b, oxid_b, opt_training_b;
2828
public decimal prec_fdr_d, prot_fdr_d, mass_acc_d, mass_acc_ms1_d;
2929
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;
3133
}
3234

3335
public partial class Form1 : Form
@@ -39,27 +41,14 @@ public Form1()
3941

4042
public string curr_dir;
4143

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-
5644
bool running = false, finished = false, in_pipeline = false, finished_pipeline = false;
5745
Process process = new Process();
5846
List<Settings> Pipeline = new List<Settings>();
5947
List<string> PipNames = new List<string>();
6048
int pip_last_index = 0, processed = 0;
6149
string stats_file, report_file, pdf_file;
62-
50+
Settings DefaultConfig = new Settings();
51+
6352
private void SaveSettings(ref Settings S)
6453
{
6554
S.diann_s = ExeText.Text;
@@ -74,7 +63,7 @@ private void SaveSettings(ref Settings S)
7463
S.fasta_s = FastaText.Text;
7564
S.use_lib_free_b = LibraryFreeBox.Checked;
7665
S.out_lib_s = OutputLibText.Text;
77-
S.learn_lib_s = LearnLibText.Text;
66+
S.learn_lib_s = "";
7867
S.protease_i = EnzymeCombo.SelectedIndex;
7968
S.missed_i = MissedCleavageUpDown.Value;
8069
S.pep_min_i = PepLenMin.Value;
@@ -87,7 +76,7 @@ private void SaveSettings(ref Settings S)
8776
S.carbamet_b = CysteineBox.Checked;
8877
S.varmod_i = VarModsUpDown.Value;
8978
S.oxid_b = OxidationBox.Checked;
90-
S.opt_training_b = OptimiseTrainingBox.Checked;
79+
S.opt_training_b = false;
9180
S.scan_i = WindowUpDown.Value;
9281
S.mass_acc_d = MassAccUpDown.Value;
9382
S.mass_acc_ms1_d = MassAccMs1UpDown.Value;
@@ -104,6 +93,24 @@ private void SaveSettings(ref Settings S)
10493
S.quant_i = QuantBox.SelectedIndex;
10594
S.pdf_rep_b = PDFRepBox.Checked;
10695
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);
107114
}
108115

109116
private void LoadSettings(Settings S)
@@ -119,7 +126,6 @@ private void LoadSettings(Settings S)
119126
FastaText.Text = S.fasta_s;
120127
LibraryFreeBox.Checked = S.use_lib_free_b;
121128
OutputLibText.Text = S.out_lib_s;
122-
LearnLibText.Text = S.learn_lib_s;
123129
EnzymeCombo.SelectedIndex = S.protease_i;
124130
MissedCleavageUpDown.Value = S.missed_i;
125131
PepLenMin.Value = S.pep_min_i;
@@ -132,7 +138,6 @@ private void LoadSettings(Settings S)
132138
CysteineBox.Checked = S.carbamet_b;
133139
VarModsUpDown.Value = S.varmod_i;
134140
OxidationBox.Checked = S.oxid_b;
135-
OptimiseTrainingBox.Checked = S.opt_training_b;
136141
WindowUpDown.Value = S.scan_i;
137142
MassAccUpDown.Value = S.mass_acc_d;
138143
MassAccMs1UpDown.Value = S.mass_acc_ms1_d;
@@ -149,6 +154,9 @@ private void LoadSettings(Settings S)
149154
QuantBox.SelectedIndex = S.quant_i;
150155
PDFRepBox.Checked = S.pdf_rep_b;
151156
PrositBox.Checked = S.prosit_b;
157+
PredictorBox.Checked = S.predictor_b;
158+
RAMBox.Checked = S.ram_b;
159+
ReannotateBox.Checked = S.reannotate_b;
152160

153161
if (!System.IO.Directory.Exists(S.temp_folder_s)) TempFolderBox.Text = S.temp_folder_s = "";
154162
}
@@ -294,6 +302,7 @@ private void RunProcess(bool convert, Settings S)
294302
process.StartInfo.Arguments += " --out-gene \"" + report + ".genes.tsv\"";
295303
process.StartInfo.Arguments += " --qvalue " + Convert.ToString(0.01 * (double)S.prec_fdr_d, new System.Globalization.CultureInfo("en-US"));
296304

305+
if (S.ram_b) process.StartInfo.Arguments += " --min-corr 1.0 --corr-diff 1.0";
297306
if (S.pdf_rep_b)
298307
{
299308
stats_file = "\"" + report + ".stats.tsv\"";
@@ -308,7 +317,9 @@ private void RunProcess(bool convert, Settings S)
308317
process.StartInfo.Arguments += " --out-lib \"" + S.out_lib_s + "\"";
309318
process.StartInfo.Arguments += " --gen-spec-lib";
310319
}
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";
312323

313324
if (S.fasta_s != "")
314325
{
@@ -507,15 +518,6 @@ private void FastaButton_Click(object sender, EventArgs e)
507518
}
508519
}
509520

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-
519521
private void OutputLibButton_Click(object sender, EventArgs e)
520522
{
521523
SaveFileDialog outDialog = new SaveFileDialog();
@@ -727,6 +729,7 @@ private void LibraryFreeBox_CheckedChanged(object sender, EventArgs e)
727729
if (LibraryFreeBox.Checked)
728730
{
729731
GenLibBox.Checked = true;
732+
PredictorBox.Checked = true;
730733
if (OutputLibText.Text == "") OutputLibText.Text = curr_dir + "\\lib.tsv";
731734
}
732735
}
@@ -746,28 +749,33 @@ private void OutputLibText_TextChanged(object sender, EventArgs e)
746749
else GenLibBox.Checked = false;
747750
}
748751

749-
private void OptimiseTrainingBox_CheckedChanged(object sender, EventArgs e)
752+
private void OutputText_TextChanged(object sender, EventArgs e)
750753
{
751-
if (OptimiseTrainingBox.Checked)
754+
755+
}
756+
757+
private void PredictorBox_CheckedChanged(object sender, EventArgs e)
758+
{
759+
if (PredictorBox.Checked)
752760
{
753761
GenLibBox.Checked = true;
762+
if (LibText.Text == "" && FastaText.Text != "") LibraryFreeBox.Checked = true;
754763
if (OutputLibText.Text == "") OutputLibText.Text = curr_dir + "\\lib.tsv";
755764
}
756765
}
757766

758-
private void LearnLibText_TextChanged(object sender, EventArgs e)
767+
private void PrositBox_CheckedChanged(object sender, EventArgs e)
759768
{
760-
if (LearnLibText.Text != "")
769+
if (PrositBox.Checked)
761770
{
762-
LibraryFreeBox.Checked = true;
763771
GenLibBox.Checked = true;
764-
if (OutputLibText.Text == "") OutputLibText.Text = curr_dir + "\\lib.tsv";
772+
if (LibText.Text == "" && FastaText.Text != "") LibraryFreeBox.Checked = true;
765773
}
766774
}
767775

768-
private void OutputText_TextChanged(object sender, EventArgs e)
776+
private void ResetButton_Click(object sender, EventArgs e)
769777
{
770-
778+
LoadSettings(DefaultConfig);
771779
}
772780

773781
private void OpenPipelineButton_Click(object sender, EventArgs e)

0 commit comments

Comments
 (0)