Skip to content

Commit

Permalink
Version 1.3.34
Browse files Browse the repository at this point in the history
* support for local FDR (PEP)
* will read in and try to boost on delta score and peptide coverage
* searches can be normalized by a version of an interpolated PSM-FDR
** mainly useful for combining searches that have different score-ranges
* using fastutil to reduce some memory requirements
* support for directional crosslinker has been (partially) removed
* bugfix for automatic recognition of column-names fro command-line version
* new output column iFDR for interpolated global FDR
  • Loading branch information
Lutz Fischer committed Sep 3, 2019
1 parent 048bdf9 commit e3640b6
Show file tree
Hide file tree
Showing 47 changed files with 3,096 additions and 2,891 deletions.
6 changes: 3 additions & 3 deletions nbactions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<goal>org.codehaus.mojo:exec-maven-plugin:1.2.1:exec</goal>
</goals>
<properties>
<exec.args>-Xmx11g -XX:+HeapDumpOnOutOfMemoryError -classpath %classpath org.rappsilber.fdr.gui.FDRGUI</exec.args>
<exec.args>-Xmx3g -XX:+HeapDumpOnOutOfMemoryError -classpath %classpath org.rappsilber.fdr.CommandLine</exec.args>
<exec.executable>java</exec.executable>
<exec.workingdir>/home/lfischer</exec.workingdir>
</properties>
Expand All @@ -25,7 +25,7 @@
<goal>org.codehaus.mojo:exec-maven-plugin:1.2.1:exec</goal>
</goals>
<properties>
<exec.args>-Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address} -Xmx11g -XX:+HeapDumpOnOutOfMemoryError -classpath %classpath org.rappsilber.fdr.gui.FDRGUI</exec.args>
<exec.args>-agentlib:jdwp=transport=dt_socket,server=n,address=${jpda.address} -Xmx3g -XX:+HeapDumpOnOutOfMemoryError -classpath %classpath org.rappsilber.fdr.CommandLine</exec.args>
<exec.executable>java</exec.executable>
<jpda.listen>true</jpda.listen>
<exec.workingdir>/home/lfischer</exec.workingdir>
Expand All @@ -41,7 +41,7 @@
<goal>org.codehaus.mojo:exec-maven-plugin:1.2.1:exec</goal>
</goals>
<properties>
<exec.args>-Xmx11g -XX:+HeapDumpOnOutOfMemoryError -classpath %classpath org.rappsilber.fdr.gui.FDRGUI</exec.args>
<exec.args>-Xmx3g -XX:+HeapDumpOnOutOfMemoryError -classpath %classpath org.rappsilber.fdr.CommandLine</exec.args>
<exec.executable>java</exec.executable>
<exec.workingdir>/home/lfischer</exec.workingdir>
</properties>
Expand Down
11 changes: 8 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.rappsilberlab</groupId>
<artifactId>xiFDR</artifactId>
<version>1.2.34</version>
<version>1.3.34</version>
<packaging>jar</packaging>
<dependencies>
<dependency>
Expand Down Expand Up @@ -98,6 +98,11 @@
<artifactId>woodstox-core</artifactId>
<version>6.0.0.pr2</version>
</dependency>
<dependency>
<groupId>it.unimi.dsi</groupId>
<artifactId>fastutil</artifactId>
<version>7.2.1</version>
</dependency>
</dependencies>
<build>
<plugins>
Expand All @@ -106,7 +111,7 @@
<configuration>
<archive>
<manifest>
<mainClass>org.rappsilber.fdr.gui.FDRGUI</mainClass>
<mainClass>org.rappsilber.fdr.CommandLine</mainClass>
</manifest>
</archive>
<descriptorRefs>
Expand Down Expand Up @@ -140,5 +145,5 @@
</properties>
<description>Application for FDR estimation cross-linking massspectrometry data
</description>
<name>xiFDR-1.2.34</name>
<name>xiFDR-1.3.34</name>
</project>
491 changes: 268 additions & 223 deletions src/main/java/org/rappsilber/fdr/CSVinFDR.java

Large diffs are not rendered by default.

62 changes: 62 additions & 0 deletions src/main/java/org/rappsilber/fdr/CommandLine.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*
* Copyright 2019 Lutz Fischer <[email protected]>.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.rappsilber.fdr;

import java.io.FileNotFoundException;
import java.sql.SQLException;
import org.rappsilber.fdr.gui.FDRGUI;

