Skip to content

Commit

Permalink
Merge pull request #8 from bigbio/pr/5
Browse files Browse the repository at this point in the history
Pr/5
  • Loading branch information
ypriverol authored Aug 4, 2021
2 parents d72a729 + ddbd9b0 commit 361bebb
Show file tree
Hide file tree
Showing 69 changed files with 635 additions and 393 deletions.
Empty file modified .mvn/unblock-mirrors.xml
100755 → 100644
Empty file.
85 changes: 48 additions & 37 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>de.mpc.pia</groupId>
<groupId>io.github.bigbio.external</groupId>
<artifactId>pia</artifactId>
<version>1.3.16</version>
<version>1.3.18</version>
<name>PIA - Protein Inference Algorithms</name>
<url>https://github.com/mpc-bioinformatics/pia</url>

Expand Down Expand Up @@ -43,18 +43,18 @@
<junit.version>4.13.1</junit.version>
<commons-cli.version>1.4</commons-cli.version>
<commons-collections.version>4.1</commons-collections.version>
<jmzidentml.version>1.2.11</jmzidentml.version>
<jmztab.version>3.0.8</jmztab.version>
<pride-mod.version>2.1.8</pride-mod.version>
<jmzidentml.version>1.2.12-SNAPSHOT</jmzidentml.version>
<jmztab.version>3.0.11-SNAPSHOT</jmztab.version>
<pride-mod.version>2.1.9</pride-mod.version>
<pride-jaxb.version>1.0.22</pride-jaxb.version>
<xxindex.version>0.23</xxindex.version>
<mascotdatfile.version>3.6.0</mascotdatfile.version>
<mascotdatfile.version>3.6.1</mascotdatfile.version>
<xtandem-parser.version>1.13.0</xtandem-parser.version>
<biojava-ontology.version>4.2.8</biojava-ontology.version>
<sqlite4java.version>1.0.392</sqlite4java.version>
<sqlite-jdbc.version>3.20.1</sqlite-jdbc.version>
<ehcache.version>3.1.1</ehcache.version>
<xercesImpl.version>2.12.0</xercesImpl.version>
<xercesImpl.version>2.12.1</xercesImpl.version>

<!-- these are "internal" dependencies, the jar files are delivered together with the source -->
<BaseLib.version>0.0.1-SNAPSHOT</BaseLib.version>
Expand Down Expand Up @@ -99,26 +99,26 @@
<artifactId>jmzidentml</artifactId>
<version>${jmzidentml.version}</version>
</dependency>

<!-- JAXB needs to be added for Java >= 9 -->
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.1</version>
</dependency>

<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.3.1</version>
</dependency>

<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
<version>2.3.0</version>
</dependency>
<!-- JAXB additions -->
<!-- JAXB additions -->

<!-- pride mod dependency -->
<dependency>
Expand All @@ -130,17 +130,12 @@

<!-- mzTab dependencies -->
<dependency>
<groupId>uk.ac.ebi.pride</groupId>
<groupId>io.github.bigbio.external</groupId>
<artifactId>jmztab-modular-model</artifactId>
<version>${jmztab.version}</version>
</dependency>
<dependency>
<groupId>uk.ac.ebi.pride</groupId>
<artifactId>jmztab-modular-util</artifactId>
<version>${jmztab.version}</version>
</dependency>
<dependency>
<groupId>uk.ac.ebi.pride</groupId>
<groupId>io.github.bigbio.external</groupId>
<artifactId>jmztab-modular-converters</artifactId>
<version>${jmztab.version}</version>
</dependency>
Expand Down Expand Up @@ -223,7 +218,7 @@
<dependency>
<groupId>com.compomics</groupId>
<artifactId>utilities</artifactId>
<version>4.12.6</version>
<version>5.0.18</version>
</dependency>

</dependencies>
Expand Down Expand Up @@ -321,13 +316,30 @@
</build>

<repositories>
<!-- Nexus EBI repo -->
<!-- EBI repo -->
<repository>
<id>pst-release</id>
<name>EBI Nexus Repository</name>
<url>https://www.ebi.ac.uk/Tools/maven/repos/content/repositories/pst-release</url>
</repository>
<!-- EBI SNAPSHOT repo -->
<repository>
<id>nexus-ebi-release-repo</id>
<name>The EBI Maven 2 Nexus release repository</name>
<url>https://www.ebi.ac.uk/Tools/maven/repos/content/groups/ebi-repo/</url>
<id>pst-snapshots</id>
<name>EBI Nexus Snapshots Repository</name>
<url>https://www.ebi.ac.uk/Tools/maven/repos/content/repositories/pst-snapshots</url>
</repository>

