Skip to content

Commit

Permalink
linker parameter added (CXL)
Browse files Browse the repository at this point in the history
  • Loading branch information
cctsou committed Apr 25, 2016
1 parent ab55ba5 commit 5ce923d
Show file tree
Hide file tree
Showing 11 changed files with 79 additions and 42 deletions.
13 changes: 12 additions & 1 deletion CrossLinker/nbproject/private/private.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,17 @@
<file>file:/C:/Umich/GitHub/DIA-Umpire/CrossLinker/src/CXL_PeakPairFinder/PeakPairFinder.java</file>
<file>file:/C:/Umich/GitHub/DIA-Umpire/CrossLinker/src/CXL_PeakPairFinder/PrecursorCrossPepFinder.java</file>
</group>
<group name="DIA-Umpire_Release"/>
<group name="DIA-Umpire_Release">
<file>file:/C:/Users/Cct/Documents/GitHub/DIA-Umpire/CrossLinker/src/crosslinker/Linker.java</file>
<file>file:/C:/Users/Cct/Documents/GitHub/DIA-Umpire/CrossLinker/src/Exec/CrossLinkerDetection.java</file>
<file>file:/C:/Users/Cct/Documents/GitHub/DIA-Umpire/CrossLinker/src/crosslinker/FragmentPair.java</file>
<file>file:/C:/Users/Cct/Documents/GitHub/DIA-Umpire/CrossLinker/src/CXL_PeakPairFinder/PrecursorCrossPepFinder.java</file>
<file>file:/C:/Users/Cct/Documents/GitHub/DIA-Umpire/CrossLinker/src/CXL_PeakPairFinder/MS2PeakPairFinder.java</file>
<file>file:/C:/Users/Cct/Documents/GitHub/DIA-Umpire/CrossLinker/src/CXL_PeakPairFinder/PeakPairFinder.java</file>
<file>file:/C:/Users/Cct/Documents/GitHub/DIA-Umpire/CrossLinker/src/crosslinker/CrossLinkerHandler.java</file>
<file>file:/C:/Users/Cct/Documents/GitHub/DIA-Umpire/CrossLinker/src/CXL_PeakPairFinder/CrosslinkerPepFinder.java</file>
<file>file:/C:/Users/Cct/Documents/GitHub/DIA-Umpire/CrossLinker/src/CXL_PeakPairFinder/CXL_MALDI.java</file>
<file>file:/C:/Users/Cct/Documents/GitHub/DIA-Umpire/CrossLinker/src/crosslinker/CrossLinkerScanResult.java</file>
</group>
</open-files>
</project-private>
4 changes: 3 additions & 1 deletion CrossLinker/src/CXL_PeakPairFinder/CXL_MALDI.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import MSUmpire.PeptidePeakClusterDetection.PDHandlerMS1;
import MSUmpire.SpectrumParser.MALDIDataParser;
import MSUmpire.Utility.ConsoleLogger;
import crosslinker.Linker;
import java.io.FileWriter;
import java.io.IOException;;
import java.util.ArrayList;
Expand All @@ -37,6 +38,7 @@ public static void main(String[] args) throws IOException, InterruptedException,
int NoCPUs=10;
InstrumentParameter parameter=null;
LCMSPeakBase lCMSPeakBase = null;
Linker linker=new Linker();
parameter = new InstrumentParameter(InstrumentParameter.InstrumentType.MALDI);
MALDIDataParser parser = new MALDIDataParser(FilePath);
parser.cycletime = 120f / 576f;
Expand Down Expand Up @@ -67,7 +69,7 @@ public static void main(String[] args) throws IOException, InterruptedException,
//detection.DetectSingleMZTraces(scans);
//lCMSPeakBase.ExportPeakCurveResult();

