Skip to content

Commit

Permalink
Version 1.3.35
Browse files Browse the repository at this point in the history
BugFix for ambiguous peptides
  • Loading branch information
Lutz Fischer committed Sep 5, 2019
1 parent e3640b6 commit da23db1
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 32 deletions.
7 changes: 4 additions & 3 deletions nb-configuration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ Without this configuration present, some functionality in the IDE may be limited
<configuration id="csv commandline" profiles=""/>
</configurations>
</config-data>
<spellchecker-wordlist xmlns="http://www.netbeans.org/ns/spellchecker-wordlist/1">
<word>psms</word>
</spellchecker-wordlist>
<properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">
<!--
Properties that influence various parts of the IDE, especially code formatting and the like.
Expand All @@ -20,8 +23,6 @@ Any value defined here will override the pom.xml file value but is only applicab
-->
<netbeans.hint.license>apache20</netbeans.hint.license>
<org-netbeans-modules-javascript2-requirejs.enabled>false</org-netbeans-modules-javascript2-requirejs.enabled>
<netbeans.hint.jdkPlatform>JDK_1.8</netbeans.hint.jdkPlatform>
</properties>
<spellchecker-wordlist xmlns="http://www.netbeans.org/ns/spellchecker-wordlist/1">
<word>psms</word>
</spellchecker-wordlist>
</project-shared-configuration>
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.34</version>
<version>1.3.35</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>${project.groupId}</groupId>
<artifactId>CSV</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>rappsilber</groupId>
<artifactId>XiSearch</artifactId>
Expand Down Expand Up @@ -103,6 +98,11 @@
<artifactId>fastutil</artifactId>
<version>7.2.1</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>CSV</artifactId>
<version>1.0-SNAPSHOT</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.34</name>
<name>xiFDR-1.3.35</name>
</project>
36 changes: 17 additions & 19 deletions src/main/java/org/rappsilber/fdr/CSVinFDR.java
Original file line number Diff line number Diff line change
Expand Up @@ -359,26 +359,27 @@ public void readCSV(CsvParser csv, CsvCondition filter) throws FileNotFoundExcep
ipeppos2[i] = Integer.parseInt(pepPositions2[i]);
}

String run = crun == null ? "":csv.getValue(crun);
String scan = cscan == null ? "":csv.getValue(cscan);
String crosslinker = cCrosslinker == null ? "":csv.getValue(cCrosslinker);
double crosslinkerMass = cCrosslinkerMass == null ? -1:csv.getDouble(cCrosslinkerMass);
String negativeCase = null;
String poisitiveCase = null;
if (cNegativeGrouping != null && cNegativeGrouping >=0) {
negativeCase = csv.getValue(cNegativeGrouping);
if (negativeCase.isEmpty())
negativeCase=null;
}
if (cPositiveGrouping != null && cPositiveGrouping >=0) {
poisitiveCase = csv.getValue(cPositiveGrouping);
if (poisitiveCase.isEmpty())
poisitiveCase=null;
}


PSM psm = null;
for (int p1 = 0; p1< accessions1.length; p1++) {
for (int p2 = 0; p2< accessions2.length; p2++) {
String run = crun == null ? "":csv.getValue(crun);
String scan = cscan == null ? "":csv.getValue(cscan);
String crosslinker = cCrosslinker == null ? "":csv.getValue(cCrosslinker);
double crosslinkerMass = cCrosslinkerMass == null ? -1:csv.getDouble(cCrosslinkerMass);
String negativeCase = null;
String poisitiveCase = null;
if (cNegativeGrouping != null && cNegativeGrouping >=0) {
negativeCase = csv.getValue(cNegativeGrouping);
if (negativeCase.isEmpty())
negativeCase=null;
}
if (cPositiveGrouping != null && cPositiveGrouping >=0) {
poisitiveCase = csv.getValue(cPositiveGrouping);
if (poisitiveCase.isEmpty())
poisitiveCase=null;
}

psm = addMatch(psmID, pepSeq1, pepSeq2, peplen1, peplen2,
site1, site2, isDecoy1, isDecoy2, charge, score,
Expand Down Expand Up @@ -407,9 +408,6 @@ public void readCSV(CsvParser csv, CsvCondition filter) throws FileNotFoundExcep
}
}




if (cInfo != null) {
psm.setInfo(csv.getValue(cInfo));
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/rappsilber/fdr/OfflineFDR.java
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,7 @@ public PSM addMatch(String psmID, Peptide peptide1, Peptide peptide2, int peplen
score = 10 - (10 * score);
}

PSM psm = new PSM(psmID, npepid1, npepid2, (byte) nsite1, (byte) nsite2, proteinId1.isDecoy(), proteinId2.isDecoy(), (byte) charge, score, peptide1Score, peptide2Score);
PSM psm = new PSM(psmID, npepid1, npepid2, (byte) nsite1, (byte) nsite2, nproteinId1.isDecoy(), nproteinId2.isDecoy(), (byte) charge, score, npeptide1Score, npeptide2Score);
psm.setNegativeGrouping(isSpecialCase);

psm.setRun(registerRun(run));
Expand Down
13 changes: 11 additions & 2 deletions src/main/java/org/rappsilber/fdr/entities/PSM.java
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,18 @@ public boolean equals(Object l) {
PSM c = (PSM) l;
if (isNonCovalent != c.isNonCovalent)
return false;
if (this.origScore != c.origScore)
return false;
if (this.crosslinker != c.crosslinker)
return false;
if (this.charge != c.charge)
return false;

if (!this.psmID.contentEquals(c.psmID))
return false;

// return this.score == c.score && this.charge == c.charge && this.psmID.contentEquals(c.psmID);
return this.origScore == c.origScore && this.crosslinker == c.crosslinker && this.charge == c.charge && this.psmID.contentEquals(c.psmID) &&
((((c.peptide1Score == this.peptide1Score &&c.peptide2Score == this.peptide2Score)) && c.peptide1.equals(this.peptide1) && c.peptide2.equals(this.peptide2) && c.pepsite1 == pepsite1 && c.pepsite2 == pepsite2)
return ((((c.peptide1Score == this.peptide1Score &&c.peptide2Score == this.peptide2Score)) && c.peptide1.equals(this.peptide1) && c.peptide2.equals(this.peptide2) && c.pepsite1 == pepsite1 && c.pepsite2 == pepsite2)
|| /* to be safe from binary inaccuracy we make an integer-comparison*/
((c.peptide1Score == this.peptide2Score &&c.peptide2Score == this.peptide1Score) && c.peptide2.equals(this.peptide1) && c.peptide1.equals(this.peptide2) && c.pepsite2 == pepsite1 && c.pepsite1 == pepsite2));
}
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/xifdrproject.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
xifdr.version=${project.version}
xifdr.artifactId=${project.artifactId}
xifdr.changelog=\
1.3.35\n\
* BugFix for ambiguous peptides\n\
1.3.34\n\
* support for local FDR (PEP)\n\
* will read in and try to boost on delta score and peptide coverage\n\
Expand Down

0 comments on commit da23db1

Please sign in to comment.