<!-- EBI SNAPSHOT repo -->
<repository>
<id>biopax-snapshots</id>
<name>EBI Nexus Snapshots Repository</name>
<url>https://www.ebi.ac.uk/Tools/maven/repos/content/repositories/biopax-snapshots</url>
</repository>
<repository>
<id>biopax-release</id>
<name>EBI Nexus Snapshots Repository</name>
<url>https://www.ebi.ac.uk/Tools/maven/repos/content/repositories/biopax-release</url>
</repository>

<repository>
<!-- This repo is required for cpdetector (required by jmzidml->pride-xml-handler->xxindex->cpdetector) and related libraries -->
<!-- This is supplied here because of an HTTP 301 Permanent Redirect on the old URL that xxindex supplies, which breaks fresh builds. -->
Expand All @@ -342,19 +354,18 @@
<url>http://genesis.ugent.be/maven2</url>
<layout>default</layout>
</repository>

<!-- local files for the PD parser -->
</repositories>
<distributionManagement>
<repository>
<id>pia-shipped-repo</id>
<name>pia-shipped-repo</name>
<releases>
<enabled>true</enabled>
<checksumPolicy>ignore</checksumPolicy>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
<url>file://${project.basedir}/libs</url>
<id>sonatype-release</id>
<name>Central Repository OSSRH</name>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
</repository>
</repositories>
<snapshotRepository>
<id>sonatype-snapshopt</id>
<name>Central Repository OSSRH</name>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>

</project>
21 changes: 9 additions & 12 deletions src/main/java/de/mpc/pia/intermediate/Accession.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
package de.mpc.pia.intermediate;

import java.io.Serializable;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.*;
import java.util.stream.Collectors;


