Skip to content

Commit

Permalink
Merge pull request #5 from Rappsilber-Laboratory/master
Browse files Browse the repository at this point in the history
Merge Back
  • Loading branch information
Lutz Fischer authored Oct 31, 2019
2 parents 1abf541 + 0cc88b1 commit 4439134
Show file tree
Hide file tree
Showing 35 changed files with 2,929 additions and 818 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@ xiFDR
=====

Generic FDR-Calculation for cross-linked PSMs and resulting peptide pairs, links and protein pairs

Binary releases can be downloaded from
https://xi3.bio.ed.ac.uk/downloads/
92 changes: 46 additions & 46 deletions nbactions-release-profile.xml
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>
<actions>
<action>
<actionName>run</actionName>
<packagings>
<packaging>jar</packaging>
</packagings>
<goals>
<goal>process-classes</goal>
<goal>org.codehaus.mojo:exec-maven-plugin:1.2.1:exec</goal>
</goals>
<properties>
<exec.args>-classpath %classpath org.rappsilber.fdr.gui.FDRGUI</exec.args>
<exec.executable>java</exec.executable>
</properties>
</action>
<action>
<actionName>debug</actionName>
<packagings>
<packaging>jar</packaging>
</packagings>
<goals>
<goal>process-classes</goal>
<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} -classpath %classpath org.rappsilber.fdr.gui.FDRGUI</exec.args>
<exec.executable>java</exec.executable>
<jpda.listen>true</jpda.listen>
</properties>
</action>
<action>
<actionName>profile</actionName>
<packagings>
<packaging>jar</packaging>
</packagings>
<goals>
<goal>process-classes</goal>
<goal>org.codehaus.mojo:exec-maven-plugin:1.2.1:exec</goal>
</goals>
<properties>
<exec.args>-classpath %classpath org.rappsilber.fdr.gui.FDRGUI</exec.args>
<exec.executable>java</exec.executable>
</properties>
</action>
</actions>
<?xml version="1.0" encoding="UTF-8"?>
<actions>
<action>
<actionName>run</actionName>
<packagings>
<packaging>jar</packaging>
</packagings>
<goals>
<goal>process-classes</goal>
<goal>org.codehaus.mojo:exec-maven-plugin:1.2.1:exec</goal>
</goals>
<properties>
<exec.args>-classpath %classpath org.rappsilber.fdr.CommandLine</exec.args>
<exec.executable>java</exec.executable>
</properties>
</action>
<action>
<actionName>debug</actionName>
<packagings>
<packaging>jar</packaging>
</packagings>
<goals>
<goal>process-classes</goal>
<goal>org.codehaus.mojo:exec-maven-plugin:1.2.1:exec</goal>
</goals>
<properties>
<exec.args>-agentlib:jdwp=transport=dt_socket,server=n,address=${jpda.address} -classpath %classpath org.rappsilber.fdr.CommandLine</exec.args>
<exec.executable>java</exec.executable>
<jpda.listen>true</jpda.listen>
</properties>
</action>
<action>
<actionName>profile</actionName>
<packagings>
<packaging>jar</packaging>
</packagings>
<goals>
<goal>process-classes</goal>
<goal>org.codehaus.mojo:exec-maven-plugin:1.2.1:exec</goal>
</goals>
<properties>
<exec.args>-classpath %classpath org.rappsilber.fdr.CommandLine</exec.args>
<exec.executable>java</exec.executable>
</properties>
</action>
</actions>
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>-Xmx3g -XX:+HeapDumpOnOutOfMemoryError -classpath %classpath org.rappsilber.fdr.CommandLine</exec.args>
<exec.args>-classpath %classpath org.rappsilber.fdr.CommandLine --linkfdr=5.0 --boost=link --csvOutDir=/home/lfischer/temp/test/FDR_rpfdr5.0 --csvBaseName=4pm_dsso_Xi1.7.0.RC1_grouped --xiconfig=/home/lfischer/temp/test/4pm_dsso_Xi1.7.0.RC1.csv.config --fasta=/Users/salman/xi_data/xi/sequenceDB/4_protein_mix-17_59_11-19_Jan_2018/4ProtMix.fasta /home/lfischer/temp/test/4pm_dsso_Xi1.7.0.RC1.csv --gui</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>-agentlib:jdwp=transport=dt_socket,server=n,address=${jpda.address} -Xmx3g -XX:+HeapDumpOnOutOfMemoryError -classpath %classpath org.rappsilber.fdr.CommandLine</exec.args>
<exec.args>-agentlib:jdwp=transport=dt_socket,server=n,address=${jpda.address} -classpath %classpath org.rappsilber.fdr.CommandLine --linkfdr=5.0 --boost=link --csvOutDir=/home/lfischer/temp/test/FDR_rpfdr5.0 --csvBaseName=4pm_dsso_Xi1.7.0.RC1_grouped --xiconfig=/home/lfischer/temp/test/4pm_dsso_Xi1.7.0.RC1.csv.config --fasta=/Users/salman/xi_data/xi/sequenceDB/4_protein_mix-17_59_11-19_Jan_2018/4ProtMix.fasta /home/lfischer/temp/test/4pm_dsso_Xi1.7.0.RC1.csv --gui</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>-Xmx3g -XX:+HeapDumpOnOutOfMemoryError -classpath %classpath org.rappsilber.fdr.CommandLine</exec.args>
<exec.args>-classpath %classpath org.rappsilber.fdr.CommandLine --linkfdr=5.0 --boost=link --csvOutDir=/home/lfischer/temp/test/FDR_rpfdr5.0 --csvBaseName=4pm_dsso_Xi1.7.0.RC1_grouped --xiconfig=/home/lfischer/temp/test/4pm_dsso_Xi1.7.0.RC1.csv.config --fasta=/Users/salman/xi_data/xi/sequenceDB/4_protein_mix-17_59_11-19_Jan_2018/4ProtMix.fasta /home/lfischer/temp/test/4pm_dsso_Xi1.7.0.RC1.csv --gui</exec.args>
<exec.executable>java</exec.executable>
<exec.workingdir>/home/lfischer</exec.workingdir>
</properties>
Expand Down
14 changes: 7 additions & 7 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.3.36</version>
<version>1.4.0</version>
<packaging>jar</packaging>
<dependencies>
<dependency>
Expand Down Expand Up @@ -35,11 +35,6 @@
<artifactId>RUtils</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>rappsilber</groupId>
<artifactId>XiSearch</artifactId>
<version>1.6.749</version>
</dependency>
<dependency>
<groupId>org.rappsilber</groupId>
<artifactId>XLMOD</artifactId>
Expand Down Expand Up @@ -103,6 +98,11 @@
<artifactId>CSV</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>rappsilber</groupId>
<artifactId>XiSearch</artifactId>
<version>1.7.754.dev</version>
</dependency>
</dependencies>
<build>
<plugins>
Expand Down Expand Up @@ -145,5 +145,5 @@
</properties>
<description>Application for FDR estimation cross-linking massspectrometry data
</description>
<name>xiFDR-1.3.36</name>
<name>xiFDR-1.4.0</name>
</project>
42 changes: 28 additions & 14 deletions src/main/java/org/rappsilber/fdr/CSVinFDR.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ public class CSVinFDR extends OfflineFDR {
{"crosslinker mass","cross linker mass","crossLinkerModMass","cross linker mod mass","crosslinkerModMass"},
{"peptide coverage1", "peptide1 unique matched non lossy coverage", "unique_peak_primary_coverage_p1"},
{"peptide coverage2", "peptide2 unique matched non lossy coverage", "unique_peak_primary_coverage_p2"},
{"peptide1 fragments", "peptide1 unique matched conservative", "conservative_fragsites_p1"},
{"peptide2 fragments", "peptide2 unique matched conservative", "conservative_fragsites_p2"},
{"peptides with stubs", "fragment CCPepFragment"},
{"peptides with doublets", "fragment CCPepDoubletFound"},
{"minimum peptide coverage", "min coverage pp"},
{"delta", "delta score", "dscore"},
};
Expand All @@ -102,11 +106,6 @@ public CSVinFDR(int[] peptideLengthGroups) {
@Override
protected ArrayList<String> getPSMHeader() {
ArrayList<String> ret = super.getPSMHeader();
// String header = "PSMID" + seperator + "run" + seperator + "scan"
// + seperator + "exp charge" + seperator + "exp m/z" + seperator + "exp mass" + seperator + "exp fractionalmass"
// + seperator + "match charge" + seperator + "match mass" + seperator + "match fractionalmass"
//
// + seperator + "Protein1" + seperator + "Description1" + seperator + "Decoy1" + seperator + "Protein2" + seperator + "Description2" + seperator + "Decoy2" + seperator + "Peptide1" + seperator + "Peptide2" + seperator + "PeptidePosition1" + seperator + "PeptidePosition2" + seperator + "PeptideLength1" + seperator + "PeptideLength2" + seperator + "fromSite" + seperator + "ToSite" + seperator + "Charge" + seperator + "Score" + seperator + "isDecoy" + seperator + "isTT" + seperator + "isTD" + seperator + "isDD" + seperator + "fdrGroup" + seperator + "fdr" + seperator + "" + seperator + "PeptidePairFDR" + seperator + "Protein1FDR" + seperator + "Protein2FDR" + seperator + "LinkFDR" + seperator + "PPIFDR" + seperator + seperator + "peptide pair id" + seperator + "link id" + seperator + "ppi id";
ret.add(5, "exp charge");
ret.add(6, "exp m/z");
ret.add(7, "exp mass");
Expand All @@ -126,7 +125,6 @@ protected ArrayList<String> getPSMOutputLine(PSM pp) {
double mass = (mz-1.00727646677)*charge;
double fraction = mass-Math.floor(mass);
double calcfraction = pp.getCalcMass()-Math.floor(pp.getCalcMass());


ret.add(5,""+ charge);
ret.add(6, d2s(mz));
Expand All @@ -135,7 +133,6 @@ protected ArrayList<String> getPSMOutputLine(PSM pp) {
ret.add(9,i2s(pp.getCharge()));
ret.add(10, d2s(pp.getCalcMass()));
ret.add(11, d2s(calcfraction));


return ret;
}
Expand Down Expand Up @@ -198,6 +195,8 @@ public void readCSV(CsvParser csv, CsvCondition filter) throws FileNotFoundExcep
Integer cDelta = getColumn(csv,"delta",true);
Integer cPep1Coverage = getColumn(csv,"peptide coverage1",true);
Integer cPep2Coverage = getColumn(csv,"peptide coverage1",true);
Integer cPepStubs = getColumn(csv,"peptides with stubs",true);
Integer cPepDoublets = getColumn(csv,"peptides with doublets",true);
Integer cPepMinCoverage = getColumn(csv,"minimum peptide coverage",true);
Integer cRank = getColumn(csv,"rank",true);

Expand Down Expand Up @@ -298,12 +297,12 @@ public void readCSV(CsvParser csv, CsvCondition filter) throws FileNotFoundExcep
peptide2score=score*(1-ratio);
}

String[] accessions1 =saccession1.split(";");
String[] accessions2 =saccession2.split(";");
String[] descriptions1 =sdescription1.split(";",-1);
String[] descriptions2 =sdescription2.split(";",-1);
String[] pepPositions1 =spepPosition1.split(";",-1);
String[] pepPositions2 =spepPosition2.split(";",-1);
String[] accessions1 =saccession1.split("\\s*;\\s*");
String[] accessions2 =saccession2.split("\\s*;\\s*");
String[] descriptions1 =sdescription1.split("\\s*;\\s*",-1);
String[] descriptions2 =sdescription2.split("\\s*;\\s*",-1);
String[] pepPositions1 =spepPosition1.split("\\s*;\\s*",-1);
String[] pepPositions2 =spepPosition2.split("\\s*;\\s*",-1);

if (!sdescription1.isEmpty()) {
if (descriptions1.length != accessions1.length)
Expand Down Expand Up @@ -351,7 +350,7 @@ public void readCSV(CsvParser csv, CsvCondition filter) throws FileNotFoundExcep

int[] ipeppos1 = new int[pepPositions1.length];
for (int i = 0; i<pepPositions1.length; i++) {
ipeppos1[i] = Integer.parseInt(pepPositions1[i]);
ipeppos1[i] = Integer.parseInt(pepPositions1[i].trim());
}

int[] ipeppos2 = new int[pepPositions2.length];
Expand Down Expand Up @@ -425,6 +424,21 @@ public void readCSV(CsvParser csv, CsvCondition filter) throws FileNotFoundExcep
}
if (cDelta != null)
psm.setDeltaScore(csv.getDouble(cDelta));

if (cPepStubs != null) {
double s = csv.getDouble(cPepStubs);
psm.addOtherInfo("PeptidesWithStubs", s);
if (s >0) {
stubsFound(true);
}

}
if (cPepDoublets != null) {

psm.addOtherInfo("PeptidesWithDoublets", csv.getDouble(cPepDoublets));

}

if (cPepMinCoverage != null) {

psm.addOtherInfo("minPepCoverage", csv.getDouble(cPepMinCoverage));
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/rappsilber/fdr/CommandLine.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public static void main(String args[]) throws SQLException, FileNotFoundExceptio
boolean db = false;
for (String a : args) {
gui = false;
if (a.startsWith("--xiconfig=")) {
if (a.startsWith("--xiconfig=") || a.contentEquals("--gui")) {
xicsv=true;
} else if (a.startsWith("--dbids=")) {
db = true;
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/org/rappsilber/fdr/FDRSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,11 @@ public interface FDRSettings {
public void ppiLocalFDR(Boolean local);
public boolean combineScoreAndDelta();
public void combineScoreAndDelta(boolean c);
public boolean ignoreValidityChecks();
public void ignoreValidityChecks(boolean ignore);
// public double getSubScoreCutOff();
// public void setSubScoreCutOff(double localfdr);
public void setGroupByCrosslinkerStubs(boolean group);
public boolean getGroupByCrosslinkerStubs();

}
26 changes: 25 additions & 1 deletion src/main/java/org/rappsilber/fdr/FDRSettingsImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class FDRSettingsImpl implements FDRSettings {
double ProteinGroupFDR;
double ProteinGroupLinkFDR;
double ProteinGroupPairFDR;
int BoostingSteps;
int BoostingSteps = 4;
boolean BoostBetween;
boolean LinkDirectional;
boolean PPIDirectional;
Expand Down Expand Up @@ -61,6 +61,8 @@ public class FDRSettingsImpl implements FDRSettings {
private boolean combineScoreAndDelta;
private int minFragments;
private boolean boostMinFragments = false;
private boolean ignoreValidityChecks = true;
private boolean groubByCrosslinkerStubs;

@Override
public void addCalcListener(ActionListener al) {
Expand Down Expand Up @@ -318,6 +320,8 @@ public static void transferSettings(FDRSettings from, FDRSettings to) {
to.boostPepCoverage(from.boostPepCoverage());
to.boostDeltaScore(from.boostDeltaScore());
to.combineScoreAndDelta(from.combineScoreAndDelta());
to.ignoreValidityChecks(from.ignoreValidityChecks());
to.setGroupByCrosslinkerStubs(from.getGroupByCrosslinkerStubs());
}

public boolean combineScoreAndDelta() {
Expand Down Expand Up @@ -516,6 +520,26 @@ public int getMinPeptideFragmentsFilter() {
public void setMinPeptideFragmentsFilter(int frags) {
this.minFragments = frags;
}

@Override
public boolean ignoreValidityChecks() {
return this.ignoreValidityChecks;
}

@Override
public void ignoreValidityChecks(boolean ignore) {
this.ignoreValidityChecks = ignore;
}

@Override
public void setGroupByCrosslinkerStubs(boolean group) {
this.groubByCrosslinkerStubs = group;
}

@Override
public boolean getGroupByCrosslinkerStubs() {
return this.groubByCrosslinkerStubs;
}


}
Loading

0 comments on commit 4439134

Please sign in to comment.