Skip to content

Commit

Permalink
Fixing a problem with annotations in the PSI OBO for PSM scores
Browse files Browse the repository at this point in the history
  • Loading branch information
julianu committed Jul 12, 2024
1 parent 0be2a0d commit a568536
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 12 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>de.mpc.pia</groupId>
<artifactId>pia</artifactId>
<version>1.5.3</version>
<version>1.5.4</version>
<name>PIA - Protein Inference Algorithms</name>
<url>https://github.com/mpc-bioinformatics/pia</url>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import de.mpc.pia.intermediate.PeptideSpectrumMatch;
import de.mpc.pia.intermediate.compiler.PIACompiler;
import de.mpc.pia.modeller.score.ScoreModel;
import de.mpc.pia.modeller.score.ScoreModelEnum;
import de.mpc.pia.tools.MzIdentMLTools;
import de.mpc.pia.tools.OntologyConstants;
import de.mpc.pia.tools.obo.AbstractOBOMapper;
Expand Down Expand Up @@ -854,21 +855,30 @@ private ScoreModel parseOBOTermAsScore(Term oboTerm, String value) {
ScoreModel score = null;

if (oboTerm != null) {
// the score is in the OBO file, get the relations etc.
Set<Triple> tripleSet = compiler.getOBOMapper().getTriples(oboTerm, null, null);

for (Triple triple : tripleSet) {
if (triple.getPredicate().getName().equals(AbstractOBOMapper.OBO_IS_A) &&
triple.getObject().getName().equals(OntologyConstants.SEARCH_ENGINE_PSM_SCORE.getPsiAccession())) {
// subject is a "search engine specific score for PSM"
double doubleValue = Double.parseDouble(value);
score = new ScoreModel(doubleValue,
StringEscapeUtils.unescapeJava(oboTerm.getName()),
StringEscapeUtils.unescapeJava(oboTerm.getDescription()));
ScoreModelEnum scEnum = ScoreModelEnum.getModelByAccession(oboTerm.getName());
if ((scEnum != null) && !scEnum.equals(ScoreModelEnum.UNKNOWN_SCORE)) {
// the term is a recognized / hard coded score
double doubleValue = Double.parseDouble(value);
score = new ScoreModel(doubleValue, scEnum);
} else {
// the score is in the OBO file, try to get the relations etc.
Set<Triple> tripleSet = compiler.getOBOMapper().getTriples(oboTerm, null, null);

for (Triple triple : tripleSet) {
if (triple.getPredicate().getName().equals(AbstractOBOMapper.OBO_IS_A) &&
triple.getObject().getName().equals(OntologyConstants.SEARCH_ENGINE_PSM_SCORE.getPsiAccession())) {
// subject is a "search engine specific score for PSM"
double doubleValue = Double.parseDouble(value);
score = new ScoreModel(doubleValue,
StringEscapeUtils.unescapeJava(oboTerm.getName()),
StringEscapeUtils.unescapeJava(oboTerm.getDescription()));
}
}
}
}

LOGGER.debug("parsing term {} -> {}", oboTerm, score);

return score;
}

Expand Down

0 comments on commit a568536

Please sign in to comment.