diff --git a/converter-SBGNML/src/main/java/lcsb/mapviewer/converter/model/sbgnml/SbgnmlXmlExporter.java b/converter-SBGNML/src/main/java/lcsb/mapviewer/converter/model/sbgnml/SbgnmlXmlExporter.java index 39b313a2589585494b053bd25fd6f23cf36cb1b6..0015b30511d05efba9f0c884e605d58188c76a05 100644 --- a/converter-SBGNML/src/main/java/lcsb/mapviewer/converter/model/sbgnml/SbgnmlXmlExporter.java +++ b/converter-SBGNML/src/main/java/lcsb/mapviewer/converter/model/sbgnml/SbgnmlXmlExporter.java @@ -46,6 +46,7 @@ import lcsb.mapviewer.model.map.reaction.OrOperator; import lcsb.mapviewer.model.map.reaction.Product; import lcsb.mapviewer.model.map.reaction.Reactant; import lcsb.mapviewer.model.map.reaction.Reaction; +import lcsb.mapviewer.model.map.reaction.ReactionNode; import lcsb.mapviewer.model.map.reaction.SplitOperator; import lcsb.mapviewer.model.map.reaction.type.DissociationReaction; import lcsb.mapviewer.model.map.reaction.type.HeterodimerAssociationReaction; @@ -177,9 +178,8 @@ public class SbgnmlXmlExporter { try { map.getArc().add(getArcFromReducedReaction(reaction)); } catch (InvalidArgumentException e) { - logger.warn("Invalid arc type." - + " Reduced notation reaction found of type that is not compliant with SBGN-ML format." + " Reaction: " - + reaction.getIdReaction()); + logger.warn(eu.getElementTag(reaction) + "Invalid arc type." + + " Reduced notation reaction found of type that is not compliant with SBGN-ML format."); } continue; } @@ -707,7 +707,8 @@ public class SbgnmlXmlExporter { } if (reaction.getProducts().get(0).getElement() instanceof Phenotype) { - logger.warn("Found Phenotype being a reactant in process. That is discouraged"); + logger.warn(eu.getElementTag(reaction.getProducts().get(0).getElement()) + + "Found Phenotype being a reactant in process. That is discouraged"); } arc.setSource(sourceTargetMap.get(reaction.getReactants().get(0).getElement().getElementId())); @@ -801,13 +802,12 @@ public class SbgnmlXmlExporter { List<Arc> arcList = new ArrayList<>(); // Parse all nodes except NodeOperators - for (AbstractNode node : reaction.getNodes().stream().filter(n -> !(n instanceof NodeOperator)) - .collect(Collectors.toList())) { + for (ReactionNode node : reaction.getReactionNodes()) { try { arcList.add(getArcFromNode(node, glyphList)); } catch (InvalidArgumentException ex) { - logger.warn("Node skipped in export process, since it is not compliant with SBGN-ML format: " - + node.getClass().getName()); + logger.warn( + eu.getElementTag(node) + "Node skipped in export process, since it is not compliant with SBGN-ML format."); continue; } } diff --git a/model/src/main/java/lcsb/mapviewer/modelutils/map/ElementUtils.java b/model/src/main/java/lcsb/mapviewer/modelutils/map/ElementUtils.java index 91048a02161441ee19f5607695b93fa6cbcd83d9..8632b77cf002b32027853b22d7d99fd56f28c505 100644 --- a/model/src/main/java/lcsb/mapviewer/modelutils/map/ElementUtils.java +++ b/model/src/main/java/lcsb/mapviewer/modelutils/map/ElementUtils.java @@ -14,6 +14,7 @@ import org.reflections.Reflections; import lcsb.mapviewer.common.exception.NotImplementedException; import lcsb.mapviewer.model.map.BioEntity; import lcsb.mapviewer.model.map.reaction.Reaction; +import lcsb.mapviewer.model.map.reaction.ReactionNode; import lcsb.mapviewer.model.map.species.Element; /** @@ -257,4 +258,8 @@ public final class ElementUtils { ElementUtils.reactionClasses = reactionClasses; } + public String getElementTag(ReactionNode node) { + return "[" + node.getClass().getSimpleName() + "]" + getElementTag(node.getElement()); + } + }