Skip to content

Commit

Permalink
1. Supported TMT labelled peptides;
Browse files Browse the repository at this point in the history
2. Fixed issues: #74 and #71.
  • Loading branch information
wenbostar committed Apr 28, 2024
1 parent d01fb49 commit e1ddd03
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 16 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<groupId>PDV</groupId>
<artifactId>PDV</artifactId>
<packaging>jar</packaging>
<version>2.0.0</version>
<version>2.0.1-beta</version>
<name>PDV</name>
<url>https://github.com/wenbostar/PDV</url>
<description>An integrative proteomics viewer</description>
Expand Down
8 changes: 3 additions & 5 deletions src/main/java/PDVGUI/gui/utils/GetPredictedOnline.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
package PDVGUI.gui.utils;

import com.compomics.util.experiment.identification.spectrum_assumptions.PeptideAssumption;
import com.compomics.util.experiment.massspectrometry.Charge;
import com.compomics.util.experiment.massspectrometry.MSnSpectrum;
import com.compomics.util.experiment.massspectrometry.Peak;
import com.compomics.util.experiment.massspectrometry.Precursor;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
import org.json.JSONObject;
import org.kohsuke.rngom.util.Uri;

import java.io.BufferedReader;
import java.io.IOException;
Expand All @@ -17,7 +15,6 @@
import java.math.BigDecimal;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.ProtocolException;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
Expand Down Expand Up @@ -105,7 +102,7 @@ private void generateInputString(){
// TODO: C-term modification
if(index == 0){
// N-term modification
aa_list[0] = aa_list[0]+newMods.get(index);
aa_list[0] = newMods.get(index) + "-"+ aa_list[0];
}else{
aa_list[index-1] = aa_list[index-1]+newMods.get(index);
}
Expand Down Expand Up @@ -157,7 +154,8 @@ private void generateInputString(){
// " ] }] }";
// }
else if (model.equals("Prosit_2020_intensity_TMT")){
modPep = "[UNIMOD:737]-" + modPep;
// modPep = "[UNIMOD:737]-" + modPep;
// System.out.println(modPep);
inputString = "{ \"id\": \"0\", \"inputs\": [ { \"name\": \"peptide_sequences\", \"shape\": [ 1, 1 ], " +
"\"datatype\": \"BYTES\", \"data\": [ \"" + modPep + "\" ] }, { \"name\": \"precursor_charges\", " +
"\"shape\": [ 1, 1 ], \"datatype\": \"INT32\", \"data\": [ "+ precursorCharge + " ] }, { \"name\": " +
Expand Down
38 changes: 28 additions & 10 deletions src/main/java/PDVGUI/gui/utils/ImportPredictedDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
import javax.swing.*;
import javax.swing.table.DefaultTableModel;
import java.awt.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Objects;
Expand Down Expand Up @@ -256,6 +254,14 @@ private String getModificationString(String originalMod) {
if (Math.abs(ptmFactory.getPTM(originalMod).getMass() - 0.984016) < 0.01) {
modificationString = "[UNIMOD:7]";
}
} else if(originalMod.contains("of K")){
if (Math.abs(ptmFactory.getPTM(originalMod).getMass() - 229.162932) < 0.01) {
modificationString = "[UNIMOD:737]";
}
} else if(originalMod.contains("of N-term") || originalMod.contains("of peptide N-term")){
if (Math.abs(ptmFactory.getPTM(originalMod).getMass() - 229.162932) < 0.01) {
modificationString = "[UNIMOD:737]";
}
} else{
System.out.println("This modification is not supported:"+originalMod);
}
Expand All @@ -270,10 +276,18 @@ private String getModificationString(String originalMod) {
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) {
} else if (originalMod.contains("of M")) {
if (Math.abs(ptmFactory.getPTM(originalMod).getMass() - 15.994915) < 0.01) {
modificationString = "[UNIMOD:35]";
}
} else if(originalMod.contains("of K") && modelListComboBox.getSelectedIndex() == 6){
if (Math.abs(ptmFactory.getPTM(originalMod).getMass() - 229.162932) < 0.01) {
modificationString = "[UNIMOD:737]";
}
} else if((originalMod.contains("of N-term") || originalMod.contains("of peptide N-term")) && modelListComboBox.getSelectedIndex() == 6){
if (Math.abs(ptmFactory.getPTM(originalMod).getMass() - 229.162932) < 0.01) {
modificationString = "[UNIMOD:737]";
}
} else{
System.out.println("This modification is not supported:"+originalMod);
}
Expand All @@ -299,11 +313,11 @@ private void submissionButtonActionPerformed(java.awt.event.ActionEvent evt) {
newMods.put((int) modificationJTable.getValueAt(i, 1), mod);
}
}
if (modelListComboBox.getSelectedIndex() == 6) {
JOptionPane.showMessageDialog(
null, "This model will add a TMT tag to the N-term of the peptide.",
"Warning", JOptionPane.WARNING_MESSAGE);
}
//if (modelListComboBox.getSelectedIndex() == 6) {
// JOptionPane.showMessageDialog(
// null, "This model will add a TMT tag to the N-term of the peptide.",
// "Warning", JOptionPane.WARNING_MESSAGE);
//}

ProgressDialogX progressDialogX = new ProgressDialogX(spectrumMainPanel.parentFrame,
Toolkit.getDefaultToolkit().getImage(getClass().getResource("/icons/SeaGullMass.png")),
Expand Down Expand Up @@ -418,7 +432,11 @@ public Object getValueAt(int row, int column) {
case 0:
return modificationMatch.getTheoreticPtm();
case 1:
return modificationMatch.getModificationSite();
if(modificationMatch.getTheoreticPtm().contains("of N-term") || modificationMatch.getTheoreticPtm().contains("of peptide N-term")){
return 0;
}else{
return modificationMatch.getModificationSite();
}
case 2:
return getModificationString(modificationMatch.getTheoreticPtm());
case 3:
Expand Down

0 comments on commit e1ddd03

Please sign in to comment.