CrosslinkerPepFinder finder = new CrosslinkerPepFinder(lCMSPeakBase,0f);
CrosslinkerPepFinder finder = new CrosslinkerPepFinder(lCMSPeakBase,0f,linker);
lCMSPeakBase.parameter.MS1PPM=200;
lCMSPeakBase.parameter.RTtol=1f;
finder.FindAllPairPeaks(NoCPUs);
Expand Down
12 changes: 7 additions & 5 deletions CrossLinker/src/CXL_PeakPairFinder/CrosslinkerPepFinder.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
*/
package CXL_PeakPairFinder;

import MSUmpire.BaseDataStructure.InstrumentParameter;
import MSUmpire.BaseDataStructure.XYData;
import MSUmpire.LCMSPeakStructure.LCMSPeakBase;
import MSUmpire.PeakDataStructure.PeakCluster;
import MSUmpire.SpectralProcessingModule.ScanPeakGroup;
import crosslinker.Linker;
import java.util.ArrayList;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
Expand All @@ -27,9 +27,11 @@ public class CrosslinkerPepFinder {
public ArrayList<PrecursorCrossPepFinder> IntactPepList;
public ArrayList<MS2PeakPairFinder> IntactPepListMS2;
public float medianIntensity=-1f;
public CrosslinkerPepFinder(LCMSPeakBase LCMSPeakBase,float medianIntensity) {
Linker linker;
public CrosslinkerPepFinder(LCMSPeakBase LCMSPeakBase,float medianIntensity, Linker linker) {
this.LCMSPeakBase = LCMSPeakBase;
this.medianIntensity=medianIntensity;
this.linker=linker;
}

public void FindPairPeakMS2(ArrayList<ScanPeakGroup> MS2PeakGroups, int NoCPUs) {
Expand All @@ -41,7 +43,7 @@ public void FindPairPeakMS2(ArrayList<ScanPeakGroup> MS2PeakGroups, int NoCPUs)
IntactPepListMS2 = new ArrayList<>();
//For each scan
for (ScanPeakGroup scan : MS2PeakGroups) {
MS2PeakPairFinder finder = new MS2PeakPairFinder(scan, LCMSPeakBase.parameter);
MS2PeakPairFinder finder = new MS2PeakPairFinder(scan, LCMSPeakBase.parameter, linker);
executorPool.execute(finder);
//finder.run();
IntactPepListMS2.add(finder);
Expand Down Expand Up @@ -71,7 +73,7 @@ public void FindAllPairPeaks(int NoCPUs) {
for (int i = 0; i < LCMSPeakBase.PeakClusters.size(); i++) {
PeakCluster peakCluster = LCMSPeakBase.PeakClusters.get(i);
if (peakCluster.NeutralMass() >= mzRange.getX() && peakCluster.NeutralMass() <= mzRange.getY()) {
PeakPairFinder unit = new PeakPairFinder(peakCluster, LCMSPeakBase.GetPeakClusterMassSearchTree(), LCMSPeakBase.parameter);
PeakPairFinder unit = new PeakPairFinder(peakCluster, LCMSPeakBase.GetPeakClusterMassSearchTree(), LCMSPeakBase.parameter, linker);
templist.add(unit);
executorPool.execute(unit);
}
Expand Down Expand Up @@ -102,7 +104,7 @@ public void FindAllPairPeaks(int NoCPUs) {
//For any two peak pairs, check if they co-elute together (RT diff < RTtol)
if (lowmass.lowMassPeak.NeutralMass()<=highmass.lowMassPeak.NeutralMass()
&& Math.abs(lowmass.lowMassPeak.PeakHeightRT[0] - highmass.lowMassPeak.PeakHeightRT[0]) < LCMSPeakBase.parameter.RTtol) {
PrecursorCrossPepFinder intactLinkedPep = new PrecursorCrossPepFinder(lowmass, highmass, LCMSPeakBase.GetPeakClusterMassSearchTree(), LCMSPeakBase.parameter);
PrecursorCrossPepFinder intactLinkedPep = new PrecursorCrossPepFinder(lowmass, highmass, LCMSPeakBase.GetPeakClusterMassSearchTree(), LCMSPeakBase.parameter, linker);
IntactPepList.add(intactLinkedPep);
executorPool.execute(intactLinkedPep);
}
Expand Down
12 changes: 7 additions & 5 deletions CrossLinker/src/CXL_PeakPairFinder/MS2PeakPairFinder.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import MSUmpire.BaseDataStructure.InstrumentParameter;
import MSUmpire.SpectralProcessingModule.IsotopePeakGroup;
import MSUmpire.SpectralProcessingModule.ScanPeakGroup;
import crosslinker.DC4;
import crosslinker.Linker;
import java.util.ArrayList;
import net.sf.javaml.core.kdtree.KDTree;
import net.sf.javaml.core.kdtree.KeyDuplicateException;
Expand All @@ -37,6 +37,7 @@ public class MS2PeakPairFinder implements Runnable {

public ScanPeakGroup ScanPeak;
InstrumentParameter parameter;
Linker linker;
private KDTree PeakClusterKDTree;
public ArrayList<PairGroupMS2> PeakPairGroupList;
public ArrayList<PeakPair> peakPairs = new ArrayList<>();
Expand Down Expand Up @@ -77,9 +78,10 @@ private IsotopePeakGroup FindTargetMWPeak(IsotopePeakGroup peakCluster, float ta
return BestPeak;
}

public MS2PeakPairFinder(ScanPeakGroup ScanPeak, InstrumentParameter parameter) {
public MS2PeakPairFinder(ScanPeakGroup ScanPeak, InstrumentParameter parameter, Linker linker) {
this.ScanPeak = ScanPeak;
this.parameter = parameter;
this.linker=linker;
}


Expand All @@ -106,9 +108,9 @@ public void run() {
IsotopePeakGroup PeakCluster = ScanPeak.peakGroupList.get(i);
PairGroupMS2 Pairgroup = new PairGroupMS2(PeakCluster);
//Calculate MW of peak pair
float pairmw = PeakCluster.NeutralMass() + DC4.DABCO;
float pairmw = PeakCluster.NeutralMass() + linker.Core;
Pairgroup.HighMassPeak = FindTargetMWPeak(PeakCluster,pairmw);
float DeadEndpairMW = PeakCluster.NeutralMass() + DC4.DABCO + DC4.H2O + DC4.Arm;
float DeadEndpairMW = PeakCluster.NeutralMass() + linker.Core + linker.H2O + linker.Arm;
Pairgroup.DeadEndpairs = FindTargetMWPeak(PeakCluster,DeadEndpairMW);
PeakPairGroupList.add(Pairgroup);
}
Expand All @@ -121,7 +123,7 @@ public void run() {
PairGroupMS2 highmass = PeakPairGroupList.get(j);
if (lowmass.LowMassPeak.NeutralMass() <= highmass.LowMassPeak.NeutralMass()) {

float IntactMW = lowmass.LowMassPeak.NeutralMass() + highmass.LowMassPeak.NeutralMass() + DC4.DABCO;
float IntactMW = lowmass.LowMassPeak.NeutralMass() + highmass.LowMassPeak.NeutralMass() + linker.Core;

//Check if the precursor mass value of the MS2 spectrum is the summation of MW values of low and high peak pairs
//If yes, then the two peak pairs are potentially crosslinking peptides
Expand Down
12 changes: 7 additions & 5 deletions CrossLinker/src/CXL_PeakPairFinder/PeakPairFinder.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import MSUmpire.BaseDataStructure.InstrumentParameter;
import MSUmpire.PeakDataStructure.PeakCluster;
import MSUmpire.PeptidePeakClusterDetection.PeakCurveCorrCalc;
import crosslinker.DC4;
import crosslinker.Linker;
import java.io.IOException;
import java.util.HashMap;
import net.sf.javaml.core.kdtree.KDTree;
Expand All @@ -37,15 +37,17 @@ public class PeakPairFinder implements Runnable {

private PeakCluster TargetPeak;
InstrumentParameter parameter;
Linker linker;
private final KDTree PeakClusterKDTree;
float lowrt = 0f;
float highrt = 0f;
public PairGroup pairgroup;

public PeakPairFinder(PeakCluster peakClusterA, KDTree PeakClusterKDTree, InstrumentParameter parameter) {
public PeakPairFinder(PeakCluster peakClusterA, KDTree PeakClusterKDTree, InstrumentParameter parameter, Linker linker) {
this.TargetPeak = peakClusterA;
this.PeakClusterKDTree = PeakClusterKDTree;
this.parameter = parameter;
this.linker=linker;
lowrt = peakClusterA.PeakHeightRT[0] - parameter.RTtol;
if (lowrt < 0) {
lowrt = 0f;
Expand All @@ -55,13 +57,13 @@ public PeakPairFinder(PeakCluster peakClusterA, KDTree PeakClusterKDTree, Instru

@Override
public void run() {
//linked pair : x + DC4.DABCO
//linked pair : x + Linker.Core
pairgroup=new PairGroup(TargetPeak);

//calculate MW of peak pair
float pairmw= TargetPeak.NeutralMass()+DC4.DABCO;
float pairmw= TargetPeak.NeutralMass()+linker.Core;
pairgroup.highMassPeak=FindTargetMWPeak(pairmw);
float DeadEndpairMW = TargetPeak.NeutralMass()+ DC4.DABCO + DC4.H2O + DC4.Arm;
float DeadEndpairMW = TargetPeak.NeutralMass()+ linker.Core + linker.H2O + linker.Arm;
pairgroup.DeadEndpairs=FindTargetMWPeak(DeadEndpairMW);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import MSUmpire.BaseDataStructure.InstrumentParameter;
import MSUmpire.PeakDataStructure.PeakCluster;
import MSUmpire.PeptidePeakClusterDetection.PeakCurveCorrCalc;
import crosslinker.DC4;
import crosslinker.Linker;
import java.io.IOException;
import java.util.HashMap;
import net.sf.javaml.core.kdtree.KDTree;
Expand All @@ -29,17 +29,19 @@ public class PrecursorCrossPepFinder implements Runnable{
public float MaxHighMassPeakCorr=0f;
public float LowHighPeakCorr=0f;
private float PrecCorssPeakPPM=1000f;
Linker linker;
private InstrumentParameter parameter;
float lowrt = 0f;
float highrt = 0f;
private final KDTree PeakClusterSearchTree;
private CoElutePeak BestPrecursorPeak=null;

public PrecursorCrossPepFinder(PairGroup LowMassPeak, PairGroup HighMassPeak, KDTree PeakClusterSearchTree, InstrumentParameter parameter){
public PrecursorCrossPepFinder(PairGroup LowMassPeak, PairGroup HighMassPeak, KDTree PeakClusterSearchTree, InstrumentParameter parameter, Linker linker){
this.LowMassPeakGroup=LowMassPeak;
this.HighMassPeakGroup=HighMassPeak;
this.PeakClusterSearchTree=PeakClusterSearchTree;
this.parameter=parameter;
this.linker=linker;
try {
LowHighPeakCorr = PeakCurveCorrCalc.CalPeakCorr(LowMassPeak.lowMassPeak.MonoIsotopePeak, HighMassPeak.lowMassPeak.MonoIsotopePeak, parameter.NoPeakPerMin);
if (Float.isNaN(LowHighPeakCorr)) {
Expand All @@ -53,7 +55,7 @@ public PrecursorCrossPepFinder(PairGroup LowMassPeak, PairGroup HighMassPeak, KD
highrt = Math.min(LowMassPeak.lowMassPeak.PeakHeightRT[0],HighMassPeak.lowMassPeak.PeakHeightRT[0]) + parameter.RTtol;
}
public void FindPrecursorCrossPeak(){
float IntactMW = LowMassPeakGroup.lowMassPeak.NeutralMass()+HighMassPeakGroup.lowMassPeak.NeutralMass()+DC4.DABCO;
float IntactMW = LowMassPeakGroup.lowMassPeak.NeutralMass()+HighMassPeakGroup.lowMassPeak.NeutralMass()+linker.Core;

float lowMW = InstrumentParameter.GetMzByPPM(IntactMW, 1, parameter.MS1PPM);
float highMW = InstrumentParameter.GetMzByPPM(IntactMW, 1, -parameter.MS1PPM);
Expand Down
12 changes: 11 additions & 1 deletion CrossLinker/src/Exec/CrossLinkerDetection.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import MSUmpire.SpectralProcessingModule.ScanIsotopePeakDetectionThread;
import MSUmpire.SpectralProcessingModule.ScanPeakGroup;
import MSUmpire.Utility.ConsoleLogger;
import crosslinker.Linker;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
Expand Down Expand Up @@ -63,6 +64,7 @@ public static void main(String[] args) throws IOException, InterruptedException,
Logger logger = Logger.getRootLogger();

InstrumentParameter parameter = null;
Linker linker=new Linker();
parameter = new InstrumentParameter(InstrumentParameter.InstrumentType.Orbitrap);
parameter.MS1PPM = 20;
parameter.MS2PPM = 600f;
Expand Down Expand Up @@ -256,6 +258,14 @@ public static void main(String[] args) throws IOException, InterruptedException,
parameter.MS2Pairing = Boolean.parseBoolean(value);
break;
}
case "CXL.CoreMass":{
linker.Core=Float.parseFloat(value);
break;
}
case "CXL.ArmMass":{
linker.Arm=Float.parseFloat(value);
break;
}

//</editor-fold>//</editor-fold>
}
Expand Down Expand Up @@ -329,7 +339,7 @@ public static void main(String[] args) throws IOException, InterruptedException,
}

//Initialize crosslinker peak pair finder
CrosslinkerPepFinder finder = new CrosslinkerPepFinder(lCMSPeakBase, medianIntensity);
CrosslinkerPepFinder finder = new CrosslinkerPepFinder(lCMSPeakBase, medianIntensity, linker);

//Find all peak pairs
finder.FindAllPairPeaks(NoCPUs);
Expand Down
4 changes: 4 additions & 0 deletions CrossLinker/src/Exec/cxl.params
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,7 @@ SE.MassDefectFilter=true
SE.DetectSameChargePairOnly=true
SE.MS2Pairing=true
SE.MS2PairTopN=5

#CXL linker
CXL.CoreMass = 112.0995
CXL.ArmMass = 68
5 changes: 3 additions & 2 deletions CrossLinker/src/crosslinker/CrossLinkerHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public class CrossLinkerHandler {

public HashMap<String, MALDI_Spot> ResultMap = new HashMap<>();
public ArrayList<CrossLinkerPep> CrossLinkingPeps = new ArrayList<>();
public Linker linker;

private void ReadFile(File folder) throws IOException {
File[] listOfFiles = folder.listFiles();
Expand All @@ -40,15 +41,15 @@ private void ReadFile(File folder) throws IOException {
Scan.MsLevel = 2;
Scan.MGFTitle = Scan.MGFTitle.split("_")[Scan.MGFTitle.split("_").length - 2];
Scan.Normalization();
CrossLinkerScanResult scanresult = new CrossLinkerScanResult(Scan);
CrossLinkerScanResult scanresult = new CrossLinkerScanResult(Scan,linker);
Results.add(scanresult);
}
} else if (files.toLowerCase().endsWith(".pkl")) {
PKLScanParser pkl = new PKLScanParser(folder + "/" + files);
pkl.scan.MsLevel = 1;
pkl.scan.MGFTitle = pkl.scan.MGFTitle.split("_")[pkl.scan.MGFTitle.split("_").length - 2];
pkl.scan.Normalization();
CrossLinkerScanResult scanresult = new CrossLinkerScanResult(pkl.scan);
CrossLinkerScanResult scanresult = new CrossLinkerScanResult(pkl.scan,linker);
Results.add(scanresult);
}
} else {
Expand Down
Loading

0 comments on commit 5ce923d

Please sign in to comment.