Expand Down Expand Up @@ -82,15 +79,15 @@ public boolean equals(Object o) {

Accession accession = (Accession) o;

if (id != null ? !id.equals(accession.id) : accession.id != null) return false;
if (accessionStr != null ? !accessionStr.equals(accession.accessionStr) : accession.accessionStr != null) {
if (!Objects.equals(id, accession.id)) return false;
if (!Objects.equals(accessionStr, accession.accessionStr)) {
return false;
}
if (descriptions != null ? !descriptions.equals(accession.descriptions) : accession.descriptions != null) {
if (!Objects.equals(descriptions, accession.descriptions)) {
return false;
}
if (dbSequence != null ? !dbSequence.equals(accession.dbSequence) : accession.dbSequence != null) return false;
if (searchDatabaseRefs != null ? !searchDatabaseRefs.equals(accession.searchDatabaseRefs) : accession.searchDatabaseRefs != null) {
if (!Objects.equals(dbSequence, accession.dbSequence)) return false;
if (!Objects.equals(searchDatabaseRefs, accession.searchDatabaseRefs)) {
return false;
}
return pGroup != null ? pGroup.getID() == accession.pGroup.getID() : accession.pGroup == null;
Expand Down Expand Up @@ -164,12 +161,12 @@ public String getDescription(Long fileID) {
if (fileID > 0) {
desc = descriptions.get(fileID);
} else {
Set<String> differentDescriptions = descriptions.entrySet().stream().filter(descIt -> (descIt.getValue() != null) &&
!descIt.getValue().trim().isEmpty()).map(descIt -> descIt.getValue().trim()).collect(Collectors.toSet());
Set<String> differentDescriptions = descriptions.values().stream().filter(s -> (s != null) &&
!s.trim().isEmpty()).map(String::trim).collect(Collectors.toSet());

if (!differentDescriptions.isEmpty()) {
StringBuilder descSB = new StringBuilder();
differentDescriptions.stream().forEach(description ->
differentDescriptions.forEach(description ->
descSB.append(description).append(';'));
desc = descSB.substring(0, descSB.length()-1);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package de.mpc.pia.intermediate;

import java.io.Serializable;
import java.util.Objects;

/**
* This class describes the occurrence of an Accession's dbSequence of a
Expand Down Expand Up @@ -59,8 +60,8 @@ public boolean equals(Object o) {
AccessionOccurrence that = (AccessionOccurrence) o;

if (accession != null && accession.getID() != null ? !accession.getID().equals(that.accession.getID()) : that.accession != null && that.accession.getID() != null) return false;
if (start != null ? !start.equals(that.start) : that.start != null) return false;
return end != null ? end.equals(that.end) : that.end == null;
if (!Objects.equals(start, that.start)) return false;
return Objects.equals(end, that.end);
}

@Override
Expand Down
19 changes: 10 additions & 9 deletions src/main/java/de/mpc/pia/intermediate/Group.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.TreeMap;


Expand Down Expand Up @@ -78,11 +79,11 @@ public boolean equals(Object o) {

if (id != group.id) return false;
if (treeID != group.treeID) return false;
if (peptides != null ? !peptides.equals(group.peptides) : group.peptides != null) return false;
if (children != null ? !children.equals(group.children) : group.children != null) return false;
if (parents != null ? !parents.equals(group.parents) : group.parents != null) return false;
if (accessions != null ? !accessions.equals(group.accessions) : group.accessions != null) return false;
return allAccessions != null ? allAccessions.equals(group.allAccessions) : group.allAccessions == null;
if (!Objects.equals(peptides, group.peptides)) return false;
if (!Objects.equals(children, group.children)) return false;
if (!Objects.equals(parents, group.parents)) return false;
if (!Objects.equals(accessions, group.accessions)) return false;
return Objects.equals(allAccessions, group.allAccessions);
}

/**
Expand Down Expand Up @@ -185,7 +186,7 @@ public Map<String, Peptide> getAllPeptides() {
public void addChild(Group child) {
children.put(child.getID(), child);
if (allAccessions != null) {
allAccessions.values().stream().forEach(child::addToAllAccessions);
allAccessions.values().forEach(child::addToAllAccessions);
}
}

Expand Down Expand Up @@ -254,7 +255,7 @@ public Map<Long, Group> getAllPeptideChildren(){
public void addParent(Group parent) {
parents.put(parent.getID(), parent);
if (parent.getAllAccessions() != null) {
parent.getAllAccessions().values().stream().forEach(this::addToAllAccessions);
parent.getAllAccessions().values().forEach(this::addToAllAccessions);
}
}

Expand Down Expand Up @@ -298,7 +299,7 @@ public Map<String, Accession> getAccessions() {
*/
protected void addToAllAccessions(Accession accession) {
allAccessions.put(accession.getAccession(), accession);
children.values().stream().forEach(child -> child.addToAllAccessions(accession));
children.values().forEach(child -> child.addToAllAccessions(accession));
}


Expand All @@ -320,7 +321,7 @@ public Map<String, Accession> getAllAccessions() {
public String getAccessionsStr() {
StringBuilder sb = new StringBuilder();
if (accessions != null) {
accessions.keySet().stream().forEach( key -> sb.append(key).append(' '));
accessions.keySet().forEach(key -> sb.append(key).append(' '));
}
return sb.toString();
}
Expand Down
13 changes: 7 additions & 6 deletions src/main/java/de/mpc/pia/intermediate/Modification.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.text.DecimalFormatSymbols;
import java.util.List;
import java.util.Locale;
import java.util.Objects;

import de.mpc.pia.modeller.score.ScoreModel;

Expand Down Expand Up @@ -205,12 +206,12 @@ public boolean equals(Object o) {

Modification that = (Modification) o;

if (residue != null ? !residue.equals(that.residue) : that.residue != null) return false;
if (mass != null ? !mass.equals(that.mass) : that.mass != null) return false;
if (description != null ? !description.equals(that.description) : that.description != null) return false;
if (accession != null ? !accession.equals(that.accession) : that.accession != null) return false;
if (cvLabel != null ? !cvLabel.equals(that.cvLabel) : that.cvLabel != null) return false;
return probability != null ? probability.equals(that.probability) : that.probability == null;
if (!Objects.equals(residue, that.residue)) return false;
if (!Objects.equals(mass, that.mass)) return false;
if (!Objects.equals(description, that.description)) return false;
if (!Objects.equals(accession, that.accession)) return false;
if (!Objects.equals(cvLabel, that.cvLabel)) return false;
return Objects.equals(probability, that.probability);
}

@Override
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/de/mpc/pia/intermediate/PIAInputFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.io.Serializable;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;

Expand Down Expand Up @@ -66,8 +67,8 @@ public boolean equals(Object o) {
PIAInputFile that = (PIAInputFile) o;

if (id != that.id) return false;
if (fileName != null ? !fileName.equals(that.fileName) : that.fileName != null) return false;
return format != null ? format.equals(that.format) : that.format == null;
if (!Objects.equals(fileName, that.fileName)) return false;
return Objects.equals(format, that.format);
}

@Override
Expand Down
7 changes: 2 additions & 5 deletions src/main/java/de/mpc/pia/intermediate/Peptide.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
package de.mpc.pia.intermediate;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.*;


public class Peptide implements Serializable {
Expand Down Expand Up @@ -51,7 +48,7 @@ public boolean equals(Object o) {

if (id != peptide.id) return false;
if (!sequence.equals(peptide.sequence)) return false;
if (spectra != null ? !spectra.equals(peptide.spectra) : peptide.spectra != null) return false;
if (!Objects.equals(spectra, peptide.spectra)) return false;
if (pGroup != null ? pGroup.getID() != peptide.pGroup.getID() : peptide.pGroup != null) return false;
return occurrences.equals(peptide.occurrences);
}
Expand Down
Loading

0 comments on commit 361bebb

Please sign in to comment.