/**
* Proxy class that looks at the given arguments and then forwards the whole
* command-line to the appropriate class.
* @author Lutz Fischer <[email protected]>
*/
public class CommandLine {

public static void main(String args[]) throws SQLException, FileNotFoundException {
boolean xicsv = false;
boolean csv = false;
boolean gui = true;
boolean db = false;
for (String a : args) {
gui = false;
if (a.startsWith("--xiconfig=")) {
xicsv=true;
} else if (a.startsWith("--dbids=")) {
db = true;
} else if (!a.startsWith("-")) {
csv = true;
}
}
if (db && !csv) {
DBinFDR.main(args);
return;
}
if (xicsv && !db) {
XiCSVinFDR.main(args);
return;
}
if (csv && (!db) && (!xicsv)) {
CSVinFDR.main(args);
return;
}
if (gui) {
FDRGUI.main(args);
return;
}
new XiCSVinFDR().printUsage();
}
}
60 changes: 47 additions & 13 deletions src/main/java/org/rappsilber/fdr/DBinFDR.java
Original file line number Diff line number Diff line change
Expand Up @@ -663,14 +663,18 @@ class psminfo {
if (m_search_ids.contains(searchId)) {
continue;
}
String sPepCoverage1 = "peptide1 unique matched non lossy coverage";
String sPepCoverage2 = "peptide2 unique matched non lossy coverage";
int cPepCoverage1 = -1;
int cPepCoverage2 = -1;

ArrayList<String> scorenames = new ArrayList<>();
if (xi3db) {
// retrive the subscore names
String scoreNameQuerry =
"SELECT scorenames FROM search WHERE id = " + searchId +";";
Statement stm = getDBConnection().createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
stm.setFetchSize(100);
stm.setFetchSize(500);
ResultSet rs = stm.executeQuery(scoreNameQuerry);
if (rs.next()) {
java.sql.Array sn = rs.getArray(1);
Expand All @@ -681,6 +685,8 @@ class psminfo {
}
}
}
cPepCoverage1 = scorenames.indexOf(sPepCoverage1);
cPepCoverage2 = scorenames.indexOf(sPepCoverage2);
}


