Skip to content
Snippets Groups Projects
Commit d97c72d7 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

debug logs improved

parent ce571060
No related branches found
No related tags found
2 merge requests!630WIP: Resolve "The privileges of a new user are not saved in some cases",!512Resolve "Export to SBGN does not export compartments and some reactions"
......@@ -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;
}
}
......
......@@ -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());
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment