Skip to content
Snippets Groups Projects

issues that were discovered during biohackathon 2019 in Paris

Merged Piotr Gawron requested to merge wikipathways-issues into master
1 file
+ 6
1
Compare changes
  • Side-by-side
  • Inline
@@ -2,10 +2,12 @@ package lcsb.mapviewer.wikipathway.model.biopax;
import java.util.*;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import lcsb.mapviewer.common.exception.InvalidArgumentException;
import lcsb.mapviewer.common.exception.NotImplementedException;
import lcsb.mapviewer.model.LogMarker;
import lcsb.mapviewer.model.ProjectLogEntryType;
import lcsb.mapviewer.model.map.*;
@@ -30,10 +32,14 @@ public class BiopaxFactory {
if (publication.getId() == null || publication.getId().equals("")) {
return null;
} else {
return new MiriamData(MiriamRelationType.BQ_BIOL_IS_DESCRIBED_BY, MiriamType.PUBMED, publication.getId());
if (StringUtils.isNumeric(publication.getId().trim())) {
return new MiriamData(MiriamRelationType.BQ_BIOL_IS_DESCRIBED_BY, MiriamType.PUBMED, publication.getId());
} else {
return null;
}
}
} else {
throw new InvalidArgumentException("Unknown biopax database: " + publication.getDb());
throw new NotImplementedException("Unknown biopax database: " + publication.getDb());
}
}
@@ -55,10 +61,15 @@ public class BiopaxFactory {
if (biopaxData != null) {
BiopaxPublication bp = biopaxData.getPublicationByReference(string);
if (bp != null) {
MiriamData md = createMiriamData(bp);
if (md != null) {
result.add(md);
} else {
try {
MiriamData md = createMiriamData(bp);
if (md != null) {
result.add(md);
} else {
logger.warn(new LogMarker(ProjectLogEntryType.PARSING_ISSUE, "BiopaxReference", string, getMapName()),
"Publication is invalid.");
}
} catch (NotImplementedException e) {
logger.warn(new LogMarker(ProjectLogEntryType.PARSING_ISSUE, "BiopaxReference", string, getMapName()),
"Publication is invalid.");
}
Loading