From b6db3fcb37641949a38f16cd6e273bffb33b50c5 Mon Sep 17 00:00:00 2001 From: lcottret <ludovic.cottret@inrae.fr> Date: Wed, 30 Oct 2024 15:45:30 +0100 Subject: [PATCH 1/8] add getdois method --- .../generic/AbstractMet4jApplication.java | 47 +++++++++++++++---- 1 file changed, 38 insertions(+), 9 deletions(-) diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/generic/AbstractMet4jApplication.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/generic/AbstractMet4jApplication.java index 62cfb9a94..f49e2b983 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/generic/AbstractMet4jApplication.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/generic/AbstractMet4jApplication.java @@ -64,10 +64,7 @@ import javax.xml.transform.stream.StreamResult; import java.io.*; import java.lang.annotation.Annotation; import java.lang.reflect.Field; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; +import java.util.*; import java.util.stream.Collectors; import static fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumParameterTypes.OutputFile; @@ -82,6 +79,9 @@ public abstract class AbstractMet4jApplication { private ArrayList<HashMap<String, String>> options; + @Option(name = "-h", usage = "prints the help", required = false) + private Boolean h = false; + /** * Inits the options from the field annotations * @@ -251,6 +251,8 @@ public abstract class AbstractMet4jApplication { NodeList testList = null; NodeList citationList = null; + Node citationsTag = null; + if (file.exists()) { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); @@ -272,12 +274,40 @@ public abstract class AbstractMet4jApplication { } citationList = doc.getElementsByTagName("citation"); + NodeList citationsTags = doc.getElementsByTagName("citations"); - if (citationList.getLength() > 0) { - citationExists = true; + + if(citationsTags.getLength() == 0) { + citationsTag = citationsTags.item(0); + } + else { + citationsTag = doc.createElement("citations"); } + // Check each dois in dois to see if it's already citationList + // If not present, add it in citationList + String dois[] = this.getDois(); + + for (String doi : dois) { + Boolean doiExists = false; + for (int i = 0; i < citationList.getLength(); i++) { + Node node = citationList.item(i); + if (node.getTextContent().equals(doi)) { + doiExists = true; + } + } + if (!doiExists) { + Element citation = doc.createElement("citation"); + citation.setAttribute("type", "doi"); + citation.setTextContent(doi); + citationsTag.appendChild(citation); + } + } + + if (citationList.getLength() > 0) { + citationExists = true; + } } this.initOptions(); @@ -426,7 +456,7 @@ public abstract class AbstractMet4jApplication { root.appendChild(help); Element citations = document.createElement("citations"); - root.appendChild(citations); + root.appendChild(citationsTag); if (citationExists) { for (int i = 0; i < citationList.getLength(); i++) { @@ -520,8 +550,7 @@ public abstract class AbstractMet4jApplication { */ public abstract String getShortDescription(); - @Option(name = "-h", usage = "prints the help", required = false) - private Boolean h = false; + public abstract String[] getDois(); /** * <p>printHeader.</p> -- GitLab From a06a1b1838bad2b5820f09fefa85c76e40e9663e Mon Sep 17 00:00:00 2001 From: lcottret <ludovic.cottret@inrae.fr> Date: Wed, 30 Oct 2024 15:45:42 +0100 Subject: [PATCH 2/8] add getdois method --- .../met4j_toolbox/GenerateGalaxyFiles.java | 5 +++++ .../met4j_toolbox/attributes/DecomposeSBML.java | 5 +++++ .../met4j_toolbox/attributes/ExtractPathways.java | 5 +++++ .../met4j_toolbox/attributes/ExtractSbmlAnnot.java | 5 +++++ .../attributes/GetGenesFromReactions.java | 5 +++++ .../attributes/GetReactantsFromReactions.java | 5 +++++ .../attributes/SbmlSetChargesFromFile.java | 5 +++++ .../attributes/SbmlSetEcsFromFile.java | 5 +++++ .../attributes/SbmlSetFormulasFromFile.java | 5 +++++ .../attributes/SbmlSetGprsFromFile.java | 5 +++++ .../attributes/SbmlSetIdsFromFile.java | 5 +++++ .../attributes/SbmlSetNamesFromFile.java | 5 +++++ .../attributes/SbmlSetPathwaysFromFile.java | 5 +++++ .../attributes/SbmlSetRefsFromFile.java | 5 +++++ .../attributes/SbmlToMetaboliteTable.java | 5 +++++ .../met4j_toolbox/bigg/GetModelProteome.java | 5 +++++ .../met4j_toolbox/convert/FbcToNotes.java | 4 ++++ .../met4j_toolbox/convert/Kegg2Sbml.java | 5 +++++ .../met4j_toolbox/convert/SBMLwizard.java | 5 +++++ .../met4j_toolbox/convert/Sbml2Graph.java | 5 +++++ .../metexplore/met4j_toolbox/convert/Sbml2Tab.java | 5 +++++ .../metexplore/met4j_toolbox/convert/Tab2Sbml.java | 5 +++++ .../met4j_toolbox/mapping/NameMatcher.java | 5 +++++ .../mapping/ORApathwayEnrichment.java | 5 +++++ .../networkAnalysis/BipartiteDistanceMatrix.java | 5 +++++ .../networkAnalysis/CarbonSkeletonNet.java | 4 ++++ .../networkAnalysis/ChemSimilarityWeighting.java | 8 ++++++-- .../met4j_toolbox/networkAnalysis/ChokePoint.java | 8 ++++++-- .../met4j_toolbox/networkAnalysis/CompoundNet.java | 5 +++++ .../networkAnalysis/DegreeWeighting.java | 8 ++++++-- .../networkAnalysis/DistanceMatrix.java | 5 +++++ .../networkAnalysis/ExtractSubBipNetwork.java | 5 +++++ .../networkAnalysis/ExtractSubNetwork.java | 14 ++++++-------- .../networkAnalysis/ExtractSubReactionNetwork.java | 5 +++++ .../met4j_toolbox/networkAnalysis/LoadPoint.java | 5 +++++ .../met4j_toolbox/networkAnalysis/MetaboRank.java | 7 ++++++- .../networkAnalysis/NetworkSummary.java | 5 +++++ .../met4j_toolbox/networkAnalysis/PathwayNet.java | 5 +++++ .../networkAnalysis/PrecursorNetwork.java | 5 +++++ .../networkAnalysis/ReactionDistanceMatrix.java | 5 +++++ .../networkAnalysis/ScopeNetwork.java | 8 ++++++-- .../networkAnalysis/SeedsAndTargets.java | 5 +++++ .../networkAnalysis/SideCompoundsScan.java | 5 +++++ .../TopologicalPathwayAnalysis.java | 5 +++++ .../reconstruction/SbmlCheckBalance.java | 5 +++++ 45 files changed, 229 insertions(+), 17 deletions(-) diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/GenerateGalaxyFiles.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/GenerateGalaxyFiles.java index ecd9317c2..32127e0b8 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/GenerateGalaxyFiles.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/GenerateGalaxyFiles.java @@ -240,4 +240,9 @@ public class GenerateGalaxyFiles extends AbstractMet4jApplication { public String getShortDescription() { return "Create the galaxy file tree containing met4j-toolbox app wrappers"; } + + @Override + public String[] getDois() { + return new String[0]; + } } \ No newline at end of file diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/DecomposeSBML.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/DecomposeSBML.java index c483a3f9d..3b410e7e1 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/DecomposeSBML.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/DecomposeSBML.java @@ -131,4 +131,9 @@ public class DecomposeSBML extends AbstractMet4jApplication { public String getShortDescription() { return "Parse SBML to render list of composing entities: metabolites, reactions, genes and others."; } + + @Override + public String[] getDois() { + return new String[0]; + } } diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/ExtractPathways.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/ExtractPathways.java index 2214f76a0..5d80beb4e 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/ExtractPathways.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/ExtractPathways.java @@ -118,4 +118,9 @@ public class ExtractPathways extends AbstractMet4jApplication { public String getShortDescription() { return "Extract pathway(s) from GSMN"; } + + @Override + public String[] getDois() { + return new String[0]; + } } diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/ExtractSbmlAnnot.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/ExtractSbmlAnnot.java index 640f6c508..6fe21600d 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/ExtractSbmlAnnot.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/ExtractSbmlAnnot.java @@ -145,4 +145,9 @@ public class ExtractSbmlAnnot extends AbstractMet4jApplication { public String getShortDescription() { return "Extract databases' references from SBML annotations or notes."; } + + @Override + public String[] getDois() { + return new String[0]; + } } diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/GetGenesFromReactions.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/GetGenesFromReactions.java index 777cba704..58bdaba25 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/GetGenesFromReactions.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/GetGenesFromReactions.java @@ -125,4 +125,9 @@ public class GetGenesFromReactions extends AbstractMet4jApplication { public String getShortDescription() { return "Get gene lists from a list of reactions and a GSMN."; } + + @Override + public String[] getDois() { + return new String[0]; + } } diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/GetReactantsFromReactions.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/GetReactantsFromReactions.java index 336ac4dd7..94f041521 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/GetReactantsFromReactions.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/GetReactantsFromReactions.java @@ -138,4 +138,9 @@ public class GetReactantsFromReactions extends AbstractMet4jApplication { public String getShortDescription() { return "Get reactants lists from a list of reactions and a GSMN."; } + + @Override + public String[] getDois() { + return new String[0]; + } } diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetChargesFromFile.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetChargesFromFile.java index b149a5bdf..4383f6988 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetChargesFromFile.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetChargesFromFile.java @@ -77,6 +77,11 @@ public class SbmlSetChargesFromFile extends AbstractSbmlSetMetabolite { "containing the metabolite ids and the formulas"; } + @Override + public String[] getDois() { + return new String[0]; + } + /** * <p>main.</p> * diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetEcsFromFile.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetEcsFromFile.java index 82def6bbc..ce6b232ed 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetEcsFromFile.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetEcsFromFile.java @@ -75,6 +75,11 @@ public class SbmlSetEcsFromFile extends AbstractSbmlSetReaction { return "Set EC numbers to reactions from a tabulated file containing the reaction ids and the EC"; } + @Override + public String[] getDois() { + return new String[0]; + } + /** * <p>main.</p> * diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetFormulasFromFile.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetFormulasFromFile.java index c7f3d665e..1732031ee 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetFormulasFromFile.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetFormulasFromFile.java @@ -75,6 +75,11 @@ public class SbmlSetFormulasFromFile extends AbstractSbmlSetMetabolite { return "Set Formula to network metabolites from a tabulated file containing the metabolite ids and the formulas"; } + @Override + public String[] getDois() { + return new String[0]; + } + /** * <p>main.</p> * diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetGprsFromFile.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetGprsFromFile.java index f57578de2..f3bc0d541 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetGprsFromFile.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetGprsFromFile.java @@ -85,6 +85,11 @@ public class SbmlSetGprsFromFile extends AbstractSbmlSetReaction { return "Create a new SBML file from an original sbml file and a tabulated file containing reaction ids and Gene association written in a cobra way"; } + @Override + public String[] getDois() { + return new String[0]; + } + /** * <p>main.</p> * diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetIdsFromFile.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetIdsFromFile.java index dae320521..887f36bb0 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetIdsFromFile.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetIdsFromFile.java @@ -67,6 +67,11 @@ public class SbmlSetIdsFromFile extends AbstractSbmlSetAny { return "Set new ids to network objects from a tabulated file containing the old ids and the new ids"; } + @Override + public String[] getDois() { + return new String[0]; + } + /** * <p>main.</p> * diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetNamesFromFile.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetNamesFromFile.java index 24195b8bd..f1eafd718 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetNamesFromFile.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetNamesFromFile.java @@ -74,6 +74,11 @@ public class SbmlSetNamesFromFile extends AbstractSbmlSetAny { return "Set names to network objects from a tabulated file containing the object ids and the names"; } + @Override + public String[] getDois() { + return new String[0]; + } + /** * <p>main.</p> * diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetPathwaysFromFile.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetPathwaysFromFile.java index 127269f56..f2c36da99 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetPathwaysFromFile.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetPathwaysFromFile.java @@ -84,6 +84,11 @@ public class SbmlSetPathwaysFromFile extends AbstractSbmlSetReaction { return "Set pathway to reactions in a network from a tabulated file containing the reaction ids and the pathways"; } + @Override + public String[] getDois() { + return new String[0]; + } + /** * <p>main.</p> * diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetRefsFromFile.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetRefsFromFile.java index 0f8be5550..ac9cbfa1e 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetRefsFromFile.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetRefsFromFile.java @@ -79,6 +79,11 @@ public class SbmlSetRefsFromFile extends AbstractSbmlSetAny { return "Add refs to network objects from a tabulated file containing the metabolite ids and the formulas"; } + @Override + public String[] getDois() { + return new String[0]; + } + /** * <p>main.</p> * diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlToMetaboliteTable.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlToMetaboliteTable.java index 9dbf0949a..26e1b3096 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlToMetaboliteTable.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlToMetaboliteTable.java @@ -141,4 +141,9 @@ public class SbmlToMetaboliteTable extends AbstractMet4jApplication { return "Create a tabulated file with metabolite attributes from a SBML file"; } + @Override + public String[] getDois() { + return new String[0]; + } + } diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/bigg/GetModelProteome.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/bigg/GetModelProteome.java index 668db2799..76ef9ba9b 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/bigg/GetModelProteome.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/bigg/GetModelProteome.java @@ -352,4 +352,9 @@ public class GetModelProteome extends AbstractMet4jApplication { public String getShortDescription() { return description; } + + @Override + public String[] getDois() { + return new String[0]; + } } diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/convert/FbcToNotes.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/convert/FbcToNotes.java index 56f8fce64..9dc818275 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/convert/FbcToNotes.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/convert/FbcToNotes.java @@ -153,6 +153,10 @@ public class FbcToNotes extends AbstractMet4jApplication { return "Convert FBC package annotations to sbml notes"; } + @Override + public String[] getDois() { + return new String[0]; + } } diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/convert/Kegg2Sbml.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/convert/Kegg2Sbml.java index b5a6184f7..93cb5060f 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/convert/Kegg2Sbml.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/convert/Kegg2Sbml.java @@ -73,6 +73,11 @@ public class Kegg2Sbml extends AbstractMet4jApplication { return "Build a SBML file from KEGG organism-specific pathways. Uses Kegg API."; } + @Override + public String[] getDois() { + return new String[0]; + } + public static void main(String[] args) { Kegg2Sbml app = new Kegg2Sbml(); diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/convert/SBMLwizard.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/convert/SBMLwizard.java index ded73f749..b543608ec 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/convert/SBMLwizard.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/convert/SBMLwizard.java @@ -243,4 +243,9 @@ public class SBMLwizard extends AbstractMet4jApplication { public String getShortDescription() { return "General SBML model processing"; } + + @Override + public String[] getDois() { + return new String[0]; + } } diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/convert/Sbml2Graph.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/convert/Sbml2Graph.java index 2486eb4bc..cffa37fa9 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/convert/Sbml2Graph.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/convert/Sbml2Graph.java @@ -122,4 +122,9 @@ public class Sbml2Graph extends AbstractMet4jApplication { return "Create a graph representation of a SBML file content, and export it in graph file format."; } + @Override + public String[] getDois() { + return new String[0]; + } + } diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/convert/Sbml2Tab.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/convert/Sbml2Tab.java index 2d481edd9..414c3654f 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/convert/Sbml2Tab.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/convert/Sbml2Tab.java @@ -144,4 +144,9 @@ public class Sbml2Tab extends AbstractMet4jApplication { public String getShortDescription() { return "Create a tabulated file from a SBML file"; } + + @Override + public String[] getDois() { + return new String[0]; + } } diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/convert/Tab2Sbml.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/convert/Tab2Sbml.java index 668e8c98d..51a93ad99 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/convert/Tab2Sbml.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/convert/Tab2Sbml.java @@ -128,6 +128,11 @@ public class Tab2Sbml extends AbstractMet4jApplication { return "Create a Sbml File from a tabulated file that contains the reaction ids and the formulas"; } + @Override + public String[] getDois() { + return new String[0]; + } + /** * <p>main.</p> * diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/mapping/NameMatcher.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/mapping/NameMatcher.java index df16a96cc..79f3f939d 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/mapping/NameMatcher.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/mapping/NameMatcher.java @@ -185,4 +185,9 @@ public class NameMatcher extends AbstractMet4jApplication { "substitutions of common patterns among synonyms, in order to create aliases on which classical fuzzy " + "matching can be run efficiently."; } + + @Override + public String[] getDois() { + return new String[0]; + } } diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/mapping/ORApathwayEnrichment.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/mapping/ORApathwayEnrichment.java index d740aceab..71b2ebca4 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/mapping/ORApathwayEnrichment.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/mapping/ORApathwayEnrichment.java @@ -188,6 +188,11 @@ public class ORApathwayEnrichment extends AbstractMet4jApplication { return "Perform Over Representation Analysis for Pathway Enrichment, using one-tailed exact Fisher Test."; } + @Override + public String[] getDois() { + return new String[0]; + } + @Override public String getLongDescription() { return "Perform Over Representation Analysis for Pathway Enrichment, using one-tailed exact Fisher Test.\n" + diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/BipartiteDistanceMatrix.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/BipartiteDistanceMatrix.java index dc267e1f8..a848aa08e 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/BipartiteDistanceMatrix.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/BipartiteDistanceMatrix.java @@ -221,4 +221,9 @@ public class BipartiteDistanceMatrix extends AbstractMet4jApplication { public String getShortDescription() { return "Create a compound to reactions distance matrix."; } + + @Override + public String[] getDois() { + return new String[0]; + } } diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/CarbonSkeletonNet.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/CarbonSkeletonNet.java index 00a25c02b..354094764 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/CarbonSkeletonNet.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/CarbonSkeletonNet.java @@ -226,5 +226,9 @@ public class CarbonSkeletonNet extends AbstractMet4jApplication { public String getShortDescription() { return "Create a carbon skeleton graph representation of a SBML file content, using GSAM atom-mapping file (see https://forgemia.inra.fr/metexplore/gsam)"; } + + public String[] getDois() { + return new String[]{"10.1093/example/btl181"}; + } } diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/ChemSimilarityWeighting.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/ChemSimilarityWeighting.java index 5b1566593..2186b24c4 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/ChemSimilarityWeighting.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/ChemSimilarityWeighting.java @@ -113,12 +113,16 @@ public class ChemSimilarityWeighting extends EdgeWeighting { public String getLongDescription() { return "Provides tabulated compound graph edge list, with one column with reactant pair's chemical similarity." + "Chemical similarity has been proposed as edge weight for finding meaningful paths in metabolic networks," + - " using shortest (lightest) path search. See McSha et al. 2003 (https://doi.org/10.1093/bioinformatics/btg217)," + - " Rahman et al. 2005 (https://doi.org/10.1093/bioinformatics/bti116) and Pertusi et al. 2014 (https://doi.org/10.1093/bioinformatics/btu760)"; + " using shortest (lightest) path search."; } @Override public String getShortDescription() { return "Provides tabulated compound graph edge list, with one column with reactant pair's chemical similarity."; } + + @Override + public String[] getDois() { + return new String[]{"https://doi.org/10.1093/bioinformatics/btg217", "https://doi.org/10.1093/bioinformatics/bti116", "https://doi.org/10.1093/bioinformatics/btu760"}; + } } diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/ChokePoint.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/ChokePoint.java index c6d437999..171a6dd10 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/ChokePoint.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/ChokePoint.java @@ -115,12 +115,16 @@ public class ChokePoint extends AbstractMet4jApplication { @Override public String getLongDescription() { return this.getShortDescription() + "\nChoke points constitute an indicator of lethality and can help identifying drug target " + - "Choke points are reactions that are required to consume or produce one compound. Targeting of choke point can lead to the accumulation or the loss of some metabolites, thus choke points constitute an indicator of lethality and can help identifying drug target \n" + - "See : Syed Asad Rahman, Dietmar Schomburg; Observing local and global properties of metabolic pathways: ‘load points’ and ‘choke points’ in the metabolic networks. Bioinformatics 2006; 22 (14): 1767-1774. doi: 10.1093/bioinformatics/btl181"; + "Choke points are reactions that are required to consume or produce one compound. Targeting of choke point can lead to the accumulation or the loss of some metabolites, thus choke points constitute an indicator of lethality and can help identifying drug target."; } @Override public String getShortDescription() { return "Compute the Choke points of a metabolic network."; } + + @Override + public String[] getDois() { + return new String[]{"https://doi.org/10.1093/bioinformatics/btl181"}; + } } diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/CompoundNet.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/CompoundNet.java index e59a51b44..92b4e5399 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/CompoundNet.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/CompoundNet.java @@ -221,5 +221,10 @@ public class CompoundNet extends AbstractMet4jApplication { @Override public String getShortDescription() {return "Advanced creation of a compound graph representation of a SBML file content";} + + @Override + public String[] getDois() { + return new String[0]; + } } diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/DegreeWeighting.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/DegreeWeighting.java index a55cb91bd..e170b7c12 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/DegreeWeighting.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/DegreeWeighting.java @@ -41,12 +41,16 @@ public class DegreeWeighting extends EdgeWeighting { public String getLongDescription() { return "Provides tabulated compound graph edge list, with one column with target's degree." + "Degree has been proposed as edge weight for finding meaningful paths in metabolic networks," + - " using shortest (lightest) path search. See Croes et al. 2006 (https://doi.org/10.1016/j.jmb.2005.09.079) and" + - " Croes et al. 2005 (https://doi.org/10.1093/nar/gki437)"; + " using shortest (lightest) path search."; } @Override public String getShortDescription() { return "Provides tabulated compound graph edge list, with one column with target's degree."; } + + @Override + public String[] getDois() { + return new String[]{"https://doi.org/10.1016/j.jmb.2005.09.079", "https://doi.org/10.1093/nar/gki437"}; + } } diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/DistanceMatrix.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/DistanceMatrix.java index 20a38175a..841378263 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/DistanceMatrix.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/DistanceMatrix.java @@ -179,4 +179,9 @@ public class DistanceMatrix extends AbstractMet4jApplication { public String getShortDescription() { return "Create a compound to compound distance matrix."; } + + @Override + public String[] getDois() { + return new String[0]; + } } diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/ExtractSubBipNetwork.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/ExtractSubBipNetwork.java index 34c151f13..a7103f642 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/ExtractSubBipNetwork.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/ExtractSubBipNetwork.java @@ -227,4 +227,9 @@ public class ExtractSubBipNetwork extends AbstractMet4jApplication { public String getShortDescription() { return "Create a subnetwork from a GSMN in SBML format, and two files containing lists of compounds and/or reactions of interests ids, one per row, plus one file of the same format containing side compounds ids."; } + + @Override + public String[] getDois() { + return new String[0]; + } } \ No newline at end of file diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/ExtractSubNetwork.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/ExtractSubNetwork.java index 26b5635d2..d26e83e55 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/ExtractSubNetwork.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/ExtractSubNetwork.java @@ -199,18 +199,16 @@ public class ExtractSubNetwork extends AbstractMet4jApplication { "The subnetwork correspond to part of the network that connects compounds from the first list to compounds from the second list.\n" + "Sources and targets list can have elements in common. The connecting part can be defined as the union of shortest or k-shortest paths between sources and targets, " + "or the Steiner tree connecting them. The relevance of considered path can be increased by weighting the edges using degree squared, chemical similarity (require InChI or SMILES annotations) or any provided weighting.\n" + - "\nSee previous works on subnetwork extraction for parameters recommendations:" + - "Frainay, C., & Jourdan, F. Computational methods to identify metabolic sub-networks based on metabolomic profiles. Bioinformatics 2016;1–14. https://doi.org/10.1093/bib/bbv115\n" + - "Faust, K., Croes, D., & van Helden, J. Prediction of metabolic pathways from genome-scale metabolic networks. Bio Systems 2011;105(2), 109–121. https://doi.org/10.1016/j.biosystems.2011.05.004\n" + - "Croes D, Couche F, Wodak SJ, et al. Metabolic PathFinding: inferring relevant pathways in biochemical networks. Nucleic Acids Res 2005;33:W326–30.\n" + - "Croes D, Couche F, Wodak SJ, et al. Inferring meaningful pathways in weighted metabolic networks. J Mol Biol 2006; 356:222–36.\n" + - "Rahman SA, Advani P, Schunk R, et al. Metabolic pathway analysis web service (Pathway Hunter Tool at CUBIC). Bioinformatics 2005;21:1189–93.\n" + - "Pertusi DA, Stine AE, Broadbelt LJ, et al. Efficient searching and annotation of metabolic networks using chemical similarity. Bioinformatics 2014;1–9.\n" + - "McShan DC, Rao S, Shah I. PathMiner: predicting metabolic pathways by heuristic search. Bioinformatics 2003;19:1692–8.\n"; + "\nSee previous works on subnetwork extraction for parameters recommendations."; } @Override public String getShortDescription() { return "Create a subnetwork from a GSMN in SBML format, and two files containing lists of compounds of interests ids, one per row."; } + + @Override + public String[] getDois() { + return new String[]{"https://doi.org/10.1093/bib/bbv115", "https://doi.org/10.1016/j.biosystems.2011.05.004", "https://doi.org/10.1093/nar/gki437", "https://doi.org/10.1093/bioinformatics/bti116", "https://doi.org/10.1016/j.jmb.2005.09.079", "https://doi.org/10.1093/bioinformatics/btg217", "https://doi.org/10.1093/bioinformatics/btu760", "https://doi.org/10.1093/bioinformatics/btg217"}; + } } diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/ExtractSubReactionNetwork.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/ExtractSubReactionNetwork.java index f3f47e4bf..93fd3aa2a 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/ExtractSubReactionNetwork.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/ExtractSubReactionNetwork.java @@ -221,4 +221,9 @@ public class ExtractSubReactionNetwork extends AbstractMet4jApplication { public String getShortDescription() { return "Create a subnetwork from a GSMN in SBML format, and two files containing lists of reactions of interests ids, one per row, plus one file of the same format containing side compounds ids."; } + + @Override + public String[] getDois() { + return new String[0]; + } } diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/LoadPoint.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/LoadPoint.java index 6f20231d1..435851544 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/LoadPoint.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/LoadPoint.java @@ -160,4 +160,9 @@ public class LoadPoint extends AbstractMet4jApplication { public String getShortDescription() { return "Compute the Load points of a metabolic network. Load points constitute an indicator of lethality and can help identifying drug target."; } + + @Override + public String[] getDois() { + return new String[0]; + } } diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/MetaboRank.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/MetaboRank.java index 10fdef0e3..b190ad1ac 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/MetaboRank.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/MetaboRank.java @@ -520,11 +520,16 @@ public class MetaboRank extends AbstractMet4jApplication { "The MetaboRank can, from metabolomics results, be used to fuel a recommender system highlighting interesting compounds to investigate, retrieve missing identification and drive literature mining.\n" + "It is a two dimensional centrality computed from personalized PageRank and CheiRank, with special transition probability and normalization to handle the specificities of metabolic networks.\n" + "For convenience, a one dimensional centrality rank is also computed from the highest rank from PageRank or CheiRank, and using lowest rank as tie-breaker.\n" + - "See publication for more information: Frainay et al. MetaboRank: network-based recommendation system to interpret and enrich metabolomics results, Bioinformatics (35-2), https://doi.org/10.1093/bioinformatics/bty577"; + "See publication for more information."; } @Override public String getShortDescription() { return "Compute the MetaboRank, a custom personalized PageRank for metabolic network."; } + + @Override + public String[] getDois() { + return new String[]{"https://doi.org/10.1093/bioinformatics/bty577"}; + } } \ No newline at end of file diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/NetworkSummary.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/NetworkSummary.java index 31af76e5a..c1cc6682f 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/NetworkSummary.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/NetworkSummary.java @@ -252,4 +252,9 @@ public class NetworkSummary extends AbstractMet4jApplication { return "Create a report summarizing several graph measures characterising the structure of the network."; } + @Override + public String[] getDois() { + return new String[0]; + } + } diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/PathwayNet.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/PathwayNet.java index 14bc91bb4..958244bec 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/PathwayNet.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/PathwayNet.java @@ -169,5 +169,10 @@ public class PathwayNet extends AbstractMet4jApplication { @Override public String getShortDescription() {return "Creation of a Pathway Network representation of a SBML file content";} + + @Override + public String[] getDois() { + return new String[0]; + } } diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/PrecursorNetwork.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/PrecursorNetwork.java index 5447180e4..a18bb05ee 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/PrecursorNetwork.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/PrecursorNetwork.java @@ -137,4 +137,9 @@ public class PrecursorNetwork extends AbstractMet4jApplication { public String getShortDescription() { return "Perform a network expansion from a set of compound targets to create a precursor network."; } + + @Override + public String[] getDois() { + return new String[0]; + } } diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/ReactionDistanceMatrix.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/ReactionDistanceMatrix.java index 7aee70d6d..6590b013f 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/ReactionDistanceMatrix.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/ReactionDistanceMatrix.java @@ -203,4 +203,9 @@ public class ReactionDistanceMatrix extends AbstractMet4jApplication { public String getShortDescription() { return "Create a reaction to reaction distance matrix."; } + + @Override + public String[] getDois() { + return new String[0]; + } } \ No newline at end of file diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/ScopeNetwork.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/ScopeNetwork.java index 3d9ead6d5..e50472fd0 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/ScopeNetwork.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/ScopeNetwork.java @@ -144,12 +144,16 @@ public class ScopeNetwork extends AbstractMet4jApplication { return this.getShortDescription() + "\n" + "The scope of a set of compounds (seed) refer to the maximal metabolic network that can be extended from them," + "where the extension process consist of adding a reaction to the network if and only if all of its substrates " + - "are either a seed or a product of a previously added reaction\n" + - "For more information, see Handorf, Ebenhöh and Heinrich (2005). *Expanding metabolic networks: scopes of compounds, robustness, and evolution.* Journal of molecular evolution, 61(4), 498-512. (https://doi.org/10.1007/s00239-005-0027-1)"; + "are either a seed or a product of a previously added reaction"; } @Override public String getShortDescription() { return "Perform a network expansion from a set of compound seeds to create a scope network"; } + + @Override + public String[] getDois() { + return new String[]{"https://doi.org/10.1007/s00239-005-0027-1"}; + } } diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/SeedsAndTargets.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/SeedsAndTargets.java index 8cba048a0..47f99ba26 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/SeedsAndTargets.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/SeedsAndTargets.java @@ -203,4 +203,9 @@ public class SeedsAndTargets extends AbstractMet4jApplication { public String getShortDescription() { return "Identify exogenously acquired compounds, producible compounds exogenously available and/or dead ends metabolites from metabolic network topology"; } + + @Override + public String[] getDois() { + return new String[]{"https://doi.org/10.1073/pnas.0806162105"}; + } } diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/SideCompoundsScan.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/SideCompoundsScan.java index e3c15df68..6615f9cfd 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/SideCompoundsScan.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/SideCompoundsScan.java @@ -265,4 +265,9 @@ public class SideCompoundsScan extends AbstractMet4jApplication { public String getShortDescription() { return "Scan a network to identify side-compounds."; } + + @Override + public String[] getDois() { + return new String[0]; + } } diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/TopologicalPathwayAnalysis.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/TopologicalPathwayAnalysis.java index 716be2671..57451015d 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/TopologicalPathwayAnalysis.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/TopologicalPathwayAnalysis.java @@ -227,5 +227,10 @@ public class TopologicalPathwayAnalysis extends AbstractMet4jApplication { @Override public String getShortDescription() {return "Run a Topological Pathway Analysis to identify key pathways based on topological properties of its constituting compounds.";} + + @Override + public String[] getDois() { + return new String[0]; + } } diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/reconstruction/SbmlCheckBalance.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/reconstruction/SbmlCheckBalance.java index f01b41552..34cd83455 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/reconstruction/SbmlCheckBalance.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/reconstruction/SbmlCheckBalance.java @@ -155,4 +155,9 @@ public class SbmlCheckBalance extends AbstractMet4jApplication { public String getShortDescription() { return "Check balance of all the reactions in a SBML."; } + + @Override + public String[] getDois() { + return new String[0]; + } } -- GitLab From 635639ffb653fbe4ecb8d04c88c21f5ed9677834 Mon Sep 17 00:00:00 2001 From: lcottret <ludovic.cottret@inrae.fr> Date: Mon, 25 Nov 2024 13:47:59 +0100 Subject: [PATCH 3/8] Doi Class --- .../metexplore/met4j_toolbox/utils/Doi.java | 147 ++++++++++++++++++ 1 file changed, 147 insertions(+) create mode 100644 met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/utils/Doi.java diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/utils/Doi.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/utils/Doi.java new file mode 100644 index 000000000..f477f4b6c --- /dev/null +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/utils/Doi.java @@ -0,0 +1,147 @@ +/* + * Copyright INRAE (2024) + * + * contact-metexplore@inrae.fr + * + * This software is a computer program whose purpose is to [describe + * functionalities and technical features of your software]. + * + * This software is governed by the CeCILL license under French law and + * abiding by the rules of distribution of free software. You can use, + * modify and/ or redistribute the software under the terms of the CeCILL + * license as circulated by CEA, CNRS and INRIA at the following URL + * "https://cecill.info/licences/Licence_CeCILL_V2.1-en.html". + * + * As a counterpart to the access to the source code and rights to copy, + * modify and redistribute granted by the license, users are provided only + * with a limited warranty and the software's author, the holder of the + * economic rights, and the successive licensors have only limited + * liability. + * + * In this respect, the user's attention is drawn to the risks associated + * with loading, using, modifying and/or developing or reproducing the + * software by the user in light of its specific status of free software, + * that may mean that it is complicated to manipulate, and that also + * therefore means that it is reserved for developers and experienced + * professionals having in-depth computer knowledge. Users are therefore + * encouraged to load and test the software's suitability as regards their + * requirements in conditions enabling the security of their systems and/or + * data to be ensured and, more generally, to use and operate it in the + * same conditions as regards security. + * + * The fact that you are presently reading this means that you have had + * knowledge of the CeCILL license and that you accept its terms. + * + */ + +package fr.inrae.toulouse.metexplore.met4j_toolbox.utils; + +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.net.HttpURLConnection; +import java.net.URL; +import java.util.ArrayList; + +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; + +public class Doi { + + private final String doi; + private String title; + private String journal; + private String date; + private String authors; + private ArrayList<String> authorList; + + public Doi(String doi) { + this.doi = doi.replace("https://doi.org/", ""); + this.setPublicationDetails(); + } + + private void setPublicationDetails() { + String apiUrl = "https://api.crossref.org/works/" + doi; + + try { + URL url = new URL(apiUrl); + HttpURLConnection conn = (HttpURLConnection) url.openConnection(); + conn.setRequestMethod("GET"); + conn.setRequestProperty("Accept", "application/json"); + + if (conn.getResponseCode() != 200) { + throw new RuntimeException("Failed : HTTP error code : " + conn.getResponseCode()); + } + + BufferedReader br = new BufferedReader(new InputStreamReader((conn.getInputStream()))); + StringBuilder sb = new StringBuilder(); + String output; + while ((output = br.readLine()) != null) { + sb.append(output); + } + conn.disconnect(); + + JsonObject json = JsonParser.parseString(sb.toString()).getAsJsonObject(); + JsonObject message = json.getAsJsonObject("message"); + + String title = message.getAsJsonArray("title").get(0).getAsString(); + String journal = message.getAsJsonArray("container-title").get(0).getAsString(); + String date = message.getAsJsonObject("published-print").getAsJsonArray("date-parts").get(0).getAsJsonArray().get(0).getAsString(); + JsonArray authors = message.getAsJsonArray("author"); + + ArrayList authorList = new ArrayList(); + + int index = 0; + + for (JsonElement authorElement : authors) { + JsonObject author = authorElement.getAsJsonObject(); + String authorEntry = author.get("given")+" "+author.get("family"); + authorList.add(authorEntry.replace("\"", "")); + index++; + } + + this.title = title; + this.journal = journal; + this.date = date; + this.authors = String.join(", ", authorList); + this.authorList = authorList; + + } catch (Exception e) { + System.err.println("Doi not reachable"); + } + } + + public String getTitle() { + return title; + } + + public String getJournal() { + return journal; + } + + public String getDate() { + return date; + } + + public String getAuthors() { + return authors; + } + + public String getCompleteReference() { + return authors + "; " + title + "; " + journal + "; "+ date; + } + + public String getAbbreviatedReference() { + + String firstAuthor = authorList.get(0); + String detailsFirstAuthor[] = firstAuthor.split("\s"); + String lastName = detailsFirstAuthor[detailsFirstAuthor.length-1]; + + return lastName+" et al.; " + title + "; " + journal+ "; "+ date; + } + + public String getDoi() { + return doi; + } +} -- GitLab From 86fb9c04dd8cd98de6ba342c931877b284e5d09e Mon Sep 17 00:00:00 2001 From: lcottret <ludovic.cottret@inrae.fr> Date: Mon, 25 Nov 2024 13:48:25 +0100 Subject: [PATCH 4/8] change getDois in all apps --- .../metexplore/met4j_toolbox/GenerateDoc.java | 87 +++++++++------- .../met4j_toolbox/GenerateGalaxyFiles.java | 6 +- .../attributes/DecomposeSBML.java | 8 +- .../attributes/ExtractPathways.java | 8 +- .../attributes/ExtractSbmlAnnot.java | 5 +- .../attributes/GetGenesFromReactions.java | 6 +- .../attributes/GetReactantsFromReactions.java | 6 +- .../attributes/SbmlSetChargesFromFile.java | 7 +- .../attributes/SbmlSetEcsFromFile.java | 7 +- .../attributes/SbmlSetFormulasFromFile.java | 7 +- .../attributes/SbmlSetGprsFromFile.java | 6 +- .../attributes/SbmlSetIdsFromFile.java | 7 +- .../attributes/SbmlSetNamesFromFile.java | 7 +- .../attributes/SbmlSetPathwaysFromFile.java | 7 +- .../attributes/SbmlSetRefsFromFile.java | 7 +- .../attributes/SbmlToMetaboliteTable.java | 7 +- .../met4j_toolbox/bigg/GetModelProteome.java | 5 +- .../met4j_toolbox/convert/FbcToNotes.java | 6 +- .../met4j_toolbox/convert/Kegg2Sbml.java | 7 +- .../met4j_toolbox/convert/SBMLwizard.java | 6 +- .../met4j_toolbox/convert/Sbml2Graph.java | 6 +- .../met4j_toolbox/convert/Sbml2Tab.java | 6 +- .../met4j_toolbox/convert/Tab2Sbml.java | 6 +- .../generic/AbstractMet4jApplication.java | 11 ++- .../met4j_toolbox/mapping/NameMatcher.java | 10 +- .../mapping/ORApathwayEnrichment.java | 5 +- .../BipartiteDistanceMatrix.java | 5 +- .../networkAnalysis/CarbonSkeletonNet.java | 6 +- .../ChemSimilarityWeighting.java | 53 ++++++---- .../networkAnalysis/ChokePoint.java | 8 +- .../networkAnalysis/CompoundNet.java | 99 +++++++++---------- .../networkAnalysis/DegreeWeighting.java | 9 +- .../networkAnalysis/DistanceMatrix.java | 5 +- .../networkAnalysis/ExtractSubBipNetwork.java | 6 +- .../networkAnalysis/ExtractSubNetwork.java | 14 ++- .../ExtractSubReactionNetwork.java | 5 +- .../networkAnalysis/LoadPoint.java | 6 +- .../networkAnalysis/MetaboRank.java | 8 +- .../networkAnalysis/NetworkSummary.java | 5 +- .../networkAnalysis/PathwayNet.java | 5 +- .../networkAnalysis/PrecursorNetwork.java | 6 +- .../ReactionDistanceMatrix.java | 5 +- .../networkAnalysis/ScopeNetwork.java | 9 +- .../networkAnalysis/SeedsAndTargets.java | 9 +- .../networkAnalysis/SideCompoundsScan.java | 6 +- .../TopologicalPathwayAnalysis.java | 10 +- .../reconstruction/SbmlCheckBalance.java | 6 +- 47 files changed, 336 insertions(+), 205 deletions(-) diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/GenerateDoc.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/GenerateDoc.java index 7790dc228..2395dd985 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/GenerateDoc.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/GenerateDoc.java @@ -35,6 +35,8 @@ */ package fr.inrae.toulouse.metexplore.met4j_toolbox; +import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.AbstractMet4jApplication; +import fr.inrae.toulouse.metexplore.met4j_toolbox.utils.Doi; import fr.inrae.toulouse.metexplore.met4j_toolbox.utils.ResourceURLFilter; import fr.inrae.toulouse.metexplore.met4j_toolbox.utils.Resources; import org.kohsuke.args4j.CmdLineParser; @@ -288,45 +290,58 @@ public class GenerateDoc { Class<?> myClass = Class.forName(entry.replace('/', '.')); + if (AbstractMet4jApplication.class.isAssignableFrom(myClass)) { - try { - myClass.getMethod("main", String[].class); - Constructor<?> ctor = myClass.getConstructor(); - - Object obj = ctor.newInstance(); - - String packageName = myClass.getPackageName(); - String id = myClass.getCanonicalName(); - - if (!apps.containsKey(packageName)) { - apps.put(packageName, new HashMap<>()); - } - String desc = ""; try { - Object labelo = myClass.getMethod("getLabel").invoke(obj); - String label = labelo !=null ? (String) labelo : ""; - Object spo = myClass.getMethod("getShortDescription").invoke(obj); - String sp = spo !=null ? (String) spo : ""; - sp=sp.replaceAll("\n","<br/>"); - Object lpo = myClass.getMethod("getLongDescription").invoke(obj); - String lp = lpo !=null ? (String) lpo : ""; - lp=lp.replaceAll("\n\r?","<br/>"); - String us =getUsage(obj); - desc += "<tr><td>"+ - label + - "</td><td>" + - sp+"<details><summary><small>more</small></summary>" + - lp+"<br/><br/>" + - "<pre><code>"+us+"</code></pre>" + - "</details>"+ - "</td></tr>"; - - apps.get(packageName).put(id, desc); - } catch (Exception e) { - System.err.println("no description set for "+id); + myClass.getMethod("main", String[].class); + Constructor<?> ctor = myClass.getConstructor(); + + Object obj = ctor.newInstance(); + + String packageName = myClass.getPackageName(); + String id = myClass.getCanonicalName(); + + if (!apps.containsKey(packageName)) { + apps.put(packageName, new HashMap<>()); + } + String desc = ""; + try { + Object labelo = myClass.getMethod("getLabel").invoke(obj); + String label = labelo != null ? (String) labelo : ""; + Object spo = myClass.getMethod("getShortDescription").invoke(obj); + String sp = spo != null ? (String) spo : ""; + sp = sp.replaceAll("\n", "<br/>"); + Object lpo = myClass.getMethod("getLongDescription").invoke(obj); + String lp = lpo != null ? (String) lpo : ""; + lp = lp.replaceAll("\n\r?", "<br/>"); + + Set<Doi> dois = (Set<Doi>) myClass.getMethod("getDois").invoke(obj); + + if (dois.size() > 0) { + + lp += "<br/><br/>References:<br/>"; + for (Doi doiInfo : dois) { + lp += "<a href=\"https://doi.org/" + doiInfo.getDoi() + "\">" + doiInfo.getAbbreviatedReference() + "</a><br/>"; + } + } + + String us = getUsage(obj); + desc += "<tr><td>" + + label + + "</td><td>" + + sp + "<details><summary><small>more</small></summary>" + + lp + "<br/><br/>" + + "<pre><code>" + us + "</code></pre>" + + "</details>" + + "</td></tr>"; + + apps.get(packageName).put(id, desc); + } catch (Exception e) { + System.err.println("no description set for " + id); + } + } catch (Exception e1) { + //method not set } - } catch (Exception e1) { - //method not set } } diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/GenerateGalaxyFiles.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/GenerateGalaxyFiles.java index 32127e0b8..4fce0733d 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/GenerateGalaxyFiles.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/GenerateGalaxyFiles.java @@ -36,6 +36,7 @@ package fr.inrae.toulouse.metexplore.met4j_toolbox; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.AbstractMet4jApplication; +import fr.inrae.toulouse.metexplore.met4j_toolbox.utils.Doi; import fr.inrae.toulouse.metexplore.met4j_toolbox.utils.ResourceURLFilter; import fr.inrae.toulouse.metexplore.met4j_toolbox.utils.Resources; import org.apache.commons.lang3.ClassUtils; @@ -242,7 +243,8 @@ public class GenerateGalaxyFiles extends AbstractMet4jApplication { } @Override - public String[] getDois() { - return new String[0]; + public Set<Doi> getDois() { + return Set.of(); } + } \ No newline at end of file diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/DecomposeSBML.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/DecomposeSBML.java index 3b410e7e1..613f08b24 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/DecomposeSBML.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/DecomposeSBML.java @@ -8,11 +8,13 @@ import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumFormat import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumParameterTypes; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.Format; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.ParameterType; +import fr.inrae.toulouse.metexplore.met4j_toolbox.utils.Doi; import org.kohsuke.args4j.Option; import java.io.FileWriter; import java.io.IOException; import java.io.PrintWriter; +import java.util.Set; public class DecomposeSBML extends AbstractMet4jApplication { @@ -133,7 +135,9 @@ public class DecomposeSBML extends AbstractMet4jApplication { } @Override - public String[] getDois() { - return new String[0]; + public Set<Doi> getDois() { + return Set.of(); } + + } diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/ExtractPathways.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/ExtractPathways.java index 5d80beb4e..d921bbdf1 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/ExtractPathways.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/ExtractPathways.java @@ -11,9 +11,11 @@ import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumFormat import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumParameterTypes; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.Format; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.ParameterType; +import fr.inrae.toulouse.metexplore.met4j_toolbox.utils.Doi; import org.kohsuke.args4j.Option; import java.io.IOException; +import java.util.Set; public class ExtractPathways extends AbstractMet4jApplication { @@ -120,7 +122,9 @@ public class ExtractPathways extends AbstractMet4jApplication { } @Override - public String[] getDois() { - return new String[0]; + public Set<Doi> getDois() { + return Set.of(); } + + } diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/ExtractSbmlAnnot.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/ExtractSbmlAnnot.java index 6fe21600d..722e60a6b 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/ExtractSbmlAnnot.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/ExtractSbmlAnnot.java @@ -11,6 +11,7 @@ import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumFormat import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumParameterTypes; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.Format; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.ParameterType; +import fr.inrae.toulouse.metexplore.met4j_toolbox.utils.Doi; import org.kohsuke.args4j.Option; import java.io.FileWriter; @@ -147,7 +148,7 @@ public class ExtractSbmlAnnot extends AbstractMet4jApplication { } @Override - public String[] getDois() { - return new String[0]; + public Set<Doi> getDois() { + return Set.of(); } } diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/GetGenesFromReactions.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/GetGenesFromReactions.java index 58bdaba25..d2c8e52a0 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/GetGenesFromReactions.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/GetGenesFromReactions.java @@ -13,11 +13,13 @@ import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumFormat import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumParameterTypes; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.Format; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.ParameterType; +import fr.inrae.toulouse.metexplore.met4j_toolbox.utils.Doi; import org.kohsuke.args4j.Option; import java.io.FileWriter; import java.io.IOException; import java.io.PrintWriter; +import java.util.Set; public class GetGenesFromReactions extends AbstractMet4jApplication { @@ -127,7 +129,7 @@ public class GetGenesFromReactions extends AbstractMet4jApplication { } @Override - public String[] getDois() { - return new String[0]; + public Set<Doi> getDois() { + return Set.of(); } } diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/GetReactantsFromReactions.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/GetReactantsFromReactions.java index 94f041521..592cd036d 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/GetReactantsFromReactions.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/GetReactantsFromReactions.java @@ -10,11 +10,13 @@ import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumFormat import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumParameterTypes; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.Format; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.ParameterType; +import fr.inrae.toulouse.metexplore.met4j_toolbox.utils.Doi; import org.kohsuke.args4j.Option; import java.io.FileWriter; import java.io.IOException; import java.io.PrintWriter; +import java.util.Set; public class GetReactantsFromReactions extends AbstractMet4jApplication { @@ -140,7 +142,7 @@ public class GetReactantsFromReactions extends AbstractMet4jApplication { } @Override - public String[] getDois() { - return new String[0]; + public Set<Doi> getDois() { + return Set.of(); } } diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetChargesFromFile.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetChargesFromFile.java index 4383f6988..884a46140 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetChargesFromFile.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetChargesFromFile.java @@ -40,8 +40,11 @@ import fr.inrae.toulouse.metexplore.met4j_core.biodata.BioNetwork; import fr.inrae.toulouse.metexplore.met4j_io.tabulated.attributes.SetChargesFromFile; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumParameterTypes; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.ParameterType; +import fr.inrae.toulouse.metexplore.met4j_toolbox.utils.Doi; import org.kohsuke.args4j.Option; +import java.util.Set; + /** * <p>SbmlSetChargesFromFile class.</p> * @@ -78,8 +81,8 @@ public class SbmlSetChargesFromFile extends AbstractSbmlSetMetabolite { } @Override - public String[] getDois() { - return new String[0]; + public Set<Doi> getDois() { + return Set.of(); } /** diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetEcsFromFile.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetEcsFromFile.java index ce6b232ed..ae6c9ed3f 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetEcsFromFile.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetEcsFromFile.java @@ -40,8 +40,11 @@ import fr.inrae.toulouse.metexplore.met4j_core.biodata.BioNetwork; import fr.inrae.toulouse.metexplore.met4j_io.tabulated.attributes.SetEcsFromFile; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumParameterTypes; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.ParameterType; +import fr.inrae.toulouse.metexplore.met4j_toolbox.utils.Doi; import org.kohsuke.args4j.Option; +import java.util.Set; + /** * <p>SbmlSetEcsFromFile class.</p> * @@ -76,8 +79,8 @@ public class SbmlSetEcsFromFile extends AbstractSbmlSetReaction { } @Override - public String[] getDois() { - return new String[0]; + public Set<Doi> getDois() { + return Set.of(); } /** diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetFormulasFromFile.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetFormulasFromFile.java index 1732031ee..2e0b5cc92 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetFormulasFromFile.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetFormulasFromFile.java @@ -40,8 +40,11 @@ import fr.inrae.toulouse.metexplore.met4j_core.biodata.BioNetwork; import fr.inrae.toulouse.metexplore.met4j_io.tabulated.attributes.SetFormulasFromFile; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumParameterTypes; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.ParameterType; +import fr.inrae.toulouse.metexplore.met4j_toolbox.utils.Doi; import org.kohsuke.args4j.Option; +import java.util.Set; + /** * <p>SbmlSetFormulasFromFile class.</p> * @@ -76,8 +79,8 @@ public class SbmlSetFormulasFromFile extends AbstractSbmlSetMetabolite { } @Override - public String[] getDois() { - return new String[0]; + public Set<Doi> getDois() { + return Set.of(); } /** diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetGprsFromFile.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetGprsFromFile.java index f3bc0d541..fb93771f5 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetGprsFromFile.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetGprsFromFile.java @@ -40,9 +40,11 @@ import fr.inrae.toulouse.metexplore.met4j_core.biodata.BioNetwork; import fr.inrae.toulouse.metexplore.met4j_io.tabulated.attributes.SetGprsFromFile; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumParameterTypes; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.ParameterType; +import fr.inrae.toulouse.metexplore.met4j_toolbox.utils.Doi; import org.kohsuke.args4j.Option; import java.io.IOException; +import java.util.Set; /** * <p>SbmlSetGprsFromFile class.</p> @@ -86,8 +88,8 @@ public class SbmlSetGprsFromFile extends AbstractSbmlSetReaction { } @Override - public String[] getDois() { - return new String[0]; + public Set<Doi> getDois() { + return Set.of(); } /** diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetIdsFromFile.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetIdsFromFile.java index 887f36bb0..0ce64ca8a 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetIdsFromFile.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetIdsFromFile.java @@ -40,8 +40,11 @@ import fr.inrae.toulouse.metexplore.met4j_io.tabulated.attributes.SetIdsFromFile import fr.inrae.toulouse.metexplore.met4j_io.tabulated.attributes.SetNamesFromFile; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumParameterTypes; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.ParameterType; +import fr.inrae.toulouse.metexplore.met4j_toolbox.utils.Doi; import org.kohsuke.args4j.Option; +import java.util.Set; + public class SbmlSetIdsFromFile extends AbstractSbmlSetAny { @ParameterType(name= EnumParameterTypes.Integer) @@ -68,8 +71,8 @@ public class SbmlSetIdsFromFile extends AbstractSbmlSetAny { } @Override - public String[] getDois() { - return new String[0]; + public Set<Doi> getDois() { + return Set.of(); } /** diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetNamesFromFile.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetNamesFromFile.java index f1eafd718..cae147f53 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetNamesFromFile.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetNamesFromFile.java @@ -41,8 +41,11 @@ import fr.inrae.toulouse.metexplore.met4j_io.jsbml.reader.JsbmlReader; import fr.inrae.toulouse.metexplore.met4j_io.tabulated.attributes.SetNamesFromFile; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumParameterTypes; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.ParameterType; +import fr.inrae.toulouse.metexplore.met4j_toolbox.utils.Doi; import org.kohsuke.args4j.Option; +import java.util.Set; + /** * <p>SbmlSetNamesFromFile class.</p> * @@ -75,8 +78,8 @@ public class SbmlSetNamesFromFile extends AbstractSbmlSetAny { } @Override - public String[] getDois() { - return new String[0]; + public Set<Doi> getDois() { + return Set.of(); } /** diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetPathwaysFromFile.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetPathwaysFromFile.java index f2c36da99..058779511 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetPathwaysFromFile.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetPathwaysFromFile.java @@ -40,8 +40,11 @@ import fr.inrae.toulouse.metexplore.met4j_core.biodata.BioNetwork; import fr.inrae.toulouse.metexplore.met4j_io.tabulated.attributes.SetPathwaysFromFile; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumParameterTypes; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.ParameterType; +import fr.inrae.toulouse.metexplore.met4j_toolbox.utils.Doi; import org.kohsuke.args4j.Option; +import java.util.Set; + /** * <p>SbmlSetPathwaysFromFile class.</p> * @@ -85,8 +88,8 @@ public class SbmlSetPathwaysFromFile extends AbstractSbmlSetReaction { } @Override - public String[] getDois() { - return new String[0]; + public Set<Doi> getDois() { + return Set.of(); } /** diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetRefsFromFile.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetRefsFromFile.java index ac9cbfa1e..e7acbb4d7 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetRefsFromFile.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlSetRefsFromFile.java @@ -41,8 +41,11 @@ import fr.inrae.toulouse.metexplore.met4j_io.tabulated.attributes.SetChargesFrom import fr.inrae.toulouse.metexplore.met4j_io.tabulated.attributes.SetRefsFromFile; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumParameterTypes; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.ParameterType; +import fr.inrae.toulouse.metexplore.met4j_toolbox.utils.Doi; import org.kohsuke.args4j.Option; +import java.util.Set; + /** * <p>SbmlSetRefsFromFile class.</p> * @@ -80,8 +83,8 @@ public class SbmlSetRefsFromFile extends AbstractSbmlSetAny { } @Override - public String[] getDois() { - return new String[0]; + public Set<Doi> getDois() { + return Set.of(); } /** diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlToMetaboliteTable.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlToMetaboliteTable.java index 26e1b3096..7ee464c1f 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlToMetaboliteTable.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/attributes/SbmlToMetaboliteTable.java @@ -45,11 +45,13 @@ import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumFormat import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumParameterTypes; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.Format; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.ParameterType; +import fr.inrae.toulouse.metexplore.met4j_toolbox.utils.Doi; import org.kohsuke.args4j.Option; import java.io.FileWriter; import java.io.IOException; import java.io.PrintWriter; +import java.util.Set; /** * <p>SbmlToMetaboliteTable class.</p> @@ -142,8 +144,7 @@ public class SbmlToMetaboliteTable extends AbstractMet4jApplication { } @Override - public String[] getDois() { - return new String[0]; + public Set<Doi> getDois() { + return Set.of(); } - } diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/bigg/GetModelProteome.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/bigg/GetModelProteome.java index 76ef9ba9b..7e144df98 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/bigg/GetModelProteome.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/bigg/GetModelProteome.java @@ -41,6 +41,7 @@ import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumFormat import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumParameterTypes; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.Format; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.ParameterType; +import fr.inrae.toulouse.metexplore.met4j_toolbox.utils.Doi; import org.json.simple.JSONArray; import org.json.simple.JSONObject; import org.json.simple.parser.JSONParser; @@ -354,7 +355,7 @@ public class GetModelProteome extends AbstractMet4jApplication { } @Override - public String[] getDois() { - return new String[0]; + public Set<Doi> getDois() { + return Set.of(); } } diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/convert/FbcToNotes.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/convert/FbcToNotes.java index 9dc818275..b6af1f7ef 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/convert/FbcToNotes.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/convert/FbcToNotes.java @@ -49,12 +49,14 @@ import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.AbstractMet4jApplicati import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumFormats; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.Format; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.ParameterType; +import fr.inrae.toulouse.metexplore.met4j_toolbox.utils.Doi; import org.kohsuke.args4j.CmdLineException; import org.kohsuke.args4j.CmdLineParser; import org.kohsuke.args4j.Option; import java.io.IOException; import java.util.HashSet; +import java.util.Set; import static fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumFormats.Sbml; import static fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumParameterTypes.InputFile; @@ -154,8 +156,8 @@ public class FbcToNotes extends AbstractMet4jApplication { } @Override - public String[] getDois() { - return new String[0]; + public Set<Doi> getDois() { + return Set.of(); } diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/convert/Kegg2Sbml.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/convert/Kegg2Sbml.java index 93cb5060f..cf498a57e 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/convert/Kegg2Sbml.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/convert/Kegg2Sbml.java @@ -42,8 +42,11 @@ import fr.inrae.toulouse.metexplore.met4j_io.kegg.Kegg2BioNetwork; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.AbstractMet4jApplication; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.Format; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.ParameterType; +import fr.inrae.toulouse.metexplore.met4j_toolbox.utils.Doi; import org.kohsuke.args4j.Option; +import java.util.Set; + import static fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumFormats.*; import static fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumParameterTypes.OutputFile; @@ -74,8 +77,8 @@ public class Kegg2Sbml extends AbstractMet4jApplication { } @Override - public String[] getDois() { - return new String[0]; + public Set<Doi> getDois() { + return Set.of(); } public static void main(String[] args) { diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/convert/SBMLwizard.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/convert/SBMLwizard.java index b543608ec..4c3ebbcee 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/convert/SBMLwizard.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/convert/SBMLwizard.java @@ -19,11 +19,13 @@ import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumFormat import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumParameterTypes; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.Format; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.ParameterType; +import fr.inrae.toulouse.metexplore.met4j_toolbox.utils.Doi; import org.kohsuke.args4j.Option; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; +import java.util.Set; public class SBMLwizard extends AbstractMet4jApplication { @@ -245,7 +247,7 @@ public class SBMLwizard extends AbstractMet4jApplication { } @Override - public String[] getDois() { - return new String[0]; + public Set<Doi> getDois() { + return Set.of(); } } diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/convert/Sbml2Graph.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/convert/Sbml2Graph.java index cffa37fa9..147d3ab5a 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/convert/Sbml2Graph.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/convert/Sbml2Graph.java @@ -11,11 +11,13 @@ import fr.inrae.toulouse.metexplore.met4j_io.jsbml.reader.Met4jSbmlReaderExcepti import fr.inrae.toulouse.metexplore.met4j_io.jsbml.reader.plugin.*; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.AbstractMet4jApplication; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.*; +import fr.inrae.toulouse.metexplore.met4j_toolbox.utils.Doi; import org.kohsuke.args4j.Option; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; +import java.util.Set; import static fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumFormats.Sbml; import static fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumParameterTypes.InputFile; @@ -123,8 +125,8 @@ public class Sbml2Graph extends AbstractMet4jApplication { } @Override - public String[] getDois() { - return new String[0]; + public Set<Doi> getDois() { + return Set.of(); } } diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/convert/Sbml2Tab.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/convert/Sbml2Tab.java index 414c3654f..d0dfcb9e7 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/convert/Sbml2Tab.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/convert/Sbml2Tab.java @@ -45,9 +45,11 @@ import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumFormat import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumParameterTypes; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.Format; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.ParameterType; +import fr.inrae.toulouse.metexplore.met4j_toolbox.utils.Doi; import org.kohsuke.args4j.Option; import java.io.IOException; +import java.util.Set; /** * <p>Sbml2Tab class.</p> @@ -146,7 +148,7 @@ public class Sbml2Tab extends AbstractMet4jApplication { } @Override - public String[] getDois() { - return new String[0]; + public Set<Doi> getDois() { + return Set.of(); } } diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/convert/Tab2Sbml.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/convert/Tab2Sbml.java index 51a93ad99..2dcb43933 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/convert/Tab2Sbml.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/convert/Tab2Sbml.java @@ -45,9 +45,11 @@ import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumFormat import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumParameterTypes; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.Format; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.ParameterType; +import fr.inrae.toulouse.metexplore.met4j_toolbox.utils.Doi; import org.kohsuke.args4j.Option; import java.io.IOException; +import java.util.Set; /** * <p>Tab2Sbml class.</p> @@ -129,8 +131,8 @@ public class Tab2Sbml extends AbstractMet4jApplication { } @Override - public String[] getDois() { - return new String[0]; + public Set<Doi> getDois() { + return Set.of(); } /** diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/generic/AbstractMet4jApplication.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/generic/AbstractMet4jApplication.java index f49e2b983..95842f599 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/generic/AbstractMet4jApplication.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/generic/AbstractMet4jApplication.java @@ -38,6 +38,7 @@ package fr.inrae.toulouse.metexplore.met4j_toolbox.generic; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.Format; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.ParameterType; +import fr.inrae.toulouse.metexplore.met4j_toolbox.utils.Doi; import org.json.simple.JSONArray; import org.json.simple.JSONObject; import org.kohsuke.args4j.CmdLineException; @@ -287,10 +288,12 @@ public abstract class AbstractMet4jApplication { // Check each dois in dois to see if it's already citationList // If not present, add it in citationList - String dois[] = this.getDois(); + Set<Doi> dois = this.getDois(); - for (String doi : dois) { + for (Doi doi : dois) { Boolean doiExists = false; + + String doiContent = doi.getDoi(); for (int i = 0; i < citationList.getLength(); i++) { Node node = citationList.item(i); if (node.getTextContent().equals(doi)) { @@ -300,7 +303,7 @@ public abstract class AbstractMet4jApplication { if (!doiExists) { Element citation = doc.createElement("citation"); citation.setAttribute("type", "doi"); - citation.setTextContent(doi); + citation.setTextContent(doi.getDoi()); citationsTag.appendChild(citation); } } @@ -550,7 +553,7 @@ public abstract class AbstractMet4jApplication { */ public abstract String getShortDescription(); - public abstract String[] getDois(); + public abstract Set<Doi> getDois(); /** * <p>printHeader.</p> diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/mapping/NameMatcher.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/mapping/NameMatcher.java index 79f3f939d..69317ec07 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/mapping/NameMatcher.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/mapping/NameMatcher.java @@ -10,13 +10,11 @@ import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumFormat import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumParameterTypes; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.Format; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.ParameterType; +import fr.inrae.toulouse.metexplore.met4j_toolbox.utils.Doi; import org.kohsuke.args4j.Option; import java.io.*; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; import static fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumFormats.Sbml; import static fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumFormats.Tsv; @@ -187,7 +185,7 @@ public class NameMatcher extends AbstractMet4jApplication { } @Override - public String[] getDois() { - return new String[0]; + public Set<Doi> getDois() { + return Set.of(); } } diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/mapping/ORApathwayEnrichment.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/mapping/ORApathwayEnrichment.java index 71b2ebca4..78f894aff 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/mapping/ORApathwayEnrichment.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/mapping/ORApathwayEnrichment.java @@ -16,6 +16,7 @@ import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumFormat import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumParameterTypes; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.Format; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.ParameterType; +import fr.inrae.toulouse.metexplore.met4j_toolbox.utils.Doi; import org.kohsuke.args4j.Option; import java.io.FileWriter; @@ -189,8 +190,8 @@ public class ORApathwayEnrichment extends AbstractMet4jApplication { } @Override - public String[] getDois() { - return new String[0]; + public Set<Doi> getDois() { + return Set.of(); } @Override diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/BipartiteDistanceMatrix.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/BipartiteDistanceMatrix.java index a848aa08e..1e25be22a 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/BipartiteDistanceMatrix.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/BipartiteDistanceMatrix.java @@ -19,6 +19,7 @@ import fr.inrae.toulouse.metexplore.met4j_mathUtils.matrix.BioMatrix; import fr.inrae.toulouse.metexplore.met4j_mathUtils.matrix.ExportMatrix; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.AbstractMet4jApplication; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.*; +import fr.inrae.toulouse.metexplore.met4j_toolbox.utils.Doi; import org.kohsuke.args4j.Option; import java.io.IOException; @@ -223,7 +224,7 @@ public class BipartiteDistanceMatrix extends AbstractMet4jApplication { } @Override - public String[] getDois() { - return new String[0]; + public Set<Doi> getDois() { + return Set.of(); } } diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/CarbonSkeletonNet.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/CarbonSkeletonNet.java index 354094764..5173dbab4 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/CarbonSkeletonNet.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/CarbonSkeletonNet.java @@ -23,6 +23,7 @@ import fr.inrae.toulouse.metexplore.met4j_mathUtils.matrix.ExportMatrix; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.AbstractMet4jApplication; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.*; +import fr.inrae.toulouse.metexplore.met4j_toolbox.utils.Doi; import org.apache.commons.lang3.StringUtils; import org.kohsuke.args4j.Option; @@ -30,6 +31,7 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; +import java.util.Set; import static fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumFormats.*; import static fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumFormats.Sbml; @@ -227,8 +229,8 @@ public class CarbonSkeletonNet extends AbstractMet4jApplication { return "Create a carbon skeleton graph representation of a SBML file content, using GSAM atom-mapping file (see https://forgemia.inra.fr/metexplore/gsam)"; } - public String[] getDois() { - return new String[]{"10.1093/example/btl181"}; + public Set<Doi> getDois() { + return Set.of(); } } diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/ChemSimilarityWeighting.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/ChemSimilarityWeighting.java index 2186b24c4..d64997c45 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/ChemSimilarityWeighting.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/ChemSimilarityWeighting.java @@ -9,20 +9,24 @@ import fr.inrae.toulouse.metexplore.met4j_graph.core.WeightingPolicy; import fr.inrae.toulouse.metexplore.met4j_io.jsbml.reader.Met4jSbmlReaderException; import fr.inrae.toulouse.metexplore.met4j_mapping.Mapper; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.EdgeWeighting; +import fr.inrae.toulouse.metexplore.met4j_toolbox.utils.Doi; import org.kohsuke.args4j.Option; import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; +import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Set; /** * App that provides tabulated compound graph edge list, with one column with reactant pair's chemical similarity */ public class ChemSimilarityWeighting extends EdgeWeighting { - enum strategy {EState,Extended,KlekotaRoth,MACCS,PubChem}; + enum strategy {EState, Extended, KlekotaRoth, MACCS, PubChem} + @Option(name = "-f", aliases = {"--fingerprint"}, usage = "The chemical fingerprint to use", required = false) public strategy type = strategy.Extended; @@ -37,41 +41,46 @@ public class ChemSimilarityWeighting extends EdgeWeighting { @Override public WeightingPolicy setWeightingPolicy() { SimilarityWeightPolicy wp = new SimilarityWeightPolicy(); - switch(type){ - case EState: wp.setFingerprintType(FingerprintBuilder.ESTATE); - case Extended: wp.setFingerprintType(FingerprintBuilder.EXTENDED); - case KlekotaRoth: wp.setFingerprintType(FingerprintBuilder.KLEKOTAROTH); - case MACCS: wp.setFingerprintType(FingerprintBuilder.MACCS); - case PubChem: wp.setFingerprintType(FingerprintBuilder.PUBCHEM); + switch (type) { + case EState: + wp.setFingerprintType(FingerprintBuilder.ESTATE); + case Extended: + wp.setFingerprintType(FingerprintBuilder.EXTENDED); + case KlekotaRoth: + wp.setFingerprintType(FingerprintBuilder.KLEKOTAROTH); + case MACCS: + wp.setFingerprintType(FingerprintBuilder.MACCS); + case PubChem: + wp.setFingerprintType(FingerprintBuilder.PUBCHEM); } wp.useDistance(dist); return wp; } @Override - public BioNetwork processNetwork(BioNetwork bn){ - if(inchiFile!=null){ + public BioNetwork processNetwork(BioNetwork bn) { + if (inchiFile != null) { Mapper m = new Mapper<>(bn, BioNetwork::getMetabolitesView) .columnSeparator("\t") .idColumn(1) .skipIfNotFound(); try { Map<BioMetabolite, List<String>> att = m.mapAttributes(new BufferedReader(new FileReader(inchiFile))); - for(Map.Entry<BioMetabolite, List<String>> entry : att.entrySet()){ + for (Map.Entry<BioMetabolite, List<String>> entry : att.entrySet()) { entry.getKey().setInchi(entry.getValue().get(0)); } } catch (IOException e) { System.err.println("Error reading InChI file"); throw new RuntimeException(e); } - } else if (smileFile!=null) { + } else if (smileFile != null) { Mapper m = new Mapper<>(bn, BioNetwork::getMetabolitesView) .columnSeparator("\t") .idColumn(1) .skipIfNotFound(); try { Map<BioMetabolite, List<String>> att = m.mapAttributes(new BufferedReader(new FileReader(smileFile))); - for(Map.Entry<BioMetabolite, List<String>> entry : att.entrySet()){ + for (Map.Entry<BioMetabolite, List<String>> entry : att.entrySet()) { entry.getKey().setSmiles(entry.getValue().get(0)); } } catch (IOException e) { @@ -81,13 +90,13 @@ public class ChemSimilarityWeighting extends EdgeWeighting { } int s = 0; int i = 0; - for(BioMetabolite m : bn.getMetabolitesView()){ - if(!StringUtils.isVoid(m.getSmiles())) s++; - if(!StringUtils.isVoid(m.getInchi())) i++; + for (BioMetabolite m : bn.getMetabolitesView()) { + if (!StringUtils.isVoid(m.getSmiles())) s++; + if (!StringUtils.isVoid(m.getInchi())) i++; } - System.out.println(s+"/"+bn.getMetabolitesView().size()+" metabolites with SMILE"); - System.out.println(i+"/"+bn.getMetabolitesView().size()+" metabolites with InChI"); - if((i+s)==0){ + System.out.println(s + "/" + bn.getMetabolitesView().size() + " metabolites with SMILE"); + System.out.println(i + "/" + bn.getMetabolitesView().size() + " metabolites with InChI"); + if ((i + s) == 0) { System.err.println("Error: no chemical structure provided, unable to compute chemical similarity"); System.exit(1); } @@ -122,7 +131,11 @@ public class ChemSimilarityWeighting extends EdgeWeighting { } @Override - public String[] getDois() { - return new String[]{"https://doi.org/10.1093/bioinformatics/btg217", "https://doi.org/10.1093/bioinformatics/bti116", "https://doi.org/10.1093/bioinformatics/btu760"}; + public Set<Doi> getDois() { + Set<Doi> dois = new HashSet<>(); + dois.add(new Doi("https://doi.org/10.1093/bioinformatics/btg217")); + dois.add(new Doi("https://doi.org/10.1093/bioinformatics/bti116")); + dois.add(new Doi("https://doi.org/10.1093/bioinformatics/btu760")); + return dois; } } diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/ChokePoint.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/ChokePoint.java index 171a6dd10..7f3273581 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/ChokePoint.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/ChokePoint.java @@ -14,6 +14,7 @@ import fr.inrae.toulouse.metexplore.met4j_io.jsbml.reader.Met4jSbmlReaderExcepti import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.AbstractMet4jApplication; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.Format; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.ParameterType; +import fr.inrae.toulouse.metexplore.met4j_toolbox.utils.Doi; import org.kohsuke.args4j.Option; import java.io.BufferedReader; @@ -21,6 +22,7 @@ import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.util.HashSet; +import java.util.Set; import static fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumFormats.*; import static fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumParameterTypes.InputFile; @@ -124,7 +126,9 @@ public class ChokePoint extends AbstractMet4jApplication { } @Override - public String[] getDois() { - return new String[]{"https://doi.org/10.1093/bioinformatics/btl181"}; + public Set<Doi> getDois() { + Set<Doi> dois = new HashSet<>(); + dois.add(new Doi("https://doi.org/10.1093/bioinformatics/btl181")); + return dois; } } diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/CompoundNet.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/CompoundNet.java index 92b4e5399..5abc5499b 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/CompoundNet.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/CompoundNet.java @@ -25,60 +25,53 @@ import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumFormat import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumParameterTypes; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.Format; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.ParameterType; +import fr.inrae.toulouse.metexplore.met4j_toolbox.utils.Doi; import org.kohsuke.args4j.Option; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; +import java.util.Set; public class CompoundNet extends AbstractMet4jApplication { - @Format(name= EnumFormats.Sbml) - @ParameterType(name= EnumParameterTypes.InputFile) + @Format(name = EnumFormats.Sbml) + @ParameterType(name = EnumParameterTypes.InputFile) @Option(name = "-s", usage = "input SBML file", required = true) public String inputPath = null; - @ParameterType(name= EnumParameterTypes.InputFile) - @Format(name= EnumFormats.Txt) + @ParameterType(name = EnumParameterTypes.InputFile) + @Format(name = EnumFormats.Txt) @Option(name = "-sc", usage = "input Side compound file", required = false) public String inputSide = null; - @ParameterType(name= EnumParameterTypes.OutputFile) - @Format(name= EnumFormats.Gml) + @ParameterType(name = EnumParameterTypes.OutputFile) + @Format(name = EnumFormats.Gml) @Option(name = "-o", usage = "output Graph file", required = true) public String outputPath = null; - - enum strategy {no, by_name,by_id} @Option(name = "-mc", aliases = {"--mergecomp"}, usage = "merge compartments. " + "Use names if consistent and unambiguous across compartments, or identifiers if compartment suffix is present (id in form \"xxx_y\" with xxx as base identifier and y as compartment label).") public strategy mergingStrat = strategy.no; public String idRegex = "^(\\w+)_\\w$"; - @Option(name = "-me", aliases = {"--simple"}, usage = "merge parallel edges to produce a simple graph", required = false) public boolean mergeEdges = false; - @Option(name = "-ri", aliases = {"--removeIsolatedNodes"}, usage = "remove isolated nodes", required = false) public boolean removeIsolated = false; - @Option(name = "-dw", aliases = {"--degreeWeights"}, usage = "penalize traversal of hubs by using degree square weighting", forbids = {"-cw"}) public Boolean degree = false; - - @ParameterType(name=EnumParameterTypes.InputFile) - @Format(name=EnumFormats.Tsv) + @ParameterType(name = EnumParameterTypes.InputFile) + @Format(name = EnumFormats.Tsv) @Option(name = "-cw", aliases = {"--customWeights"}, usage = "an optional file containing weights for compound pairs", forbids = {"-dw"}) public String weightFile = null; - @Option(name = "-un", aliases = {"--undirected"}, usage = "create as undirected", required = false) public boolean undirected = false; - @Option(name = "-tp", aliases = {"--transitionproba"}, usage = "set weight as random walk transition probability, normalized by reaction", required = false) public boolean computeWeight = false; - @Option(name = "-am", aliases = {"--asmatrix"}, usage = "export as matrix (implies simple graph conversion). Default export as GML file", required = false) public boolean asMatrix = false; - public static void main(String[] args) { + public static void main(String[] args) { CompoundNet app = new CompoundNet(); @@ -88,7 +81,6 @@ public class CompoundNet extends AbstractMet4jApplication { } - public void run() { System.out.print("Reading SBML..."); JsbmlReader reader = new JsbmlReader(this.inputPath); @@ -142,25 +134,25 @@ public class CompoundNet extends AbstractMet4jApplication { System.out.println(" Done."); //invert graph as undirected (copy edge weight to reversed edge) - if(undirected){ - System.out.print("Create Undirected..."); - graph.asUndirected(); - System.out.println(" Done."); - if(degree){ - //since degree weighting policy is not symmetric, for undirected case we create reversed edges, apply - //a corrected degree computation for each edge, and treat the graph as normal - System.err.println("Setting edge weights (target degree)..."); - int pow = 2; - wp = new DegreeWeightPolicy(1); - wp.setWeight(graph); - //adjust degree to ignore edges added for undirected case support - WeightUtils.process(graph, x -> StrictMath.pow((x/2),pow)); - System.out.println(" Done."); - } - } + if (undirected) { + System.out.print("Create Undirected..."); + graph.asUndirected(); + System.out.println(" Done."); + if (degree) { + //since degree weighting policy is not symmetric, for undirected case we create reversed edges, apply + //a corrected degree computation for each edge, and treat the graph as normal + System.err.println("Setting edge weights (target degree)..."); + int pow = 2; + wp = new DegreeWeightPolicy(1); + wp.setWeight(graph); + //adjust degree to ignore edges added for undirected case support + WeightUtils.process(graph, x -> StrictMath.pow((x / 2), pow)); + System.out.println(" Done."); + } + } //merge compartment - if(mergingStrat!=strategy.no){ + if (mergingStrat != strategy.no) { System.out.print("Merging compartments..."); VertexContraction vc = new VertexContraction(); VertexContraction.Mapper merger = mergingStrat.equals(strategy.by_name) ? new VertexContraction.MapByName() : new VertexContraction.MapByIdSubString(idRegex); @@ -169,19 +161,19 @@ public class CompoundNet extends AbstractMet4jApplication { } //remove isolated nodes - if(removeIsolated){ + if (removeIsolated) { System.out.println("Remove isolated nodes..."); HashSet<BioMetabolite> nodes = new HashSet<>(graph.vertexSet()); graph.removeIsolatedNodes(); nodes.removeAll(graph.vertexSet()); - for(BioMetabolite n : nodes){ + for (BioMetabolite n : nodes) { System.out.println("\tremoving " + n.getName()); } System.out.println(" Done."); } //compute transitions probability from weights - if(computeWeight) { + if (computeWeight) { System.out.print("Compute transition matrix..."); ReactionProbabilityWeight wp2 = new ReactionProbabilityWeight(); wp2.setWeight(graph); @@ -189,7 +181,7 @@ public class CompoundNet extends AbstractMet4jApplication { } //merge parallel edges - if(mergeEdges){ + if (mergeEdges) { System.out.print("Merging edges..."); EdgeMerger.mergeEdgesWithOverride(graph); System.out.println(" Done."); @@ -197,34 +189,41 @@ public class CompoundNet extends AbstractMet4jApplication { //export graph System.out.print("Exporting..."); - if(asMatrix){ + if (asMatrix) { ComputeAdjacencyMatrix adjBuilder = new ComputeAdjacencyMatrix(graph); - if(!computeWeight) adjBuilder.parallelEdgeWeightsHandling((u, v) -> Math.max(u,v)); - ExportMatrix.toCSV(this.outputPath,adjBuilder.getadjacencyMatrix()); - }else{ + if (!computeWeight) adjBuilder.parallelEdgeWeightsHandling((u, v) -> Math.max(u, v)); + ExportMatrix.toCSV(this.outputPath, adjBuilder.getadjacencyMatrix()); + } else { ExportGraph.toGmlWithAttributes(graph, this.outputPath, true); } System.out.println(" Done."); - return; } @Override - public String getLabel() {return this.getClass().getSimpleName();} + public String getLabel() { + return this.getClass().getSimpleName(); + } @Override public String getLongDescription() { return "Metabolic networks used for quantitative analysis often contain links that are irrelevant for graph-based structural analysis. For example, inclusion of side compounds or modelling artifacts such as 'biomass' nodes.\n" + "While Carbon Skeleton Graph offer a relevant alternative topology for graph-based analysis, it requires compounds' structure information, usually not provided in model, and difficult to retrieve for model with sparse cross-reference annotations.\n" + - "In contrary to the SBML2Graph app that performs a raw conversion of the SBML content, the present app propose a fine-tuned creation of compound graph from predefined list of side compounds and degree² weighting to get relevant structure without structural data."+ + "In contrary to the SBML2Graph app that performs a raw conversion of the SBML content, the present app propose a fine-tuned creation of compound graph from predefined list of side compounds and degree² weighting to get relevant structure without structural data." + "This app also enable Markov-chain based analysis of metabolic networks by computing reaction-normalized transition probabilities on the network."; } @Override - public String getShortDescription() {return "Advanced creation of a compound graph representation of a SBML file content";} + public String getShortDescription() { + return "Advanced creation of a compound graph representation of a SBML file content"; + } @Override - public String[] getDois() { - return new String[0]; + public Set<Doi> getDois() { + return Set.of(); } + + enum strategy {no, by_name, by_id} + + } diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/DegreeWeighting.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/DegreeWeighting.java index e170b7c12..884799301 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/DegreeWeighting.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/DegreeWeighting.java @@ -4,9 +4,12 @@ import fr.inrae.toulouse.metexplore.met4j_graph.computation.connect.weighting.De import fr.inrae.toulouse.metexplore.met4j_graph.core.WeightingPolicy; import fr.inrae.toulouse.metexplore.met4j_io.jsbml.reader.Met4jSbmlReaderException; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.EdgeWeighting; +import fr.inrae.toulouse.metexplore.met4j_toolbox.utils.Doi; import org.kohsuke.args4j.Option; import java.io.IOException; +import java.util.HashSet; +import java.util.Set; /** * App that provides tabulated compound graph edge list, with one column with target's degree. @@ -50,7 +53,9 @@ public class DegreeWeighting extends EdgeWeighting { } @Override - public String[] getDois() { - return new String[]{"https://doi.org/10.1016/j.jmb.2005.09.079", "https://doi.org/10.1093/nar/gki437"}; + public Set<Doi> getDois() { + Set<Doi> dois = new HashSet<>(); + dois.add(new Doi("https://doi.org/10.1016/j.jmb.2005.09.079")); + return dois; } } diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/DistanceMatrix.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/DistanceMatrix.java index 841378263..a87eb0fec 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/DistanceMatrix.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/DistanceMatrix.java @@ -19,6 +19,7 @@ import fr.inrae.toulouse.metexplore.met4j_mathUtils.matrix.BioMatrix; import fr.inrae.toulouse.metexplore.met4j_mathUtils.matrix.ExportMatrix; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.AbstractMet4jApplication; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.*; +import fr.inrae.toulouse.metexplore.met4j_toolbox.utils.Doi; import org.kohsuke.args4j.Option; import java.io.IOException; @@ -181,7 +182,7 @@ public class DistanceMatrix extends AbstractMet4jApplication { } @Override - public String[] getDois() { - return new String[0]; + public Set<Doi> getDois() { + return Set.of(); } } diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/ExtractSubBipNetwork.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/ExtractSubBipNetwork.java index a7103f642..0a3b4e6e5 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/ExtractSubBipNetwork.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/ExtractSubBipNetwork.java @@ -23,11 +23,13 @@ import fr.inrae.toulouse.metexplore.met4j_mapping.Mapper; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.AbstractMet4jApplication; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.Format; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.ParameterType; +import fr.inrae.toulouse.metexplore.met4j_toolbox.utils.Doi; import org.kohsuke.args4j.Option; import java.io.IOException; import java.util.HashSet; import java.util.List; +import java.util.Set; import static fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumFormats.*; import static fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumParameterTypes.InputFile; @@ -229,7 +231,7 @@ public class ExtractSubBipNetwork extends AbstractMet4jApplication { } @Override - public String[] getDois() { - return new String[0]; + public Set<Doi> getDois() { + return Set.of(); } } \ No newline at end of file diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/ExtractSubNetwork.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/ExtractSubNetwork.java index d26e83e55..898295a42 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/ExtractSubNetwork.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/ExtractSubNetwork.java @@ -23,11 +23,13 @@ import fr.inrae.toulouse.metexplore.met4j_io.jsbml.reader.JsbmlReader; import fr.inrae.toulouse.metexplore.met4j_io.jsbml.reader.Met4jSbmlReaderException; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.AbstractMet4jApplication; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.*; +import fr.inrae.toulouse.metexplore.met4j_toolbox.utils.Doi; import org.kohsuke.args4j.Option; import java.io.IOException; import java.util.HashSet; import java.util.List; +import java.util.Set; import static fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumFormats.*; import static fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumParameterTypes.InputFile; @@ -208,7 +210,15 @@ public class ExtractSubNetwork extends AbstractMet4jApplication { } @Override - public String[] getDois() { - return new String[]{"https://doi.org/10.1093/bib/bbv115", "https://doi.org/10.1016/j.biosystems.2011.05.004", "https://doi.org/10.1093/nar/gki437", "https://doi.org/10.1093/bioinformatics/bti116", "https://doi.org/10.1016/j.jmb.2005.09.079", "https://doi.org/10.1093/bioinformatics/btg217", "https://doi.org/10.1093/bioinformatics/btu760", "https://doi.org/10.1093/bioinformatics/btg217"}; + public Set<Doi> getDois() { + Set<Doi> dois = new HashSet<>(); + dois.add(new Doi("https://doi.org/10.1093/bib/bbv115")); + dois.add(new Doi("https://doi.org/10.1016/j.biosystems.2011.05.004")); + dois.add(new Doi("https://doi.org/10.1093/nar/gki437")); + dois.add(new Doi("https://doi.org/10.1093/bioinformatics/bti116")); + dois.add(new Doi("https://doi.org/10.1016/j.jmb.2005.09.079")); + dois.add(new Doi("https://doi.org/10.1093/bioinformatics/btg217")); + dois.add(new Doi("https://doi.org/10.1093/bioinformatics/btu760")); + return dois; } } diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/ExtractSubReactionNetwork.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/ExtractSubReactionNetwork.java index 93fd3aa2a..9ed45008a 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/ExtractSubReactionNetwork.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/ExtractSubReactionNetwork.java @@ -22,6 +22,7 @@ import fr.inrae.toulouse.metexplore.met4j_io.jsbml.reader.Met4jSbmlReaderExcepti import fr.inrae.toulouse.metexplore.met4j_mapping.Mapper; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.AbstractMet4jApplication; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.*; +import fr.inrae.toulouse.metexplore.met4j_toolbox.utils.Doi; import org.kohsuke.args4j.Option; import java.io.IOException; @@ -223,7 +224,7 @@ public class ExtractSubReactionNetwork extends AbstractMet4jApplication { } @Override - public String[] getDois() { - return new String[0]; + public Set<Doi> getDois() { + return Set.of(); } } diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/LoadPoint.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/LoadPoint.java index 435851544..be05a91c6 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/LoadPoint.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/LoadPoint.java @@ -13,6 +13,7 @@ import fr.inrae.toulouse.metexplore.met4j_io.jsbml.reader.Met4jSbmlReaderExcepti import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.AbstractMet4jApplication; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.Format; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.ParameterType; +import fr.inrae.toulouse.metexplore.met4j_toolbox.utils.Doi; import org.kohsuke.args4j.Option; import java.io.BufferedReader; @@ -21,6 +22,7 @@ import java.io.FileWriter; import java.io.IOException; import java.util.HashMap; import java.util.Map; +import java.util.Set; import static fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumFormats.*; import static fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumParameterTypes.InputFile; @@ -162,7 +164,7 @@ public class LoadPoint extends AbstractMet4jApplication { } @Override - public String[] getDois() { - return new String[0]; + public Set<Doi> getDois() { + return Set.of(); } } diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/MetaboRank.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/MetaboRank.java index b190ad1ac..86058c9ac 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/MetaboRank.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/MetaboRank.java @@ -56,6 +56,7 @@ import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumFormat import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumParameterTypes; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.Format; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.ParameterType; +import fr.inrae.toulouse.metexplore.met4j_toolbox.utils.Doi; import org.kohsuke.args4j.Option; import java.io.*; @@ -529,7 +530,10 @@ public class MetaboRank extends AbstractMet4jApplication { } @Override - public String[] getDois() { - return new String[]{"https://doi.org/10.1093/bioinformatics/bty577"}; + public Set<Doi> getDois() { + Set<Doi> dois = new HashSet<>(); + dois.add(new Doi("https://doi.org/10.1093/bioinformatics/bty577")); + return dois; } + } \ No newline at end of file diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/NetworkSummary.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/NetworkSummary.java index c1cc6682f..069be1361 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/NetworkSummary.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/NetworkSummary.java @@ -21,6 +21,7 @@ import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.AbstractMet4jApplicati import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumFormats; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.Format; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.ParameterType; +import fr.inrae.toulouse.metexplore.met4j_toolbox.utils.Doi; import org.apache.commons.math3.stat.descriptive.DescriptiveStatistics; import org.kohsuke.args4j.Option; @@ -253,8 +254,8 @@ public class NetworkSummary extends AbstractMet4jApplication { } @Override - public String[] getDois() { - return new String[0]; + public Set<Doi> getDois() { + return Set.of(); } } diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/PathwayNet.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/PathwayNet.java index 958244bec..a65f3f21d 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/PathwayNet.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/PathwayNet.java @@ -27,6 +27,7 @@ import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumFormat import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumParameterTypes; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.Format; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.ParameterType; +import fr.inrae.toulouse.metexplore.met4j_toolbox.utils.Doi; import org.kohsuke.args4j.Option; import java.io.IOException; @@ -171,8 +172,8 @@ public class PathwayNet extends AbstractMet4jApplication { public String getShortDescription() {return "Creation of a Pathway Network representation of a SBML file content";} @Override - public String[] getDois() { - return new String[0]; + public Set<Doi> getDois() { + return Set.of(); } } diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/PrecursorNetwork.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/PrecursorNetwork.java index a18bb05ee..f526215af 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/PrecursorNetwork.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/PrecursorNetwork.java @@ -16,9 +16,11 @@ import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumFormat import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumParameterTypes; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.Format; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.ParameterType; +import fr.inrae.toulouse.metexplore.met4j_toolbox.utils.Doi; import org.kohsuke.args4j.Option; import java.io.IOException; +import java.util.Set; import static fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumFormats.Gml; import static fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumFormats.Sbml; @@ -139,7 +141,7 @@ public class PrecursorNetwork extends AbstractMet4jApplication { } @Override - public String[] getDois() { - return new String[0]; + public Set<Doi> getDois() { + return Set.of(); } } diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/ReactionDistanceMatrix.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/ReactionDistanceMatrix.java index 6590b013f..eb0c0524a 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/ReactionDistanceMatrix.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/ReactionDistanceMatrix.java @@ -21,6 +21,7 @@ import fr.inrae.toulouse.metexplore.met4j_mathUtils.matrix.BioMatrix; import fr.inrae.toulouse.metexplore.met4j_mathUtils.matrix.ExportMatrix; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.AbstractMet4jApplication; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.*; +import fr.inrae.toulouse.metexplore.met4j_toolbox.utils.Doi; import org.kohsuke.args4j.Option; import java.io.IOException; @@ -205,7 +206,7 @@ public class ReactionDistanceMatrix extends AbstractMet4jApplication { } @Override - public String[] getDois() { - return new String[0]; + public Set<Doi> getDois() { + return Set.of(); } } \ No newline at end of file diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/ScopeNetwork.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/ScopeNetwork.java index e50472fd0..a5f2e6fb3 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/ScopeNetwork.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/ScopeNetwork.java @@ -17,9 +17,12 @@ import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumFormat import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumParameterTypes; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.Format; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.ParameterType; +import fr.inrae.toulouse.metexplore.met4j_toolbox.utils.Doi; import org.kohsuke.args4j.Option; import java.io.IOException; +import java.util.HashSet; +import java.util.Set; import static fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumFormats.Gml; import static fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumFormats.Sbml; @@ -153,7 +156,9 @@ public class ScopeNetwork extends AbstractMet4jApplication { } @Override - public String[] getDois() { - return new String[]{"https://doi.org/10.1007/s00239-005-0027-1"}; + public Set<Doi> getDois() { + Set<Doi> dois = new HashSet<>(); + dois.add(new Doi("https://doi.org/10.1007/s00239-005-0027-1")); + return dois; } } diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/SeedsAndTargets.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/SeedsAndTargets.java index 47f99ba26..082e88ead 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/SeedsAndTargets.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/SeedsAndTargets.java @@ -17,10 +17,13 @@ import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumFormat import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumParameterTypes; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.Format; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.ParameterType; +import fr.inrae.toulouse.metexplore.met4j_toolbox.utils.Doi; import org.kohsuke.args4j.Option; import java.io.FileWriter; import java.io.IOException; +import java.util.HashSet; +import java.util.Set; public class SeedsAndTargets extends AbstractMet4jApplication { @@ -205,7 +208,9 @@ public class SeedsAndTargets extends AbstractMet4jApplication { } @Override - public String[] getDois() { - return new String[]{"https://doi.org/10.1073/pnas.0806162105"}; + public Set<Doi> getDois() { + Set<Doi> dois = new HashSet<>(); + dois.add(new Doi("https://doi.org/10.1073/pnas.0806162105")); + return dois; } } diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/SideCompoundsScan.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/SideCompoundsScan.java index 6615f9cfd..426b75c5a 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/SideCompoundsScan.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/SideCompoundsScan.java @@ -13,6 +13,7 @@ import fr.inrae.toulouse.metexplore.met4j_io.jsbml.reader.Met4jSbmlReaderExcepti import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.AbstractMet4jApplication; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.Format; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.ParameterType; +import fr.inrae.toulouse.metexplore.met4j_toolbox.utils.Doi; import org.apache.commons.math3.stat.descriptive.DescriptiveStatistics; import org.kohsuke.args4j.Option; @@ -25,6 +26,7 @@ import static fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.Enu import static fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumParameterTypes.OutputFile; import java.util.HashMap; import java.util.Map; +import java.util.Set; import java.util.function.Function; import java.util.stream.Collectors; @@ -267,7 +269,7 @@ public class SideCompoundsScan extends AbstractMet4jApplication { } @Override - public String[] getDois() { - return new String[0]; + public Set<Doi> getDois() { + return Set.of(); } } diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/TopologicalPathwayAnalysis.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/TopologicalPathwayAnalysis.java index 57451015d..959e179fe 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/TopologicalPathwayAnalysis.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/TopologicalPathwayAnalysis.java @@ -23,14 +23,12 @@ import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumFormat import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumParameterTypes; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.Format; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.ParameterType; +import fr.inrae.toulouse.metexplore.met4j_toolbox.utils.Doi; import org.kohsuke.args4j.Option; import java.io.FileWriter; import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashSet; -import java.util.Map; +import java.util.*; public class TopologicalPathwayAnalysis extends AbstractMet4jApplication { @@ -229,8 +227,8 @@ public class TopologicalPathwayAnalysis extends AbstractMet4jApplication { public String getShortDescription() {return "Run a Topological Pathway Analysis to identify key pathways based on topological properties of its constituting compounds.";} @Override - public String[] getDois() { - return new String[0]; + public Set<Doi> getDois() { + return Set.of(); } } diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/reconstruction/SbmlCheckBalance.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/reconstruction/SbmlCheckBalance.java index 34cd83455..7ca49f4b4 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/reconstruction/SbmlCheckBalance.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/reconstruction/SbmlCheckBalance.java @@ -45,6 +45,7 @@ import fr.inrae.toulouse.metexplore.met4j_reconstruction.check.balance.ReactionB import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.AbstractMet4jApplication; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.Format; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.ParameterType; +import fr.inrae.toulouse.metexplore.met4j_toolbox.utils.Doi; import org.kohsuke.args4j.Option; import java.io.FileWriter; @@ -157,7 +158,8 @@ public class SbmlCheckBalance extends AbstractMet4jApplication { } @Override - public String[] getDois() { - return new String[0]; + public Set<Doi> getDois() { + return Set.of(); } + } -- GitLab From e29945d71c512e0dc8673e80184b31793db85a7f Mon Sep 17 00:00:00 2001 From: lcottret <ludovic.cottret@inrae.fr> Date: Mon, 25 Nov 2024 15:43:20 +0100 Subject: [PATCH 5/8] change met4j-toolbox README with GenerateDoc --- met4j-toolbox/README.md | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/met4j-toolbox/README.md b/met4j-toolbox/README.md index 0d014113e..fb0340938 100644 --- a/met4j-toolbox/README.md +++ b/met4j-toolbox/README.md @@ -111,7 +111,6 @@ sudo docker pull metexplore/met4j:develop If you want to build by yourself the docker image: ```console -mvn clean install cd met4j-toolbox mvn package cd ../ @@ -121,15 +120,7 @@ sudo docker build -t metexplore/met4j:myversion . To list all the apps: ```console -sudo docker run metexplore/met4j:latest -``` - -To run an app, you have to specify the full name of the app, -with the last part of the package name and the app name separated by a dot. -For instance: - -```console -sudo docker run metexplore/met4j:latest convert.Tab2Sbml -h +sudo docker run metexplore/met4j:latest met4j.sh ``` Don't forget to map volumes when you want to process local files. @@ -137,10 +128,18 @@ Example: ```console sudo docker run -v /home/lcottret/work:/work \ - metexplore/met4j:latest convert.Sbml2Tab \ + metexplore/met4j:latest met4j.sh convert.Sbml2Tab \ -in /work/toy_model.xml -out /work/toy_model.tsv ``` +If you change the working directory, you have to specify "sh /usr/bin/met4j.sh": + +```console +sudo docker run -w /work -v /home/lcottret/work:/work \ + metexplore/met4j:latest sh /usr/bin/met4j.sh convert.Sbml2Tab \ + -in toy_model.xml -out toy_model.tsv +``` + ### Galaxy instance [Galaxy](https://galaxyproject.org/) wrappers for met4j-toolbox apps are available in the [Galaxy toolshed](https://toolshed.g2.bx.psu.edu/) (master version) and in the [Galaxy test toolsdhed](https://testtoolshed.g2.bx.psu.edu/) (develop version). @@ -476,7 +475,7 @@ Wrappers launch the met4j singularity container, so the server where your Galaxy -skip N : [0] Number of lines to skip at the beginning of the compound file (default: 0) </code></pre></details></td></tr> -<tr><td>ORApathwayEnrichment</td><td>Perform Over Representation Analysis for Pathway Enrichment, using one-tailed exact Fisher Test.<br/>The fisher exact test compute the probability p to randomly get the given set of value. <br/>This version compute the probability to get at least the given overlap between the given set and the given modality :<br/>Sum the hypergeometric probability with increasing target/query intersection cardinality.<br/><br/>The hypergeometric probability is computed from the following contingency table entries.<br/>(value in cells correspond to the marginal totals of each intersection groups)<br/> Query !Query<br/> Target a b<br/> !Target c d<br/><br/>The probability of obtaining the set of value is computed as following:<br/>p = ((a+b)!(c+d)!(a+c)!(b+d)!)/(a!b!c!d!(a+b+c+d)!)<br/><br/>The obtained p-value is then adjusted for multiple testing using one of the following methods:<br/> - Bonferroni: adjusted p-value = p*n<br/> - Benjamini-Hochberg: adjusted p-value = p*n/k<br/> - Holm-Bonferroni: adjusted p-value = p*(n+1-k)<br/>n : number of tests; k : pvalue rank<details><summary><small>more</small></summary>Perform Over Representation Analysis for Pathway Enrichment, using one-tailed exact Fisher Test.<br/><br/><pre><code> -c (--correction) [Bonferroni | : Method for multiple testing p-value +<tr><td>ORApathwayEnrichment</td><td>Perform Over Representation Analysis for Pathway Enrichment, using one-tailed exact Fisher Test.<details><summary><small>more</small></summary>Perform Over Representation Analysis for Pathway Enrichment, using one-tailed exact Fisher Test.<br/>The fisher exact test compute the probability p to randomly get the given set of value. <br/>This version compute the probability to get at least the given overlap between the given set and the given modality :<br/>Sum the hypergeometric probability with increasing target/query intersection cardinality.<br/><br/>The hypergeometric probability is computed from the following contingency table entries.<br/>(value in cells correspond to the marginal totals of each intersection groups)<br/> Query !Query<br/> Target a b<br/> !Target c d<br/><br/>The probability of obtaining the set of value is computed as following:<br/>p = ((a+b)!(c+d)!(a+c)!(b+d)!)/(a!b!c!d!(a+b+c+d)!)<br/><br/>The obtained p-value is then adjusted for multiple testing using one of the following methods:<br/> - Bonferroni: adjusted p-value = p*n<br/> - Benjamini-Hochberg: adjusted p-value = p*n/k<br/> - Holm-Bonferroni: adjusted p-value = p*(n+1-k)<br/>n : number of tests; k : pvalue rank<br/><br/><pre><code> -c (--correction) [Bonferroni | : Method for multiple testing p-value BenjaminiHochberg | HolmBonferroni] adjustment. (default: BenjaminiHochber g) -h : prints the help (default: false) @@ -536,7 +535,7 @@ Wrappers launch the met4j singularity container, so the server where your Galaxy false) -un (--undirected) : create as undirected (default: false) </code></pre></details></td></tr> -<tr><td>ChemSimilarityWeighting</td><td>Provides tabulated compound graph edge list, with one column with reactant pair's chemical similarity.<details><summary><small>more</small></summary>Provides tabulated compound graph edge list, with one column with reactant pair's chemical similarity.Chemical similarity has been proposed as edge weight for finding meaningful paths in metabolic networks, using shortest (lightest) path search. See McSha et al. 2003 (https://doi.org/10.1093/bioinformatics/btg217), Rahman et al. 2005 (https://doi.org/10.1093/bioinformatics/bti116) and Pertusi et al. 2014 (https://doi.org/10.1093/bioinformatics/btu760)<br/><br/><pre><code> -d (--asDist) : Use distance rather than similarity +<tr><td>ChemSimilarityWeighting</td><td>Provides tabulated compound graph edge list, with one column with reactant pair's chemical similarity.<details><summary><small>more</small></summary>Provides tabulated compound graph edge list, with one column with reactant pair's chemical similarity.Chemical similarity has been proposed as edge weight for finding meaningful paths in metabolic networks, using shortest (lightest) path search.<br/><br/>References:<br/><a href="https://doi.org/10.1093/bioinformatics/bti116">Rahman et al.; Metabolic pathway analysis web service (Pathway Hunter Tool at CUBIC); Bioinformatics; 2005</a><br/><a href="https://doi.org/10.1093/bioinformatics/btg217">McShan et al.; PathMiner: predicting metabolic pathways by heuristic search; Bioinformatics; 2003</a><br/><a href="https://doi.org/10.1093/bioinformatics/btu760">Pertusi et al.; Efficient searching and annotation of metabolic networks using chemical similarity; Bioinformatics; 2015</a><br/><br/><br/><pre><code> -d (--asDist) : Use distance rather than similarity (default: false) -f (--fingerprint) [EState | Extended : The chemical fingerprint to use | KlekotaRoth | MACCS | PubChem] (default: Extended) @@ -571,7 +570,7 @@ Wrappers launch the met4j singularity container, so the server where your Galaxy (default: false) -un (--undirected) : create as undirected (default: false) </code></pre></details></td></tr> -<tr><td>ChokePoint</td><td>Compute the Choke points of a metabolic network.<details><summary><small>more</small></summary>Compute the Choke points of a metabolic network.<br/>Choke points constitute an indicator of lethality and can help identifying drug target Choke points are reactions that are required to consume or produce one compound. Targeting of choke point can lead to the accumulation or the loss of some metabolites, thus choke points constitute an indicator of lethality and can help identifying drug target <br/>See : Syed Asad Rahman, Dietmar Schomburg; Observing local and global properties of metabolic pathways: ‘load points’ and ‘choke points’ in the metabolic networks. Bioinformatics 2006; 22 (14): 1767-1774. doi: 10.1093/bioinformatics/btl181<br/><br/><pre><code> -h : prints the help (default: false) +<tr><td>ChokePoint</td><td>Compute the Choke points of a metabolic network.<details><summary><small>more</small></summary>Compute the Choke points of a metabolic network.<br/>Choke points constitute an indicator of lethality and can help identifying drug target Choke points are reactions that are required to consume or produce one compound. Targeting of choke point can lead to the accumulation or the loss of some metabolites, thus choke points constitute an indicator of lethality and can help identifying drug target.<br/><br/>References:<br/><a href="https://doi.org/10.1093/bioinformatics/btl181">Rahman et al.; Observing local and global properties of metabolic pathways: ‘load points’ and ‘choke points’ in the metabolic networks; Bioinformatics; 2006</a><br/><br/><br/><pre><code> -h : prints the help (default: false) -i VAL : input SBML file -o VAL : output results file </code></pre></details></td></tr> @@ -602,7 +601,7 @@ Wrappers launch the met4j singularity container, so the server where your Galaxy (default: false) -un (--undirected) : create as undirected (default: false) </code></pre></details></td></tr> -<tr><td>DegreeWeighting</td><td>Provides tabulated compound graph edge list, with one column with target's degree.<details><summary><small>more</small></summary>Provides tabulated compound graph edge list, with one column with target's degree.Degree has been proposed as edge weight for finding meaningful paths in metabolic networks, using shortest (lightest) path search. See Croes et al. 2006 (https://doi.org/10.1016/j.jmb.2005.09.079) and Croes et al. 2005 (https://doi.org/10.1093/nar/gki437)<br/><br/><pre><code> -h : prints the help (default: false) +<tr><td>DegreeWeighting</td><td>Provides tabulated compound graph edge list, with one column with target's degree.<details><summary><small>more</small></summary>Provides tabulated compound graph edge list, with one column with target's degree.Degree has been proposed as edge weight for finding meaningful paths in metabolic networks, using shortest (lightest) path search.<br/><br/>References:<br/><a href="https://doi.org/10.1016/j.jmb.2005.09.079">Croes et al.; Inferring Meaningful Pathways in Weighted Metabolic Networks; Journal of Molecular Biology; 2006</a><br/><br/><br/><pre><code> -h : prints the help (default: false) -mc (--mergecomp) [no | by_name | : merge compartments. Use names if by_id] consistent and unambiguous across compartments, or identifiers if @@ -655,7 +654,7 @@ Wrappers launch the met4j singularity container, so the server where your Galaxy (default: false) -u (--undirected) : Ignore reaction direction (default: false) </code></pre></details></td></tr> -<tr><td>ExtractSubNetwork</td><td>Create a subnetwork from a GSMN in SBML format, and two files containing lists of compounds of interests ids, one per row.<details><summary><small>more</small></summary>Create a subnetwork from a GSMN in SBML format, and two files containing lists of compounds of interests ids, one per row.<br/>The subnetwork correspond to part of the network that connects compounds from the first list to compounds from the second list.<br/>Sources and targets list can have elements in common. The connecting part can be defined as the union of shortest or k-shortest paths between sources and targets, or the Steiner tree connecting them. The relevance of considered path can be increased by weighting the edges using degree squared, chemical similarity (require InChI or SMILES annotations) or any provided weighting.<br/><br/>See previous works on subnetwork extraction for parameters recommendations:Frainay, C., & Jourdan, F. Computational methods to identify metabolic sub-networks based on metabolomic profiles. Bioinformatics 2016;1–14. https://doi.org/10.1093/bib/bbv115<br/>Faust, K., Croes, D., & van Helden, J. Prediction of metabolic pathways from genome-scale metabolic networks. Bio Systems 2011;105(2), 109–121. https://doi.org/10.1016/j.biosystems.2011.05.004<br/>Croes D, Couche F, Wodak SJ, et al. Metabolic PathFinding: inferring relevant pathways in biochemical networks. Nucleic Acids Res 2005;33:W326–30.<br/>Croes D, Couche F, Wodak SJ, et al. Inferring meaningful pathways in weighted metabolic networks. J Mol Biol 2006; 356:222–36.<br/>Rahman SA, Advani P, Schunk R, et al. Metabolic pathway analysis web service (Pathway Hunter Tool at CUBIC). Bioinformatics 2005;21:1189–93.<br/>Pertusi DA, Stine AE, Broadbelt LJ, et al. Efficient searching and annotation of metabolic networks using chemical similarity. Bioinformatics 2014;1–9.<br/>McShan DC, Rao S, Shah I. PathMiner: predicting metabolic pathways by heuristic search. Bioinformatics 2003;19:1692–8.<br/><br/><br/><pre><code> -cw (--customWeights) VAL : an optional file containing weights for compound +<tr><td>ExtractSubNetwork</td><td>Create a subnetwork from a GSMN in SBML format, and two files containing lists of compounds of interests ids, one per row.<details><summary><small>more</small></summary>Create a subnetwork from a GSMN in SBML format, and two files containing lists of compounds of interests ids, one per row.<br/>The subnetwork correspond to part of the network that connects compounds from the first list to compounds from the second list.<br/>Sources and targets list can have elements in common. The connecting part can be defined as the union of shortest or k-shortest paths between sources and targets, or the Steiner tree connecting them. The relevance of considered path can be increased by weighting the edges using degree squared, chemical similarity (require InChI or SMILES annotations) or any provided weighting.<br/><br/>See previous works on subnetwork extraction for parameters recommendations.<br/><br/>References:<br/><a href="https://doi.org/10.1016/j.biosystems.2011.05.004">Faust et al.; Prediction of metabolic pathways from genome-scale metabolic networks; Biosystems; 2011</a><br/><a href="https://doi.org/10.1093/nar/gki437">Croes et al.; Metabolic PathFinding: inferring relevant pathways in biochemical networks; Nucleic Acids Research; 2005</a><br/><a href="https://doi.org/10.1093/bioinformatics/bti116">Rahman et al.; Metabolic pathway analysis web service (Pathway Hunter Tool at CUBIC); Bioinformatics; 2005</a><br/><a href="https://doi.org/10.1016/j.jmb.2005.09.079">Croes et al.; Inferring Meaningful Pathways in Weighted Metabolic Networks; Journal of Molecular Biology; 2006</a><br/><a href="https://doi.org/10.1093/bioinformatics/btg217">McShan et al.; PathMiner: predicting metabolic pathways by heuristic search; Bioinformatics; 2003</a><br/><a href="https://doi.org/10.1093/bioinformatics/btu760">Pertusi et al.; Efficient searching and annotation of metabolic networks using chemical similarity; Bioinformatics; 2015</a><br/><a href="https://doi.org/10.1093/bib/bbv115">Frainay et al.; Computational methods to identify metabolic sub-networks based on metabolomic profiles; Briefings in Bioinformatics; 2017</a><br/><br/><br/><pre><code> -cw (--customWeights) VAL : an optional file containing weights for compound pairs -dw (--degreeWeights) : penalize traversal of hubs by using degree square weighting (default: false) @@ -697,7 +696,7 @@ Wrappers launch the met4j singularity container, so the server where your Galaxy -o VAL : output results file -s (--side) VAL : an optional file containing list of side compounds to ignore </code></pre></details></td></tr> -<tr><td>MetaboRank</td><td>Compute the MetaboRank, a custom personalized PageRank for metabolic network.<details><summary><small>more</small></summary>Compute the MetaboRank, a custom personalized PageRank for metabolic network.<br/>The MetaboRank takes a metabolic network and a list of compounds of interest, and provide a score of relevance for all of the other compounds in the network.<br/>The MetaboRank can, from metabolomics results, be used to fuel a recommender system highlighting interesting compounds to investigate, retrieve missing identification and drive literature mining.<br/>It is a two dimensional centrality computed from personalized PageRank and CheiRank, with special transition probability and normalization to handle the specificities of metabolic networks.<br/>For convenience, a one dimensional centrality rank is also computed from the highest rank from PageRank or CheiRank, and using lowest rank as tie-breaker.<br/>See publication for more information: Frainay et al. MetaboRank: network-based recommendation system to interpret and enrich metabolomics results, Bioinformatics (35-2), https://doi.org/10.1093/bioinformatics/bty577<br/><br/><pre><code> -d N : damping factor (default: 0.85) +<tr><td>MetaboRank</td><td>Compute the MetaboRank, a custom personalized PageRank for metabolic network.<details><summary><small>more</small></summary>Compute the MetaboRank, a custom personalized PageRank for metabolic network.<br/>The MetaboRank takes a metabolic network and a list of compounds of interest, and provide a score of relevance for all of the other compounds in the network.<br/>The MetaboRank can, from metabolomics results, be used to fuel a recommender system highlighting interesting compounds to investigate, retrieve missing identification and drive literature mining.<br/>It is a two dimensional centrality computed from personalized PageRank and CheiRank, with special transition probability and normalization to handle the specificities of metabolic networks.<br/>For convenience, a one dimensional centrality rank is also computed from the highest rank from PageRank or CheiRank, and using lowest rank as tie-breaker.<br/>See publication for more information.<br/><br/>References:<br/><a href="https://doi.org/10.1093/bioinformatics/bty577">Frainay et al.; MetaboRank: network-based recommendation system to interpret and enrich metabolomics results; Bioinformatics; 2019</a><br/><br/><br/><pre><code> -d N : damping factor (default: 0.85) -h : prints the help (default: false) -i VAL : input SBML file: path to network used for computing centrality, in sbml format. @@ -761,7 +760,7 @@ Wrappers launch the met4j singularity container, so the server where your Galaxy -u (--undirected) : Ignore reaction direction (default: false) -w (--weights) VAL : an optional file containing weights for compound pairs </code></pre></details></td></tr> -<tr><td>ScopeNetwork</td><td>Perform a network expansion from a set of compound seeds to create a scope network<details><summary><small>more</small></summary>Perform a network expansion from a set of compound seeds to create a scope network<br/>The scope of a set of compounds (seed) refer to the maximal metabolic network that can be extended from them,where the extension process consist of adding a reaction to the network if and only if all of its substrates are either a seed or a product of a previously added reaction<br/>For more information, see Handorf, Ebenhöh and Heinrich (2005). *Expanding metabolic networks: scopes of compounds, robustness, and evolution.* Journal of molecular evolution, 61(4), 498-512. (https://doi.org/10.1007/s00239-005-0027-1)<br/><br/><pre><code> -h : prints the help (default: false) +<tr><td>ScopeNetwork</td><td>Perform a network expansion from a set of compound seeds to create a scope network<details><summary><small>more</small></summary>Perform a network expansion from a set of compound seeds to create a scope network<br/>The scope of a set of compounds (seed) refer to the maximal metabolic network that can be extended from them,where the extension process consist of adding a reaction to the network if and only if all of its substrates are either a seed or a product of a previously added reaction<br/><br/>References:<br/><a href="https://doi.org/10.1007/s00239-005-0027-1">Handorf et al.; Expanding Metabolic Networks: Scopes of Compounds, Robustness, and Evolution; Journal of Molecular Evolution; 2005</a><br/><br/><br/><pre><code> -h : prints the help (default: false) -i VAL : input SBML file: path to network used for computing scope, in sbml format. -ir (--ignore) VAL : an optional file containing list of reaction to ignore @@ -778,7 +777,7 @@ Wrappers launch the met4j singularity container, so the server where your Galaxy (default: false) -tab (--asTable) : Export in tabulated file instead of .GML (default: false) </code></pre></details></td></tr> -<tr><td>SeedsAndTargets</td><td>Identify exogenously acquired compounds, producible compounds exogenously available and/or dead ends metabolites from metabolic network topology<details><summary><small>more</small></summary>Identify exogenously acquired compounds, producible compounds exogenously available and/or dead ends metabolites from metabolic network topology. Metabolic seeds and targets are useful for identifying medium requirements and metabolic capability, and thus enable analysis of metabolic ties within communities of organisms.<br/>This application can use seed definition and SCC-based detection algorithm by Borenstein et al. or, alternatively, degree-based sink and source detection with compartment adjustment.<br/>The first method (see Borenstein et al. 2008 Large-scale reconstruction and phylogenetic analysis of metabolic environments https://doi.org/10.1073/pnas.0806162105) consider strongly connected components rather than individual nodes, thus, members of cycles can be considered as seed. A sink from an external compartment can however be connected to a non sink internal counterpart, thus highlighting what could end up in the external compartment rather than what must be exported.<br/>The second approach is neighborhood based and identify sources and sinks. Since "real" sinks and sources in intracellular compartment(s) may be involved in transport/exchange reactions reversible by default, thus not allowing extracellular source or sink, an option allows to take the degree (minus extracellular neighbors) of intracellular counterparts.<br/><br/><pre><code> -!s (--notSeed) : export nodes that are not seed (default: false) +<tr><td>SeedsAndTargets</td><td>Identify exogenously acquired compounds, producible compounds exogenously available and/or dead ends metabolites from metabolic network topology<details><summary><small>more</small></summary>Identify exogenously acquired compounds, producible compounds exogenously available and/or dead ends metabolites from metabolic network topology. Metabolic seeds and targets are useful for identifying medium requirements and metabolic capability, and thus enable analysis of metabolic ties within communities of organisms.<br/>This application can use seed definition and SCC-based detection algorithm by Borenstein et al. or, alternatively, degree-based sink and source detection with compartment adjustment.<br/>The first method (see Borenstein et al. 2008 Large-scale reconstruction and phylogenetic analysis of metabolic environments https://doi.org/10.1073/pnas.0806162105) consider strongly connected components rather than individual nodes, thus, members of cycles can be considered as seed. A sink from an external compartment can however be connected to a non sink internal counterpart, thus highlighting what could end up in the external compartment rather than what must be exported.<br/>The second approach is neighborhood based and identify sources and sinks. Since "real" sinks and sources in intracellular compartment(s) may be involved in transport/exchange reactions reversible by default, thus not allowing extracellular source or sink, an option allows to take the degree (minus extracellular neighbors) of intracellular counterparts.<br/><br/>References:<br/><a href="https://doi.org/10.1073/pnas.0806162105">Borenstein et al.; Large-scale reconstruction and phylogenetic analysis of metabolic environments; Proceedings of the National Academy of Sciences; 2008</a><br/><br/><br/><pre><code> -!s (--notSeed) : export nodes that are not seed (default: false) -!t (--notTarget) : export nodes that are not targets (default: false) -B (--useBorensteinAlg) : use Borenstein Algorithm. Please cite Borenstein et al. 2008 Large-scale reconstruction and phylogenetic -- GitLab From 7776e379d77fa138b049b23c8a2829f5a6905caf Mon Sep 17 00:00:00 2001 From: lcottret <ludovic.cottret@inrae.fr> Date: Tue, 26 Nov 2024 08:02:20 +0100 Subject: [PATCH 6/8] fetch doi details only when needed --- .../metexplore/met4j_toolbox/GenerateDoc.java | 9 +- .../generic/AbstractMet4jApplication.java | 121 +++++++----------- .../metexplore/met4j_toolbox/utils/Doi.java | 100 +++++++++++++-- 3 files changed, 137 insertions(+), 93 deletions(-) diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/GenerateDoc.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/GenerateDoc.java index 2395dd985..33d28d2c4 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/GenerateDoc.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/GenerateDoc.java @@ -55,6 +55,8 @@ import java.util.Set; /** * generate doc by creating a html table with name and description of each app * + * Be careful, network is needed to crete the references from dois + * * @author cfrainay * @version $Id: $Id */ @@ -254,11 +256,7 @@ public class GenerateDoc { return baos.toString(java.nio.charset.StandardCharsets.UTF_8); } - /** - * <p>main.</p> - * - * @param args an array of {@link java.lang.String} objects. - */ + public static void main(String[] args) { try { @@ -337,6 +335,7 @@ public class GenerateDoc { apps.get(packageName).put(id, desc); } catch (Exception e) { + e.printStackTrace(); System.err.println("no description set for " + id); } } catch (Exception e1) { diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/generic/AbstractMet4jApplication.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/generic/AbstractMet4jApplication.java index 95842f599..df51926f3 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/generic/AbstractMet4jApplication.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/generic/AbstractMet4jApplication.java @@ -39,16 +39,15 @@ package fr.inrae.toulouse.metexplore.met4j_toolbox.generic; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.Format; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.ParameterType; import fr.inrae.toulouse.metexplore.met4j_toolbox.utils.Doi; +import org.apache.maven.model.Model; +import org.apache.maven.model.io.xpp3.MavenXpp3Reader; +import org.codehaus.plexus.util.xml.pull.XmlPullParserException; +import org.hibernate.validator.constraints.Range; import org.json.simple.JSONArray; import org.json.simple.JSONObject; import org.kohsuke.args4j.CmdLineException; import org.kohsuke.args4j.CmdLineParser; import org.kohsuke.args4j.Option; -import org.hibernate.validator.constraints.Range; - -import org.apache.maven.model.Model; -import org.apache.maven.model.io.xpp3.MavenXpp3Reader; -import org.codehaus.plexus.util.xml.pull.XmlPullParserException; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; @@ -59,17 +58,21 @@ import javax.xml.XMLConstants; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.*; +import javax.xml.transform.OutputKeys; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; -import java.io.*; +import java.io.File; +import java.io.FileReader; +import java.io.IOException; +import java.io.InputStreamReader; import java.lang.annotation.Annotation; import java.lang.reflect.Field; import java.util.*; import java.util.stream.Collectors; -import static fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumParameterTypes.OutputFile; - /** * <p>Abstract AbstractMet4jApplication class.</p> * @@ -83,6 +86,23 @@ public abstract class AbstractMet4jApplication { @Option(name = "-h", usage = "prints the help", required = false) private Boolean h = false; + public static String getVersion() throws IOException, XmlPullParserException { + MavenXpp3Reader reader = new MavenXpp3Reader(); + Model model; + if ((new File("pom.xml")).exists()) + model = reader.read(new FileReader("pom.xml")); + else + model = reader.read( + new InputStreamReader( + AbstractMet4jApplication.class.getResourceAsStream( + "/META-INF/maven/fr.inrae.toulouse.metexplore/met4j-toolbox/pom.xml" + ) + ) + ); + + return model.getVersion().replace("-SNAPSHOT", ""); + } + /** * Inits the options from the field annotations * @@ -147,8 +167,7 @@ public abstract class AbstractMet4jApplication { map.put("default", defaultValue); for (Annotation a : f.getDeclaredAnnotations()) { - if (a instanceof Option) { - Option option = (Option) a; + if (a instanceof Option option) { map.put("label", option.usage()); @@ -165,8 +184,7 @@ public abstract class AbstractMet4jApplication { optional = "false"; } map.put("optional", optional); - } else if (a instanceof Range) { - Range option = (Range) a; + } else if (a instanceof Range option) { map.put("min", Double.toString(option.min())); map.put("max", Double.toString(option.max())); @@ -174,7 +192,7 @@ public abstract class AbstractMet4jApplication { } else if (a instanceof ParameterType) { String parameterType = ((ParameterType) a).name().toString().toLowerCase(); map.put("type", parameterType); - if(parameterType.startsWith("output")) { + if (parameterType.startsWith("output")) { map.put("output", "true"); } } else if (a instanceof Format) { @@ -204,9 +222,9 @@ public abstract class AbstractMet4jApplication { parameters.addAll(options); JSONObject jsonObject = new JSONObject(); - jsonObject.put("name", new String(this.getLabel())); - jsonObject.put("description", new String(this.getLongDescription())); - jsonObject.put("short_description", new String(this.getShortDescription())); + jsonObject.put("name", this.getLabel()); + jsonObject.put("description", this.getLongDescription()); + jsonObject.put("short_description", this.getShortDescription()); jsonObject.put("java_class", this.getClass().getSimpleName()); String simplePackageName = this.getSimplePackageName(); @@ -223,13 +241,12 @@ public abstract class AbstractMet4jApplication { public String getSimplePackageName() { String packageName = this.getClass().getPackage().getName(); - String tab[] = packageName.split("\\."); + String[] tab = packageName.split("\\."); String simplePackageName = tab[tab.length - 1]; return simplePackageName; } - public void xmlGalaxyWrapper(String outputDirectory, GalaxyPackageType packageType, String version) throws ParserConfigurationException, XmlPullParserException, IOException, IllegalAccessException, TransformerException, SAXException { String packageName = this.getSimplePackageName(); @@ -278,39 +295,12 @@ public abstract class AbstractMet4jApplication { NodeList citationsTags = doc.getElementsByTagName("citations"); - if(citationsTags.getLength() == 0) { + if (citationsTags.getLength() == 0) { citationsTag = citationsTags.item(0); - } - else { + } else { citationsTag = doc.createElement("citations"); } - // Check each dois in dois to see if it's already citationList - // If not present, add it in citationList - - Set<Doi> dois = this.getDois(); - - for (Doi doi : dois) { - Boolean doiExists = false; - - String doiContent = doi.getDoi(); - for (int i = 0; i < citationList.getLength(); i++) { - Node node = citationList.item(i); - if (node.getTextContent().equals(doi)) { - doiExists = true; - } - } - if (!doiExists) { - Element citation = doc.createElement("citation"); - citation.setAttribute("type", "doi"); - citation.setTextContent(doi.getDoi()); - citationsTag.appendChild(citation); - } - } - - if (citationList.getLength() > 0) { - citationExists = true; - } } this.initOptions(); @@ -458,14 +448,15 @@ public abstract class AbstractMet4jApplication { help.appendChild(cHelp); root.appendChild(help); + Element citations = document.createElement("citations"); - root.appendChild(citationsTag); + root.appendChild(citations); - if (citationExists) { - for (int i = 0; i < citationList.getLength(); i++) { - Node newNode = document.importNode(testList.item(i), true); - citations.appendChild(newNode); - } + for (Doi doi : this.getDois()) { + Element citation = document.createElement("citation"); + citation.setAttribute("type", "doi"); + citation.setTextContent(doi.getDoi()); + citations.appendChild(citation); } document.appendChild(root); @@ -506,7 +497,6 @@ public abstract class AbstractMet4jApplication { return param; } - private List<HashMap<String, String>> getInputOptions() { return this.options.stream().filter(o -> !o.containsKey("type") || !o.get("type").equals("outputfile")).collect(Collectors.toList()); } @@ -515,23 +505,6 @@ public abstract class AbstractMet4jApplication { return this.options.stream().filter(o -> !o.containsKey("type") || o.get("type").equals("outputfile")).collect(Collectors.toList()); } - public static String getVersion() throws IOException, XmlPullParserException { - MavenXpp3Reader reader = new MavenXpp3Reader(); - Model model; - if ((new File("pom.xml")).exists()) - model = reader.read(new FileReader("pom.xml")); - else - model = reader.read( - new InputStreamReader( - AbstractMet4jApplication.class.getResourceAsStream( - "/META-INF/maven/fr.inrae.toulouse.metexplore/met4j-toolbox/pom.xml" - ) - ) - ); - - return model.getVersion().replace("-SNAPSHOT", ""); - } - /** * <p>getLabel.</p> * @@ -594,7 +567,7 @@ public abstract class AbstractMet4jApplication { try { parser.parseArgument(args); } catch (CmdLineException e) { - if (this.h == false) { + if (!this.h) { this.printShortHeader(); System.err.println("Error in arguments"); parser.printUsage(System.err); @@ -606,7 +579,7 @@ public abstract class AbstractMet4jApplication { } } - if (this.h == true) { + if (this.h) { this.printLongHeader(); parser.printUsage(System.err); System.exit(0); diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/utils/Doi.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/utils/Doi.java index f477f4b6c..35150c0fa 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/utils/Doi.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/utils/Doi.java @@ -36,17 +36,21 @@ package fr.inrae.toulouse.metexplore.met4j_toolbox.utils; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; + import java.io.BufferedReader; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.URL; import java.util.ArrayList; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParser; - +/** + * The Doi class represents a Digital Object Identifier (DOI) and fetches + * publication details associated with the DOI from the CrossRef API. + */ public class Doi { private final String doi; @@ -56,12 +60,21 @@ public class Doi { private String authors; private ArrayList<String> authorList; + /** + * Constructs a Doi object and extracts the DOI from the provided URL. + * + * @param doi The DOI or URL containing the DOI. + */ public Doi(String doi) { this.doi = doi.replace("https://doi.org/", ""); - this.setPublicationDetails(); } - private void setPublicationDetails() { + /** + * Fetches publication details from the CrossRef API and populates the class fields. + * Throws RuntimeException if the API response code is not 200. + * Logs other exceptions as "Doi not reachable." + */ + public void fetchPublicationDetails() { String apiUrl = "https://api.crossref.org/works/" + doi; try { @@ -96,7 +109,7 @@ public class Doi { for (JsonElement authorElement : authors) { JsonObject author = authorElement.getAsJsonObject(); - String authorEntry = author.get("given")+" "+author.get("family"); + String authorEntry = author.get("given") + " " + author.get("family"); authorList.add(authorEntry.replace("\"", "")); index++; } @@ -112,35 +125,94 @@ public class Doi { } } + /** + * Returns the title of the publication. Fetches the details if not already done. + * + * @return The title of the publication. + */ public String getTitle() { + if (title == null) { + this.fetchPublicationDetails(); + } return title; } + /** + * Returns the journal name of the publication. Fetches the details if not already done. + * + * @return The journal name of the publication. + */ public String getJournal() { + if (journal == null) { + this.fetchPublicationDetails(); + } return journal; } + /** + * Returns the publication date. Fetches the details if not already done. + * + * @return The publication date. + */ public String getDate() { + if (date == null) { + this.fetchPublicationDetails(); + } return date; } + /** + * Returns the authors of the publication as a single string. Fetches the details if not already done. + * + * @return The authors of the publication. + */ public String getAuthors() { + if (authors == null) { + this.fetchPublicationDetails(); + } return authors; } + /** + * Returns the list of authors. Fetches the details if not already done. + * + * @return The list of authors. + */ + public ArrayList<String> getAuthorList() { + if (authorList == null) { + this.fetchPublicationDetails(); + } + return authorList; + } + + /** + * Returns a complete reference of the publication including authors, title, journal, and date. + * + * @return The complete reference of the publication. + */ public String getCompleteReference() { - return authors + "; " + title + "; " + journal + "; "+ date; + return this.getAuthors() + "; " + this.getTitle() + "; " + this.getJournal() + "; " + this.getDate(); } + /** + * Returns an abbreviated reference with the first author's last name, "et al.", + * title, journal, and date. + * + * @return The abbreviated reference of the publication. + */ public String getAbbreviatedReference() { + String firstAuthor = this.getAuthorList().get(0); + String[] detailsFirstAuthor = firstAuthor.split("\s"); + String lastName = detailsFirstAuthor[detailsFirstAuthor.length - 1]; - String firstAuthor = authorList.get(0); - String detailsFirstAuthor[] = firstAuthor.split("\s"); - String lastName = detailsFirstAuthor[detailsFirstAuthor.length-1]; - - return lastName+" et al.; " + title + "; " + journal+ "; "+ date; + return lastName + " et al.; " + this.getTitle() + "; " + this.getJournal() + "; " + this.getDate(); } + /** + * Returns the DOI of the publication. + * + * @return The DOI of the publication. + */ public String getDoi() { return doi; } -- GitLab From 3bec05b2ba524a51affd93d68fdb372dd765d271 Mon Sep 17 00:00:00 2001 From: Clement Frainay <clement.frainay@inra.fr> Date: Wed, 4 Dec 2024 10:30:52 +0100 Subject: [PATCH 7/8] handle offline mode: default behaviour if api not responding --- .../metexplore/met4j_toolbox/utils/Doi.java | 70 +++++++++++-------- 1 file changed, 39 insertions(+), 31 deletions(-) diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/utils/Doi.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/utils/Doi.java index 35150c0fa..edb72d28b 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/utils/Doi.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/utils/Doi.java @@ -40,6 +40,7 @@ import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParser; +import org.apache.commons.lang3.StringUtils; import java.io.BufferedReader; import java.io.InputStreamReader; @@ -59,6 +60,9 @@ public class Doi { private String date; private String authors; private ArrayList<String> authorList; + private final String url; + + private boolean detailsRetrieved = false; /** * Constructs a Doi object and extracts the DOI from the provided URL. @@ -66,7 +70,13 @@ public class Doi { * @param doi The DOI or URL containing the DOI. */ public Doi(String doi) { - this.doi = doi.replace("https://doi.org/", ""); + String normalizedDoi = StringUtils.replaceIgnoreCase(doi,"https://doi.org/", "",1); + normalizedDoi = StringUtils.replaceIgnoreCase(normalizedDoi,"http:/dx.doi.org/", "",1); + normalizedDoi = StringUtils.replaceIgnoreCase(normalizedDoi,"doi:", "",1); + this.doi=normalizedDoi; + if(!this.doi.matches("10\\.[\\d\\.]+/.+")) throw new IllegalArgumentException("invalid DOI : "+this.doi); + this.url = "https://doi.org/"+this.getDoi(); + this.fetchPublicationDetails(); } /** @@ -103,7 +113,7 @@ public class Doi { String date = message.getAsJsonObject("published-print").getAsJsonArray("date-parts").get(0).getAsJsonArray().get(0).getAsString(); JsonArray authors = message.getAsJsonArray("author"); - ArrayList authorList = new ArrayList(); + ArrayList<String> authorList = new ArrayList<>(); int index = 0; @@ -119,6 +129,7 @@ public class Doi { this.date = date; this.authors = String.join(", ", authorList); this.authorList = authorList; + this.detailsRetrieved = true; } catch (Exception e) { System.err.println("Doi not reachable"); @@ -126,86 +137,75 @@ public class Doi { } /** - * Returns the title of the publication. Fetches the details if not already done. + * Returns the title of the publication. * * @return The title of the publication. */ public String getTitle() { - if (title == null) { - this.fetchPublicationDetails(); - } return title; } /** - * Returns the journal name of the publication. Fetches the details if not already done. + * Returns the journal name of the publication. * * @return The journal name of the publication. */ public String getJournal() { - if (journal == null) { - this.fetchPublicationDetails(); - } return journal; } /** - * Returns the publication date. Fetches the details if not already done. + * Returns the publication date. * * @return The publication date. */ public String getDate() { - if (date == null) { - this.fetchPublicationDetails(); - } return date; } /** - * Returns the authors of the publication as a single string. Fetches the details if not already done. + * Returns the authors of the publication as a single string. * * @return The authors of the publication. */ public String getAuthors() { - if (authors == null) { - this.fetchPublicationDetails(); - } return authors; } /** - * Returns the list of authors. Fetches the details if not already done. + * Returns the list of authors. * * @return The list of authors. */ public ArrayList<String> getAuthorList() { - if (authorList == null) { - this.fetchPublicationDetails(); - } return authorList; } /** * Returns a complete reference of the publication including authors, title, journal, and date. - * - * @return The complete reference of the publication. + * If no publication details has been successfully fetched from DOI, returns url + * @return The complete reference of the publication, or the url. */ public String getCompleteReference() { - return this.getAuthors() + "; " + this.getTitle() + "; " + this.getJournal() + "; " + this.getDate(); + if(detailsRetrieved) return this.getAuthors() + "; " + this.getTitle() + "; " + this.getJournal() + "; " + this.getDate(); + return this.url; } /** * Returns an abbreviated reference with the first author's last name, "et al.", * title, journal, and date. - * - * @return The abbreviated reference of the publication. + * If no publication details has been successfully fetched from DOI, returns url + * @return The abbreviated reference of the publication, or the url. */ public String getAbbreviatedReference() { - String firstAuthor = this.getAuthorList().get(0); - String[] detailsFirstAuthor = firstAuthor.split("\s"); - String lastName = detailsFirstAuthor[detailsFirstAuthor.length - 1]; + if(detailsRetrieved){ + String firstAuthor = this.getAuthorList().get(0); + String[] detailsFirstAuthor = firstAuthor.split("\s"); + String lastName = detailsFirstAuthor[detailsFirstAuthor.length - 1]; - return lastName + " et al.; " + this.getTitle() + "; " + this.getJournal() + "; " + this.getDate(); + return lastName + " et al.; " + this.getTitle() + "; " + this.getJournal() + "; " + this.getDate(); + } + return this.url; } /** @@ -216,4 +216,12 @@ public class Doi { public String getDoi() { return doi; } + + /** + * Returns if the publication details have been successfully retrieved + * @return if details have been retrieved + */ + public boolean isDetailsRetrieved() { + return detailsRetrieved; + } } -- GitLab From 192b577558f3b143f6e7662e360693ee104a2808 Mon Sep 17 00:00:00 2001 From: lcottret <ludovic.cottret@inrae.fr> Date: Thu, 2 Jan 2025 14:53:53 +0100 Subject: [PATCH 8/8] fix compilation errors --- .../metexplore/met4j_toolbox/GenerateGalaxyFiles.java | 1 + .../met4j_toolbox/reconstruction/CreateMetaNetwork.java | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/GenerateGalaxyFiles.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/GenerateGalaxyFiles.java index c67336f73..4fce0733d 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/GenerateGalaxyFiles.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/GenerateGalaxyFiles.java @@ -58,6 +58,7 @@ import java.lang.reflect.Method; import java.net.URL; import java.util.Comparator; import java.util.List; +import java.util.Set; import java.util.stream.Collectors; public class GenerateGalaxyFiles extends AbstractMet4jApplication { diff --git a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/reconstruction/CreateMetaNetwork.java b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/reconstruction/CreateMetaNetwork.java index a0ef3029a..3b6985198 100644 --- a/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/reconstruction/CreateMetaNetwork.java +++ b/met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/reconstruction/CreateMetaNetwork.java @@ -15,6 +15,7 @@ import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumFormat import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumParameterTypes; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.Format; import fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.ParameterType; +import fr.inrae.toulouse.metexplore.met4j_toolbox.utils.Doi; import org.kohsuke.args4j.Option; import java.util.*; @@ -195,6 +196,11 @@ public class CreateMetaNetwork extends AbstractMet4jApplication { return "Create a Meta-Network from two sub-networks in SBML format."; } + @Override + public Set<Doi> getDois() { + return Set.of(); + } + @Override public String getLongDescription() { return "Create a Meta-Network from two sub-networks in SBML format. A meta-network is a single model which contains several sub-networks that remains individualized within" + -- GitLab