Skip to content

Commit

Permalink
Update to 1.1.7; Fix razor protein mapping bug
Browse files Browse the repository at this point in the history
Fix razor protein mapping bug
  • Loading branch information
KaiLiCn committed Feb 6, 2024
1 parent b6af509 commit b2c1d72
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<packaging>jar</packaging>
<groupId>org.example</groupId>
<artifactId>FP-PDV</artifactId>
<version>1.1.5</version>
<version>1.1.7</version>

<properties>
<maven.compiler.source>8</maven.compiler.source>
Expand Down
17 changes: 14 additions & 3 deletions src/main/java/GUI/GUIMainClass.java
Original file line number Diff line number Diff line change
Expand Up @@ -3768,7 +3768,7 @@ public void run() {
private void updateSpectrumFactoryFirst(ProgressDialogX progressDialog, String firstTitle) {
String spectrumFileName = firstTitle.split("\\.")[0];
String spectralFilePath = spectrumFileMap.get(spectrumFileName);

System.out.println(spectrumFileMap);
try {
if (Files.exists(new File(spectralFilePath).toPath())) {
readSpectrumFile(spectralFilePath);
Expand Down Expand Up @@ -3808,8 +3808,10 @@ private void readSpectrumFile(String spectralFilePath) throws IOException, Class
} else if (spectralFilePath.endsWith(".d")){
if (new File(spectralFilePath.replace(".d", "_uncalibrated.mzml")).exists()){
addOneMzML(spectrumName, spectralFilePath.replace(".d", "_uncalibrated.mzml"));
} else {
} else if (new File(spectralFilePath.replace(".d", "_calibrated.mzml")).exists()){
addOneMzML(spectrumName, spectralFilePath.replace(".d", "_calibrated.mzml"));
} else {
addOneMzML(spectrumName + "_centric", spectralFilePath.replace(".d", "_centric.mzML"));
}

} else if (spectralFilePath.toLowerCase().endsWith("mzml")){
Expand All @@ -3822,6 +3824,8 @@ private void readSpectrumFile(String spectralFilePath) throws IOException, Class
}

private void addOneMzML(String spectrumName, String spectralFilePath){
System.out.println(spectrumName);
System.out.println("Reading " + spectralFilePath);
MZMLFile mzmlFile = new MZMLFile(spectralFilePath);
mzmlFile.setNumThreadsForParsing(threadsNumber);
ScanCollectionDefault scans = new ScanCollectionDefault();
Expand Down Expand Up @@ -3878,9 +3882,16 @@ public void displayResults(ProgressDialogX progressDialog) throws SQLException {
updateAllProteinIndexes(sqliteConnection.getProteinList(expAllSelections));

String initProtein = allProteinIndex.get(selectedProteinPageNum - 1).get(0);
if (sqliteConnection.getSpectrumListOneProtein(initProtein)[0].size() == 0){
for (String newProtein : allProteinIndex.get(selectedProteinPageNum - 1)){
if (sqliteConnection.getSpectrumListOneProtein(newProtein)[0].size() != 0){
initProtein = newProtein;
break;
}
}
}

updateSpectrumFactoryFirst(progressDialog, sqliteConnection.getSpectrumOldTitle(sqliteConnection.getSpectrumListOneProtein(initProtein)[0].get(0)));
//System.out.println(initProtein);
updateAllPSMIndexes(sqliteConnection.getSpectrumListOneProtein(initProtein));
proteinCurrentSelections.add(initProtein);

Expand Down
6 changes: 6 additions & 0 deletions src/main/java/GUI/utils/ImportData.java
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,9 @@ private void processManifestFile(File mainFestFile) throws IOException {
}
}
}
}else {
String[] fileArr = lineSplit[0].split(pattern);
spectrumFileMap.put(fileArr[fileArr.length-1].split("\\.d")[0]+"_centric", lineSplit[0]);
}
}

Expand All @@ -384,6 +387,9 @@ private void processManifestFile(File mainFestFile) throws IOException {
}
}
}
}else {
String[] fileArr = lineSplit[0].split(pattern);
spectrumFileMap.put(fileArr[fileArr.length-1].split("\\.d")[0]+"_centric", lineSplit[0]);
}
}
}
Expand Down

0 comments on commit b2c1d72

Please sign in to comment.