Skip to content

Commit 7390ef6

Browse files
committed
Fix bug in report
Add load sample button for easy test
1 parent 78055ba commit 7390ef6

5 files changed

Lines changed: 292 additions & 37 deletions

File tree

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
;????? TEST_DATASET_1 ( SAGE ) ?????
2+
3+
4+
Subset Size:;3000
5+
6+
7+
Parameter;Value;Score;Comments
8+
9+
10+
Digestion:;enzyme;;Pre-Selected
11+
12+
Enzyme:;Trypsin;99 %;Default
13+
14+
Specificity:;Specific;;Pre-Selected
15+
16+
Max Missed Cleavages:;2;100 %;
17+
18+
Fragment Ion Types:;b-y;;Pre-Selected
19+
20+
Precursor Accuracy:;10.0 PPM;;Pre-Selected
21+
22+
Fragment Accuracy:;0.02 DA;;Pre-Selected
23+
24+
Precursor Charge:;2 - 4;;Pre-Selected
25+
26+
Isotops:;0 - 1;;Pre-Selected
27+
28+
29+
Fixed Modifications:;Carbamidomethylation of C;Pre-Selected
30+
;
31+
32+
33+
Variable Modifications:;Oxidation of M;;Pre-Selected
34+
;Phosphorylation of S;Pre-Selected
35+
;Phosphorylation of T;Pre-Selected
36+
;Phosphorylation of Y;Pre-Selected
37+
;
38+
39+
40+
;????? Sage Advanced Parameters ?????
41+
42+
43+
Parameter;Value;Score;Comments
44+
45+
46+
Peptide Length (min-max):;8-30;;Pre-Selected
47+
48+
Fragment MZ (min-max):;200.0-2000.0;;Pre-Selected
49+
50+
Peptide Mass:;600.0-5000.0;;Pre-Selected
51+
52+
Min Ion Index:;2;;Pre-Selected
53+
54+
Max Variable Modification:;2;;Pre-Selected
55+
56+
Generate Decoy:;No;;Pre-Selected
57+
58+
Deisotope:;No;;Pre-Selected
59+
60+
Chimeric Spectra:;No;;Pre-Selected
61+
62+
Wide Window:;No;;Pre-Selected
63+
64+
Predect RT:;Yes;;Pre-Selected
65+
66+
Number of Peaks:;15-150;;Pre-Selected
67+
68+
Min Mached Peaks:;4;;Pre-Selected
69+
70+
Max Fragment Charge:;;Pre-Selected

quicksearchprot/src/main/java/no/uib/probe/quicksearchprot/gui/QSPROTGUI.form

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,9 @@
9090
<EmptySpace type="unrelated" max="-2" attributes="0"/>
9191
<Component id="jButton5" pref="0" max="32767" attributes="0"/>
9292
</Group>
93-
<Component id="inputOutputPanel" alignment="0" pref="0" max="32767" attributes="0"/>
93+
<Component id="inputOutputPanel" alignment="0" pref="799" max="32767" attributes="0"/>
9494
<Component id="jPanel4" alignment="0" max="32767" attributes="0"/>
95-
<Component id="progressBarContainer" alignment="0" pref="0" max="32767" attributes="0"/>
95+
<Component id="progressBarContainer" alignment="0" pref="799" max="32767" attributes="0"/>
9696
<Component id="jTabbedPane1" alignment="0" pref="0" max="32767" attributes="0"/>
9797
</Group>
9898
<EmptySpace min="-2" pref="10" max="-2" attributes="0"/>
@@ -939,7 +939,9 @@
939939
<EmptySpace min="-2" pref="20" max="-2" attributes="0"/>
940940
<Component id="projectNameLabel_" min="-2" pref="100" max="-2" attributes="0"/>
941941
<EmptySpace type="separate" max="-2" attributes="0"/>
942-
<Component id="jTextField1" min="-2" pref="653" max="-2" attributes="0"/>
942+
<Component id="jTextField1" min="-2" pref="518" max="-2" attributes="0"/>
943+
<EmptySpace max="-2" attributes="0"/>
944+
<Component id="jButton6" max="32767" attributes="0"/>
943945
<EmptySpace max="-2" attributes="0"/>
944946
</Group>
945947
</Group>
@@ -951,6 +953,7 @@
951953
<Group type="103" groupAlignment="3" attributes="0">
952954
<Component id="projectNameLabel_" alignment="3" min="-2" max="-2" attributes="0"/>
953955
<Component id="jTextField1" alignment="3" min="-2" max="-2" attributes="0"/>
956+
<Component id="jButton6" alignment="3" min="-2" max="-2" attributes="0"/>
954957
</Group>
955958
<EmptySpace max="-2" attributes="0"/>
956959
</Group>
@@ -968,6 +971,14 @@
968971
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jTextField1ActionPerformed"/>
969972
</Events>
970973
</Component>
974+
<Component class="javax.swing.JButton" name="jButton6">
975+
<Properties>
976+
<Property name="text" type="java.lang.String" value="Sample data"/>
977+
</Properties>
978+
<Events>
979+
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton6ActionPerformed"/>
980+
</Events>
981+
</Component>
971982
</SubComponents>
972983
</Container>
973984
<Container class="javax.swing.JPanel" name="progressBarContainer">

