Skip to content

Commit

Permalink
Fixed issues:#70, #72
Browse files Browse the repository at this point in the history
  • Loading branch information
wenbostar committed Apr 1, 2024
1 parent 5ca7e90 commit d01fb49
Showing 1 changed file with 42 additions and 4 deletions.
46 changes: 42 additions & 4 deletions src/main/java/PDVGUI/gui/utils/ImportPredictedDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -221,23 +221,61 @@ private String getModificationString(String originalMod) {
String modificationString = "";

if (modelListComboBox.getSelectedIndex() == 0 || modelListComboBox.getSelectedIndex() == 7) {
// AlphaPept_ms2_generic model
if (originalMod.contains("of C")){
if (Math.abs(ptmFactory.getPTM(originalMod).getMass() -57.021464) < 0.01) {
modificationString = "[UNIMOD:4]";
}else{
System.out.println("This modification is not supported:"+originalMod);
}
}
if (originalMod.contains("of M")){
} else if (originalMod.contains("of M")){
if (Math.abs(ptmFactory.getPTM(originalMod).getMass() -15.994915) < 0.01) {
modificationString = "[UNIMOD:35]";
}else{
System.out.println("This modification is not supported:"+originalMod);
}
} if (originalMod.contains("of S") || originalMod.contains("of T") || originalMod.contains("of Y") || originalMod.contains("of STY")) {
} else if (originalMod.contains("of S") || originalMod.contains("of T") || originalMod.contains("of Y") || originalMod.contains("of STY")) {
if (Math.abs(ptmFactory.getPTM(originalMod).getMass() -79.966331) < 0.01) {
modificationString = "[UNIMOD:21]";
}else{
System.out.println("This modification is not supported:"+originalMod);
}
} if (originalMod.contains("of N-term")) {
} else if (originalMod.contains("of N-term")) {
if (Math.abs(ptmFactory.getPTM(originalMod).getMass() - 42.010565) < 0.01) {
modificationString = "[UNIMOD:1]";
}else if (Math.abs(ptmFactory.getPTM(originalMod).getMass() - 43.005814) < 0.01) {
modificationString = "[UNIMOD:5]";
}else{
System.out.println("This modification is not supported:"+originalMod);
}
} else if (originalMod.contains("of Q")) {
if (Math.abs(ptmFactory.getPTM(originalMod).getMass() - 0.984016) < 0.01) {
modificationString = "[UNIMOD:7]";
}
} else if (originalMod.contains("of N")) {
if (Math.abs(ptmFactory.getPTM(originalMod).getMass() - 0.984016) < 0.01) {
modificationString = "[UNIMOD:7]";
}
} else{
System.out.println("This modification is not supported:"+originalMod);
}
} else if (modelListComboBox.getSelectedIndex() == 1 ||
modelListComboBox.getSelectedIndex() == 2 ||
modelListComboBox.getSelectedIndex() == 3 ||
modelListComboBox.getSelectedIndex() == 4 ||
modelListComboBox.getSelectedIndex() == 5 ||
modelListComboBox.getSelectedIndex() == 6) {
// Prosit model
if (originalMod.contains("of C")){
if (Math.abs(ptmFactory.getPTM(originalMod).getMass() -57.021464) < 0.01) {
modificationString = "[UNIMOD:4]";
}
} else if (originalMod.contains("of M")){
if (Math.abs(ptmFactory.getPTM(originalMod).getMass() -15.994915) < 0.01) {
modificationString = "[UNIMOD:35]";
}
} else{
System.out.println("This modification is not supported:"+originalMod);
}

}
Expand Down

0 comments on commit d01fb49

Please sign in to comment.