Skip to content

Commit

Permalink
DataSetFDR added
Browse files Browse the repository at this point in the history
tested
  • Loading branch information
cctsou committed Mar 16, 2016
1 parent 3d5472f commit da8f109
Show file tree
Hide file tree
Showing 6 changed files with 328 additions and 339 deletions.
2 changes: 1 addition & 1 deletion CrossLinker/nbproject/private/private.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ do.depend=false
do.jar=true
javac.debug=true
javadoc.preview=true
user.properties.file=C:\\Users\\Tsou\\AppData\\Roaming\\NetBeans\\8.1\\build.properties
user.properties.file=C:\\Users\\Cct\\AppData\\Roaming\\NetBeans\\8.1\\build.properties
10 changes: 5 additions & 5 deletions DIA-Umpire/src/MSUmpire/DIA/DIAPack.java
Original file line number Diff line number Diff line change
Expand Up @@ -641,27 +641,27 @@ public void SetPepXMLPath(){
public void ParsePepXML(DBSearchParam searchPara, LCMSID refID) throws ParserConfigurationException, SAXException, IOException, XmlPullParserException, ClassNotFoundException, InterruptedException {

SetPepXMLPath();
IDsummary = new LCMSID(FilenameUtils.getFullPath(Filename) + FilenameUtils.getBaseName(Filename),searchPara.DecoyPrefix,searchPara.FastaPath);
IDsummary = new LCMSID(FilenameUtils.getFullPath(Filename) + FilenameUtils.getBaseName(Filename), searchPara.DecoyPrefix, searchPara.FastaPath);
for (String pepxml : iProphPepXMLs) {
LCMSID pepxmlid = new LCMSID(FilenameUtils.getFullPath(Filename) + FilenameUtils.getBaseName(Filename),searchPara.DecoyPrefix,searchPara.FastaPath);
LCMSID pepxmlid = new LCMSID(FilenameUtils.getFullPath(Filename) + FilenameUtils.getBaseName(Filename), searchPara.DecoyPrefix, searchPara.FastaPath);
PepXMLParser pepxmlparser = new PepXMLParser(pepxmlid, pepxml, 0f);
if (refID == null) {
pepxmlid.FilterByPepDecoyFDR(searchPara.DecoyPrefix, searchPara.PepFDR);
}
Logger.getRootLogger().info("No. of peptide ions:" + pepxmlid.GetPepIonList().size() + "; Peptide level threshold: " + pepxmlid.PepProbThreshold);
for (PepIonID pepID : pepxmlid.GetPepIonList().values()) {
if (refID != null) {
if(refID.GetPepIonList().containsKey(pepID.GetKey())){
if (refID.GetPepIonList().containsKey(pepID.GetKey())) {
IDsummary.AddPeptideID(pepID);
}
}
} else {
IDsummary.AddPeptideID(pepID);
}
}
}
IDsummary.ReMapProPep();
Logger.getRootLogger().info("Total number of peptide ions:" + IDsummary.GetPepIonList().size());
CheckPSMRT();
CheckPSMRT();
if (MS1FeatureMap != null) {
this.MS1FeatureMap.IDsummary = IDsummary;
}
Expand Down
1 change: 0 additions & 1 deletion DIA-Umpire/src/MSUmpire/LCMSPeakStructure/LCMSPeakMS1.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import MSUmpire.PeptidePeakClusterDetection.PDHandlerMS1;
import MSUmpire.SearchResultParser.PepXMLParser;
import MSUmpire.SpectrumParser.SpectrumParserBase;
import MSUmpire.SpectrumParser.mzXMLParser;
import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.geom.Ellipse2D;
Expand Down
21 changes: 13 additions & 8 deletions DIA-Umpire/src/MSUmpire/MathPackage/ChiSquareGOF.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ public class ChiSquareGOF {
public static ChiSquared[] chimodels;
public static ReadWriteLock lock = new ReentrantReadWriteLock();

private ChiSquareGOF(int maxpeak) {
private ChiSquareGOF(int maxpeak) {
chimodels = new ChiSquared[maxpeak-1];
for (int i = 1; i <= maxpeak; i++) {
chimodels[i - 1] = new ChiSquared(i);
for (int i = 1; i < maxpeak; i++) {
chimodels[i-1] = new ChiSquared(i);
}
}

public static ChiSquareGOF GetInstance(int maxpeak) {
if (models == null || (maxpeak>1 && maxpeak >= chimodels.length)) {
if (models == null) {
lock.writeLock().lock();
try {
if (models == null) {
Expand All @@ -57,17 +57,22 @@ public static ChiSquareGOF GetInstance(int maxpeak) {
public float GetGoodNessOfFitProb(float[] expected, float[] observed) {
float gof = 0f;
int nopeaks = 0;
for (int i = 0; i < Math.min(observed.length,expected.length); i++) {
for (int i = 0; i < Math.min(observed.length, expected.length); i++) {
if (observed[i] > 0) {
float error = expected[i] - observed[i];
gof += (error * error) / (expected[i] * expected[i]);
nopeaks++;
}
}
if (Float.isNaN(gof) || nopeaks<2){
if (Float.isNaN(gof) || nopeaks < 2) {
return 0f;
}
float prob = 1 - (float) chimodels[nopeaks-2].cdf(gof);

if(chimodels[nopeaks-2]==null){
System.out.println("");
}

float prob = 1 - (float) chimodels[nopeaks - 2].cdf(gof);
return prob;
}
}
}
2 changes: 1 addition & 1 deletion DIA_Umpire_ProtQuant/nbproject/private/private.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ do.depend=false
do.jar=true
javac.debug=true
javadoc.preview=true
user.properties.file=C:\\Users\\Tsou\\AppData\\Roaming\\NetBeans\\8.1\\build.properties
user.properties.file=C:\\Users\\Cct\\AppData\\Roaming\\NetBeans\\8.1\\build.properties
Loading

0 comments on commit da8f109

Please sign in to comment.