quicksearchprot/src/main/java/no/uib/probe/quicksearchprot/gui/QSPROTGUI.java

Lines changed: 87 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@
88
import java.awt.event.WindowAdapter;
99
import java.awt.event.WindowEvent;
1010
import java.io.File;
11+
import java.net.URISyntaxException;
12+
import java.util.HashMap;
13+
import java.util.Map;
1114
import java.util.concurrent.Future;
15+
import java.util.logging.Level;
16+
import java.util.logging.Logger;
1217
import javax.swing.*;
1318
import javax.swing.event.ChangeEvent;
1419
import javax.swing.filechooser.FileNameExtensionFilter;
@@ -28,13 +33,17 @@
2833
public abstract class QSPROTGUI extends javax.swing.JFrame {
2934

3035
// Tracks the last used directory in file dialogs.
31-
private String lastSelectedDirectory = "/";// "/";
36+
private String lastSelectedDirectory = "";// "/";
37+
// The sample set directory .
38+
private String lsampleSetDirectory = "";// "/";
3239
// Holds user input parameters for processing.
3340
private final QSProtInputsEntity inputEntity = new QSProtInputsEntity();
3441
// Progress bar instance for feedback.
3542
private final ImageProgressBar updatedProgressBar;
3643
// Parameter selection panel
3744
private SelectParametersPanel selectPanel;
45+
//Sample data map
46+
private final Map<String, File> sampleDataMap = new HashMap();
3847

3948
/**
4049
* Constructs the main application GUI and initializes UI components.
@@ -48,14 +57,13 @@ public QSPROTGUI() {
4857
updatedProgressBar.setOpaque(true);
4958
progressBarContainer.add(updatedProgressBar);
5059

51-
jTextField1.setText("Test Dataset ");
52-
53-
// Pre-load component actions
54-
jButton1ActionPerformed(null);
55-
jButton2ActionPerformed(null);
56-
jButton3ActionPerformed(null);
57-
jButton4ActionPerformed(null);
58-
60+
// jTextField1.setText("Test Dataset ");
61+
// Pre-load component actions
62+
// jButton1ActionPerformed(null);
63+
// jButton2ActionPerformed(null);
64+
// jButton3ActionPerformed(null);
65+
// jButton4ActionPerformed(null);
66+
jButton6.setEnabled(testDataAvailable());
5967
setupUI();
6068

6169
// Demo button, overlay on frame (can be removed)
@@ -244,6 +252,7 @@ private void initComponents() {
244252
jPanel4 = new javax.swing.JPanel();
245253
projectNameLabel_ = new javax.swing.JLabel();
246254
jTextField1 = new javax.swing.JTextField();
255+
jButton6 = new javax.swing.JButton();
247256
progressBarContainer = new javax.swing.JPanel();
248257

249258
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
@@ -401,10 +410,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
401410
.addComponent(jButton4)
402411
.addComponent(outputFolderLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
403412
.addContainerGap())
404-
.addGroup(inputOutputPanelLayout.createSequentialGroup()
405-
.addGap(0, 0, 0)
406-
.addComponent(searchSettingsFileLabel)
407-
.addGap(0, 0, 0))
413+
.addComponent(searchSettingsFileLabel)
408414
);
409415

410416
inputOutputPanel1.setBackground(new java.awt.Color(255, 255, 255));
@@ -684,6 +690,13 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
684690
}
685691
});
686692

693+
jButton6.setText("Sample data");
694+
jButton6.addActionListener(new java.awt.event.ActionListener() {
695+
public void actionPerformed(java.awt.event.ActionEvent evt) {
696+
jButton6ActionPerformed(evt);
697+
}
698+
});
699+
687700
javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
688701
jPanel4.setLayout(jPanel4Layout);
689702
jPanel4Layout.setHorizontalGroup(
@@ -692,7 +705,9 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
692705
.addGap(20, 20, 20)
693706
.addComponent(projectNameLabel_, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
694707
.addGap(18, 18, 18)
695-
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 653, javax.swing.GroupLayout.PREFERRED_SIZE)
708+
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 518, javax.swing.GroupLayout.PREFERRED_SIZE)
709+
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
710+
.addComponent(jButton6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
696711
.addContainerGap())
697712
);
698713
jPanel4Layout.setVerticalGroup(
@@ -701,7 +716,8 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
701716
.addContainerGap()
702717
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
703718
.addComponent(projectNameLabel_, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
704-
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
719+
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
720+
.addComponent(jButton6))
705721
.addContainerGap())
706722
);
707723

@@ -739,9 +755,9 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
739755
.addComponent(inputOutputPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE)
740756
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
741757
.addComponent(jButton5, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
742-
.addComponent(inputOutputPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
758+
.addComponent(inputOutputPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 799, Short.MAX_VALUE)
743759
.addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
744-
.addComponent(progressBarContainer, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
760+
.addComponent(progressBarContainer, javax.swing.GroupLayout.PREFERRED_SIZE, 799, Short.MAX_VALUE)
745761
.addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
746762
.addGap(10, 10, 10))
747763
);
@@ -994,6 +1010,59 @@ private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-F
9941010
// TODO add your handling code here:
9951011
}//GEN-LAST:event_jTextField1ActionPerformed
9961012

1013+
private boolean testDataAvailable() {
1014+
1015+
try {
1016+
sampleDataMap.clear();
1017+
File jarFile = new File(QSPROTGUI.class.getProtectionDomain()
1018+
.getCodeSource()
1019+
.getLocation()
1020+
.toURI());
1021+
// Get the parent directory
1022+
File jarDir = jarFile.getParentFile();
1023+
File testSample = new File(jarDir.getAbsolutePath(), "testdata\\PXD028427");
1024+
if (testSample.exists()) {
1025+
lsampleSetDirectory = testSample.getAbsolutePath();
1026+
for (File f : testSample.listFiles()) {
1027+
String fileName = f.getName();
1028+
if (fileName.equalsIgnoreCase("qExactive01819.mgf")) {
1029+
sampleDataMap.put("MGF", f);
1030+
} else if (fileName.equalsIgnoreCase("PRIDE_Search.par")) {
1031+
sampleDataMap.put("PAR", f);
1032+
} else if (fileName.equalsIgnoreCase("uniprot-human-reviewed-trypsin-june-2021_concatenated_target_decoy.fasta")) {
1033+
sampleDataMap.put("FASTA", f);
1034+
}
1035+
1036+
}
1037+
}
1038+
File outputFolder = new File(testSample.getParent(), "output");
1039+
outputFolder.mkdir();
1040+
if (outputFolder.exists()) {
1041+
sampleDataMap.put("OUTPUT", outputFolder);
1042+
}
1043+
1044+
} catch (URISyntaxException ex) {
1045+
ex.printStackTrace();
1046+
}
1047+
return sampleDataMap.size() == 4;
1048+
}
1049+
private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed
1050+
jButton6.setEnabled(testDataAvailable());
1051+
if (jButton6.isEnabled()) {
1052+
jTextField1.setText("Sample dataset ");
1053+
searchSettingsParFileLabel.setText(" " + sampleDataMap.get("PAR").getName());
1054+
inputEntity.setSearchParameterFilePath(sampleDataMap.get("PAR").getAbsolutePath());
1055+
mgfFileLable.setText(" " + sampleDataMap.get("MGF").getName());
1056+
inputEntity.setInputSpectrumFilePath(sampleDataMap.get("MGF").getAbsolutePath());
1057+
fastaLabel.setText(" " + sampleDataMap.get("FASTA").getName());
1058+
inputEntity.setInputFastaFilePath(sampleDataMap.get("FASTA").getAbsolutePath());
1059+
outputFolderLabel.setText(" " + sampleDataMap.get("OUTPUT").getAbsolutePath());
1060+
inputEntity.setOutputFolderPath(sampleDataMap.get("OUTPUT").getAbsolutePath());
1061+
}
1062+
1063+
1064+
}//GEN-LAST:event_jButton6ActionPerformed
1065+
9971066
/**
9981067
* Validates user input fields, sets error highlighting/logs error messages.
9991068
*
@@ -1111,6 +1180,7 @@ public void setComponentEnabled(Component component, boolean enabled) {
11111180
private javax.swing.JButton jButton3;
11121181
private javax.swing.JButton jButton4;
11131182
private javax.swing.JButton jButton5;
1183+
private javax.swing.JButton jButton6;
11141184
private javax.swing.JCheckBox jCheckBox2;
11151185
private javax.swing.JCheckBox jCheckBox3;
11161186
private javax.swing.JCheckBox jCheckBox4;

quicksearchprot/src/main/java/no/uib/probe/quicksearchprot/handllers/CommonSearchHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ public String optimizeFragmentIonTypesParameter(
485485
resultsMap.put(option, scoreModel);
486486
}
487487
} catch (ExecutionException | InterruptedException ex) {
488-
ex.printStackTrace();
488+
// ex.printStackTrace();
489489
}
490490
}
491491
}

0 commit comments

Comments
 (0)