Expand Down Expand Up @@ -747,6 +753,7 @@ class psminfo {
+ " , " + (xi3db ? " scorecleavclpep1fragmatched AS cleavclpep1fragmatched\n" : " 0 AS cleavclpep1fragmatched\n")
+ " , " + (xi3db ? " scorecleavclpep2fragmatched AS cleavclpep2fragmatched\n" : " 0 AS cleavclpep2fragmatched\n")
+ " , " + (xi3db ? " scores AS subscores\n" : " null AS subscores\n")
+ " , " + (xi3db ? " scoredelta AS delta\n" : " score AS delta\n")
+ " , s.precursor_intensity\n"
+ " , s.elution_time_start as retentiontime\n"
+ " \n"
Expand Down Expand Up @@ -856,8 +863,10 @@ class psminfo {
int precIntensityColumn = rs.findColumn("precursor_intensity");
int retentiontimeColumn = rs.findColumn("retentiontime");
int clMassColumn = rs.findColumn("clmass");
int clDeltaColumn = rs.findColumn("delta");
Pattern modDetect = Pattern.compile(".*[^A-Z].*");
HashSet<Double> tmmodcount = new HashSet<>();
HashMap<Double,Double> xlmodmasses = new HashMap<Double,Double>(1);

int total = 0;
try {
Expand Down Expand Up @@ -965,21 +974,46 @@ class psminfo {
// if (subscores != null) {
// Float[] scoresf = (Float[])subscores.getArray();
// for (int i =0; i<scorenames.size(); i++) {
// psm.getOtherInfo().put(scorenames.get(i),scoresf[i]);
// psm.addOtherInfo(scorenames.get(i),scoresf[i]);
// }
// }
psm.getOtherInfo().put("scoreP1Coverage",p1c);
psm.getOtherInfo().put("scoreP2Coverage",p2c);
psm.getOtherInfo().put("cleavclpep1fragmatched",cleavclpep1fragmatched ? 1:0);
psm.getOtherInfo().put("cleavclpep2fragmatched",cleavclpep2fragmatched ? 1:0);
psm.getOtherInfo().put("cleavclpepfragmatched",(cleavclpep2fragmatched ? 1:0) + (cleavclpep1fragmatched ? 1:0));
psm.getOtherInfo().put("deltaScore",rs.getDouble(deltaScoreColumn));
psm.getOtherInfo().put("ScoreDivDelta",rs.getDouble(scoreColumn)/rs.getDouble(deltaScoreColumn));
psm.getOtherInfo().put("linkSiteDelta",rs.getDouble(LinkSiteDeltaColumn));
psm.getOtherInfo().put("mgxrank",rs.getDouble(mgxrankColumn));
psm.getOtherInfo().put("PrecursorIntensity",rs.getDouble(precIntensityColumn));
psm.getOtherInfo().put("RetentionTime",rs.getDouble(retentiontimeColumn));
if (cPepCoverage1 > 0) {
Float[] scoresf = (Float[])subscores.getArray();
if (cPepCoverage2 <0 || Double.isNaN(scoresf[cPepCoverage2]))
psm.addOtherInfo("minPepCoverage",
scoresf[cPepCoverage1]);
else
psm.addOtherInfo("minPepCoverage",
Math.min(scoresf[cPepCoverage1],
scoresf[cPepCoverage2])
);
}
psm.addOtherInfo("scoreP1Coverage",p1c);
psm.addOtherInfo("scoreP2Coverage",p2c);
if (pep2mass>0) {
psm.addOtherInfo("minPepCoverageAbsolute",
Math.min(p1c, p2c));
} else {
psm.addOtherInfo("minPepCoverageAbsolute", p1c);
}

psm.addOtherInfo("cleavclpep1fragmatched",cleavclpep1fragmatched ? 1:0);
psm.addOtherInfo("cleavclpep2fragmatched",cleavclpep2fragmatched ? 1:0);
psm.addOtherInfo("cleavclpepfragmatched",(cleavclpep2fragmatched ? 1:0) + (cleavclpep1fragmatched ? 1:0));
psm.addOtherInfo("deltaScore",rs.getDouble(deltaScoreColumn));
psm.addOtherInfo("ScoreDivDelta",rs.getDouble(scoreColumn)/rs.getDouble(deltaScoreColumn));
psm.addOtherInfo("linkSiteDelta",rs.getDouble(LinkSiteDeltaColumn));
psm.addOtherInfo("mgxrank",rs.getDouble(mgxrankColumn));
psm.addOtherInfo("PrecursorIntensity",rs.getDouble(precIntensityColumn));
psm.addOtherInfo("RetentionTime",rs.getDouble(retentiontimeColumn));
Double xlModmassPre = rs.getDouble(clMassColumn);
Double xlModmass = xlmodmasses.get(xlModmassPre);
if (xlModmass == null) {
xlmodmasses.put(xlModmassPre,xlModmassPre);
xlModmass = xlModmassPre;
}
psm.setCrosslinkerModMass(rs.getDouble(clMassColumn));
psm.setDeltaScore(rs.getDouble(deltaScoreColumn));

if (autovalidated) {
psm.setAutoValidated(autovalidated);
Expand Down
25 changes: 25 additions & 0 deletions src/main/java/org/rappsilber/fdr/FDRSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,21 +119,46 @@ public interface FDRSettings {
public boolean boostProteins();
public void boostProteins(boolean boost);

public boolean boostPepCoverage();
public void boostPepCoverage(boolean boost);
public boolean boostDeltaScore();

public void boostDeltaScore(boolean boost);

public boolean boostPSMs();
public void boostPSMs(boolean boost);
// public boolean boostSubScores();
// public void boostSubScores(boolean boost);
public boolean boostPeptidePairs();
public void boostPeptidePairs(boolean boost);
public boolean boostLinks();

public void boostLinks(boolean boost);
public boolean isGroupByPSMCount();
public void setGroupByPSMCount(boolean groupByPPI);

public double getMinPeptideCoverageFilter();
public void setMinPeptideCoverageFilter(double d);

public double getMinDeltaScoreFilter();
public void setMinDeltaScoreFilter(double d);

public void setMinTD(Integer c) ;

public int getMinTD();

public Boolean psmLocalFDR();
public Boolean peppairLocalFDR();
public Boolean protLocalFDR();
public Boolean linkLocalFDR();
public Boolean ppiLocalFDR();
public void psmLocalFDR(Boolean local);
public void peppairLocalFDR(Boolean local);
public void protLocalFDR(Boolean local);
public void linkLocalFDR(Boolean local);
public void ppiLocalFDR(Boolean local);
public boolean combineScoreAndDelta();
public void combineScoreAndDelta(boolean c);
// public double getSubScoreCutOff();
// public void setSubScoreCutOff(double localfdr);

Expand Down
Loading

0 comments on commit e3640b6

Please sign in to comment.