Class Biotransformer

    • Field Detail

      • smiGen

        public org.openscience.cdk.smiles.SmilesGenerator smiGen
      • inchiGenFactory

        public org.openscience.cdk.inchi.InChIGeneratorFactory inchiGenFactory
      • reactionsByGroups

        public java.util.LinkedHashMap<java.lang.String,​java.util.ArrayList<MetabolicReaction>> reactionsByGroups
      • enzymesByreactionGroups

        public java.util.LinkedHashMap<java.lang.String,​java.util.ArrayList<Enzyme>> enzymesByreactionGroups
      • enzymesList

        public java.util.ArrayList<Enzyme> enzymesList
      • reactionsHash

        public java.util.LinkedHashMap<java.lang.String,​MetabolicReaction> reactionsHash
      • mapper

        public org.codehaus.jackson.map.ObjectMapper mapper
    • Constructor Detail

      • Biotransformer

        public Biotransformer​(BioSystem.BioSystemName bioSName)
                       throws org.codehaus.jackson.JsonParseException,
                              org.codehaus.jackson.map.JsonMappingException,
                              java.io.IOException,
                              org.openscience.cdk.exception.CDKException
        Throws:
        org.codehaus.jackson.JsonParseException
        org.codehaus.jackson.map.JsonMappingException
        java.io.IOException
        org.openscience.cdk.exception.CDKException
    • Method Detail

      • getReactionsList

        public java.util.LinkedHashMap<java.lang.String,​java.util.ArrayList<MetabolicReaction>> getReactionsList()
      • generateAllMetabolitesFromAtomContainer

        public org.openscience.cdk.interfaces.IAtomContainerSet generateAllMetabolitesFromAtomContainer​(org.openscience.cdk.interfaces.IAtomContainer molecule,
                                                                                                        MetabolicReaction mReaction,
                                                                                                        boolean preprocess)
                                                                                                 throws java.lang.Exception
        Parameters:
        molecule - : A molecule of interest
        mReaction - : A MetabolicReaction
        preprocess - : A boolean that specifies whether to apply preprocessing or not
        Returns:
        : A set of metabolites or products generated by applying the reaction to the molecule of interest
        Throws:
        java.lang.Exception - : Throws an Exception
      • generateAllMetabolitesFromAtomContainer

        public org.openscience.cdk.interfaces.IAtomContainerSet generateAllMetabolitesFromAtomContainer​(org.openscience.cdk.interfaces.IAtomContainer molecule,
                                                                                                        ambit2.smarts.SMIRKSReaction reaction,
                                                                                                        boolean preprocess)
                                                                                                 throws java.lang.Exception
        Parameters:
        molecule - : A molecule of interest
        reaction - : A SMIRKSReaction
        preprocess - : A boolean that specifies whether to apply preprocessing or not
        Returns:
        : A set of metabolites or products generated by applying the reaction to the molecule of interest
        Throws:
        java.lang.Exception - : Throws an Exception
      • generateAllMetabolitesFromAtomContainerViaTransformationAtAllLocations

        public org.openscience.cdk.interfaces.IAtomContainerSet generateAllMetabolitesFromAtomContainerViaTransformationAtAllLocations​(org.openscience.cdk.interfaces.IAtomContainer molecule,
                                                                                                                                       ambit2.smarts.SMIRKSReaction reaction,
                                                                                                                                       boolean preprocess)
                                                                                                                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • applyReactionsAndReturnBiotransformations

        public java.util.ArrayList<Biotransformation> applyReactionsAndReturnBiotransformations​(org.openscience.cdk.interfaces.IAtomContainer target,
                                                                                                java.util.ArrayList<MetabolicReaction> reactions,
                                                                                                boolean preprocess,
                                                                                                boolean filter)
                                                                                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • applyReactionsAndReturnBiotransformations

        public java.util.ArrayList<Biotransformation> applyReactionsAndReturnBiotransformations​(org.openscience.cdk.interfaces.IAtomContainer target,
                                                                                                java.util.ArrayList<MetabolicReaction> reactions,
                                                                                                boolean preprocess,
                                                                                                boolean filter,
                                                                                                java.lang.Double scoreThreshold)
                                                                                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • applyReactionAndReturnBiotransformations

        public java.util.ArrayList<Biotransformation> applyReactionAndReturnBiotransformations​(org.openscience.cdk.interfaces.IAtomContainer target,
                                                                                               MetabolicReaction reaction,
                                                                                               boolean preprocess)
                                                                                        throws java.lang.Exception
        Throws:
        java.lang.Exception
      • applyReactionAndReturnBiotransformations

        public java.util.ArrayList<Biotransformation> applyReactionAndReturnBiotransformations​(org.openscience.cdk.interfaces.IAtomContainer target,
                                                                                               MetabolicReaction reaction,
                                                                                               boolean preprocess,
                                                                                               java.lang.Double scoreThreshold)
                                                                                        throws java.lang.Exception
        Throws:
        java.lang.Exception
      • applyReactionsFromContainersAndReturnBiotransformations

        public java.util.ArrayList<Biotransformation> applyReactionsFromContainersAndReturnBiotransformations​(org.openscience.cdk.interfaces.IAtomContainerSet targets,
                                                                                                              java.util.ArrayList<MetabolicReaction> reactions,
                                                                                                              boolean preprocess,
                                                                                                              boolean filter,
                                                                                                              java.lang.Double scoreThreshold)
                                                                                                       throws java.lang.Exception
        Throws:
        java.lang.Exception
      • applyReactionsChainAndReturnBiotransformations

        public java.util.ArrayList<Biotransformation> applyReactionsChainAndReturnBiotransformations​(org.openscience.cdk.interfaces.IAtomContainer target,
                                                                                                     java.util.ArrayList<MetabolicReaction> reactions,
                                                                                                     boolean preprocess,
                                                                                                     boolean filter,
                                                                                                     int nr_of_steps)
                                                                                              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • applyReactionsChainAndReturnBiotransformations

        public java.util.ArrayList<Biotransformation> applyReactionsChainAndReturnBiotransformations​(org.openscience.cdk.interfaces.IAtomContainer target,
                                                                                                     java.util.ArrayList<MetabolicReaction> reactions,
                                                                                                     boolean preprocess,
                                                                                                     boolean filter,
                                                                                                     int nr_of_steps,
                                                                                                     java.lang.Double scoreThreshold)
                                                                                              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • applyReactionsChainAndReturnBiotransformations

        public java.util.ArrayList<Biotransformation> applyReactionsChainAndReturnBiotransformations​(org.openscience.cdk.interfaces.IAtomContainerSet targets,
                                                                                                     java.util.ArrayList<MetabolicReaction> reactions,
                                                                                                     boolean preprocess,
                                                                                                     boolean filter,
                                                                                                     int nr_of_steps)
                                                                                              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • applyReactionsChainAndReturnBiotransformations

        public java.util.ArrayList<Biotransformation> applyReactionsChainAndReturnBiotransformations​(org.openscience.cdk.interfaces.IAtomContainerSet targets,
                                                                                                     java.util.ArrayList<MetabolicReaction> reactions,
                                                                                                     boolean preprocess,
                                                                                                     boolean filter,
                                                                                                     int nr_of_steps,
                                                                                                     java.lang.Double scoreThreshold)
                                                                                              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • applyReactions

        public org.openscience.cdk.interfaces.IAtomContainerSet applyReactions​(org.openscience.cdk.interfaces.IAtomContainer target,
                                                                               ambit2.smarts.SMIRKSManager smrkMan,
                                                                               java.util.LinkedHashMap<java.lang.String,​MetabolicReaction> reactions,
                                                                               boolean preprocess,
                                                                               boolean filter)
                                                                        throws java.lang.Exception
        Throws:
        java.lang.Exception
      • applyReactions

        public org.openscience.cdk.interfaces.IAtomContainerSet applyReactions​(org.openscience.cdk.interfaces.IAtomContainer target,
                                                                               java.util.LinkedHashMap<java.lang.String,​MetabolicReaction> reactions,
                                                                               boolean preprocess,
                                                                               boolean filter,
                                                                               java.lang.Double scoreThreshold)
                                                                        throws java.lang.Exception
        Throws:
        java.lang.Exception
      • applyReactionChain

        public org.openscience.cdk.interfaces.IAtomContainerSet applyReactionChain​(org.openscience.cdk.interfaces.IAtomContainer target,
                                                                                   ambit2.smarts.SMIRKSManager smrkMan,
                                                                                   java.util.LinkedHashMap<java.lang.String,​MetabolicReaction> reactions,
                                                                                   boolean preprocess,
                                                                                   boolean filter,
                                                                                   int nr_of_steps)
                                                                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • applyReactionChain

        public org.openscience.cdk.interfaces.IAtomContainerSet applyReactionChain​(org.openscience.cdk.interfaces.IAtomContainer target,
                                                                                   ambit2.smarts.SMIRKSManager smrkMan,
                                                                                   java.util.LinkedHashMap<java.lang.String,​MetabolicReaction> reactions,
                                                                                   boolean preprocess,
                                                                                   boolean filter,
                                                                                   int nr_of_steps,
                                                                                   java.lang.Double scoreThreshold)
                                                                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • metabolizeWithEnzyme

        public java.util.ArrayList<Biotransformation> metabolizeWithEnzyme​(org.openscience.cdk.interfaces.IAtomContainer substrate,
                                                                           Enzyme.EnzymeName enz,
                                                                           boolean preprocess,
                                                                           boolean filter,
                                                                           double threshold)
                                                                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • metabolizeWithEnzyme

        public java.util.ArrayList<Biotransformation> metabolizeWithEnzyme​(org.openscience.cdk.interfaces.IAtomContainer substrate,
                                                                           Enzyme enzyme,
                                                                           boolean preprocess,
                                                                           boolean filter,
                                                                           double threshold)
                                                                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • metabolizeWithEnzyme

        public java.util.ArrayList<Biotransformation> metabolizeWithEnzyme​(org.openscience.cdk.interfaces.IAtomContainer substrate,
                                                                           Enzyme enzyme,
                                                                           boolean preprocess,
                                                                           boolean filter,
                                                                           int nrOfSteps,
                                                                           double threshold)
                                                                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • metabolizeWithEnzyme

        public java.util.ArrayList<Biotransformation> metabolizeWithEnzyme​(org.openscience.cdk.interfaces.IAtomContainerSet substrates,
                                                                           Enzyme enzyme,
                                                                           boolean preprocess,
                                                                           boolean filter,
                                                                           double threshold)
                                                                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • isValidSubstrate

        public boolean isValidSubstrate​(org.openscience.cdk.interfaces.IAtomContainer target,
                                        Enzyme.EnzymeName enzymeName)
                                 throws java.lang.Exception
        Throws:
        java.lang.Exception
      • metabolizeWithEnzymes

        public java.util.ArrayList<Biotransformation> metabolizeWithEnzymes​(org.openscience.cdk.interfaces.IAtomContainer target,
                                                                            java.util.ArrayList<Enzyme> enzymes,
                                                                            boolean preprocess,
                                                                            boolean filter,
                                                                            java.lang.Double scoreThreshold)
                                                                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • metabolizeWithEnzymes

        public java.util.ArrayList<Biotransformation> metabolizeWithEnzymes​(org.openscience.cdk.interfaces.IAtomContainerSet substrates,
                                                                            java.util.ArrayList<Enzyme> enzymes,
                                                                            boolean preprocess,
                                                                            boolean filter,
                                                                            double threshold)
                                                                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • metabolizeWithEnzymesDephtFirst

        public java.util.ArrayList<Biotransformation> metabolizeWithEnzymesDephtFirst​(org.openscience.cdk.interfaces.IAtomContainer target,
                                                                                      java.util.ArrayList<Enzyme> enzymes,
                                                                                      boolean preprocess,
                                                                                      boolean filter,
                                                                                      int nrOfSteps,
                                                                                      java.lang.Double scoreThreshold)
                                                                               throws java.lang.Exception
        Throws:
        java.lang.Exception
      • metabolizeWithEnzymesBreadthFirst

        public java.util.ArrayList<Biotransformation> metabolizeWithEnzymesBreadthFirst​(org.openscience.cdk.interfaces.IAtomContainer target,
                                                                                        java.util.ArrayList<Enzyme> enzymes,
                                                                                        boolean preprocess,
                                                                                        boolean filter,
                                                                                        int nrOfSteps,
                                                                                        java.lang.Double scoreThreshold)
                                                                                 throws java.lang.Exception
        Throws:
        java.lang.Exception
      • metabolizeWithEnzymesBreadthFirst

        public java.util.ArrayList<Biotransformation> metabolizeWithEnzymesBreadthFirst​(org.openscience.cdk.interfaces.IAtomContainerSet targets,
                                                                                        java.util.ArrayList<Enzyme> enzymes,
                                                                                        boolean preprocess,
                                                                                        boolean filter,
                                                                                        int nrOfSteps,
                                                                                        java.lang.Double scoreThreshold)
                                                                                 throws java.lang.Exception
        Throws:
        java.lang.Exception
      • applyReactionAtOnceAndReturnBiotransformations

        public java.util.ArrayList<Biotransformation> applyReactionAtOnceAndReturnBiotransformations​(org.openscience.cdk.interfaces.IAtomContainer target,
                                                                                                     MetabolicReaction reaction,
                                                                                                     boolean preprocess,
                                                                                                     java.lang.Double scoreThreshold)
                                                                                              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • applyReactionAtOnceAndReturnBiotransformations

        public java.util.ArrayList<Biotransformation> applyReactionAtOnceAndReturnBiotransformations​(org.openscience.cdk.interfaces.IAtomContainer target,
                                                                                                     java.util.ArrayList<MetabolicReaction> reactions,
                                                                                                     boolean preprocess,
                                                                                                     boolean filter,
                                                                                                     java.lang.Double scoreThreshold)
                                                                                              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • applyReactionAtOnceAndReturnBiotransformations

        public java.util.ArrayList<Biotransformation> applyReactionAtOnceAndReturnBiotransformations​(org.openscience.cdk.interfaces.IAtomContainerSet targets,
                                                                                                     java.util.ArrayList<MetabolicReaction> reactions,
                                                                                                     boolean preprocess,
                                                                                                     boolean filter,
                                                                                                     java.lang.Double scoreThreshold)
                                                                                              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • applyReactionAtOnceAndReturnBiotransformations

        public java.util.ArrayList<Biotransformation> applyReactionAtOnceAndReturnBiotransformations​(org.openscience.cdk.interfaces.IAtomContainer target,
                                                                                                     java.util.ArrayList<MetabolicReaction> reactions,
                                                                                                     boolean preprocess,
                                                                                                     boolean filter,
                                                                                                     int nrOfSteps,
                                                                                                     java.lang.Double scoreThreshold)
                                                                                              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getSmiParser

        public org.openscience.cdk.smiles.SmilesParser getSmiParser()
      • extractProductsFromBiotransformations

        public org.openscience.cdk.interfaces.IAtomContainerSet extractProductsFromBiotransformations​(java.util.ArrayList<Biotransformation> biotransformations)
                                                                                               throws java.lang.Exception
        Throws:
        java.lang.Exception
      • extractProductsFromBiotransformationsWithTransformationData

        public org.openscience.cdk.interfaces.IAtomContainerSet extractProductsFromBiotransformationsWithTransformationData​(java.util.ArrayList<Biotransformation> biotransformations,
                                                                                                                            java.util.LinkedHashMap<java.lang.String,​MetabolicReaction> customReactionHash,
                                                                                                                            boolean annotate)
                                                                                                                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • extractProductsFromBiotransformationsWithTransformationData

        public org.openscience.cdk.interfaces.IAtomContainerSet extractProductsFromBiotransformationsWithTransformationData​(java.util.ArrayList<Biotransformation> biotransformations,
                                                                                                                            java.util.LinkedHashMap<java.lang.String,​MetabolicReaction> customReactionHash)
                                                                                                                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • extractProductsFromBiotransformationsWithTransformationData

        public org.openscience.cdk.interfaces.IAtomContainerSet extractProductsFromBiotransformationsWithTransformationData​(java.util.ArrayList<Biotransformation> biotransformations,
                                                                                                                            boolean annotate)
                                                                                                                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • extractProductsFromBiotransformationsWithTransformationData

        public org.openscience.cdk.interfaces.IAtomContainerSet extractProductsFromBiotransformationsWithTransformationData​(java.util.ArrayList<Biotransformation> biotransformations)
                                                                                                                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • saveBioTransformationProductsToSdf

        public void saveBioTransformationProductsToSdf​(java.util.ArrayList<Biotransformation> biotransformations,
                                                       java.lang.String outputFileName)
                                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • saveBioTransformationProductsToSdf

        public void saveBioTransformationProductsToSdf​(java.util.ArrayList<Biotransformation> biotransformations,
                                                       java.lang.String outputFileName,
                                                       boolean annotate)
                                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • saveBioTransformationProductsToSdf

        public void saveBioTransformationProductsToSdf​(java.util.ArrayList<Biotransformation> biotransformations,
                                                       java.lang.String outputFileName,
                                                       java.util.LinkedHashMap<java.lang.String,​MetabolicReaction> customReactionHash)
                                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • saveBioTransformationProductsToSdf

        public void saveBioTransformationProductsToSdf​(java.util.ArrayList<Biotransformation> biotransformations,
                                                       java.lang.String outputFileName,
                                                       java.util.LinkedHashMap<java.lang.String,​MetabolicReaction> customReactionHash,
                                                       boolean annotate)
                                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • applyPathwaySpecificBiotransformationChain

        public java.util.ArrayList<Biotransformation> applyPathwaySpecificBiotransformationChain​(org.openscience.cdk.interfaces.IAtomContainer target,
                                                                                                 MetabolicPathway.MPathwayName pathwayName,
                                                                                                 boolean preprocess,
                                                                                                 boolean filter,
                                                                                                 int nr_of_steps)
                                                                                          throws java.lang.Exception
        Throws:
        java.lang.Exception
      • saveBioTransformationProductsToCSV

        public void saveBioTransformationProductsToCSV​(java.util.ArrayList<Biotransformation> biotransformations,
                                                       java.lang.String outputFileName)
                                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • saveBioTransformationProductsToCSV

        public void saveBioTransformationProductsToCSV​(java.util.ArrayList<Biotransformation> biotransformations,
                                                       java.lang.String outputFileName,
                                                       boolean annotate)
                                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • saveBioTransformationProductsToCSV

        public void saveBioTransformationProductsToCSV​(java.util.ArrayList<Biotransformation> biotransformations,
                                                       java.lang.String outputFileName,
                                                       java.util.LinkedHashMap<java.lang.String,​MetabolicReaction> customReactionHash)
                                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • saveBioTransformationProductsToCSV

        public void saveBioTransformationProductsToCSV​(java.util.ArrayList<Biotransformation> biotransformations,
                                                       java.lang.String outputFileName,
                                                       java.util.LinkedHashMap<java.lang.String,​MetabolicReaction> customReactionHash,
                                                       boolean annotate)
                                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • saveBioTransformationProductsToSDF

        public void saveBioTransformationProductsToSDF​(java.util.ArrayList<Biotransformation> biotransformations,
                                                       java.lang.String outputFileName,
                                                       java.util.LinkedHashMap<java.lang.String,​MetabolicReaction> customReactionHash,
                                                       boolean annotate)
                                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • applyPathwaySpecificBiotransformations

        public java.util.ArrayList<Biotransformation> applyPathwaySpecificBiotransformations​(org.openscience.cdk.interfaces.IAtomContainer target,
                                                                                             MetabolicPathway.MPathwayName pathwayName,
                                                                                             boolean preprocess,
                                                                                             boolean filter,
                                                                                             java.lang.Double scoreThreshold)
                                                                                      throws java.lang.Exception
        Predicts the metabolism of a compound for a specific pathway, and returns metabolites with a minimal given score threshold.
        Parameters:
        target - - An AtomContainer that represent a chemical compound
        pathwayName - - the name of a MetabolicPathway object. It must belong to the MPathwayName enum.
        preprocess - - specifies whether the compounds must be pre-processed.
        filter - - specifies whether the reactions should be filtered, according to priority rules.
        scoreThreshold - - the minimal score that a metabolite must have to be returned.
        Returns:
        an ArrayList of biotransformations
        Throws:
        java.lang.Exception - : Throws an Exception
      • applyPathwaySpecificBiotransformations

        public java.util.ArrayList<Biotransformation> applyPathwaySpecificBiotransformations​(org.openscience.cdk.interfaces.IAtomContainerSet targets,
                                                                                             MetabolicPathway.MPathwayName pathwayName,
                                                                                             boolean preprocess,
                                                                                             boolean filter,
                                                                                             java.lang.Double scoreThreshold)
                                                                                      throws java.lang.Exception
        Predicts the metabolism of a compound for a specific pathway, and returns metabolites with a minimal given score threshold.
        Parameters:
        targets - - A set of chemical compounds
        pathwayName - - the name of a MetabolicPathway object. It must belong to the MPathwayName enum.
        preprocess - - specifies whether the compounds must be pre-processed.
        filter - - specifies whether the reactions should be filtered, according to priority rules.
        scoreThreshold - - the minimal score that a metabolite must have to be returned.
        Returns:
        an ArrayList of biotransformations
        Throws:
        java.lang.Exception - : Throws an Exception
      • applyPathwaySpecificBiotransformationsChain

        public java.util.ArrayList<Biotransformation> applyPathwaySpecificBiotransformationsChain​(org.openscience.cdk.interfaces.IAtomContainerSet targets,
                                                                                                  MetabolicPathway.MPathwayName pathwayName,
                                                                                                  boolean preprocess,
                                                                                                  boolean filter,
                                                                                                  int nr_of_steps,
                                                                                                  java.lang.Double scoreThreshold)
                                                                                           throws java.lang.Exception
        Throws:
        java.lang.Exception
      • applyPathwaySpecificBiotransformationsChain

        public java.util.ArrayList<Biotransformation> applyPathwaySpecificBiotransformationsChain​(org.openscience.cdk.interfaces.IAtomContainer target,
                                                                                                  MetabolicPathway.MPathwayName pathwayName,
                                                                                                  boolean preprocess,
                                                                                                  boolean filter,
                                                                                                  int nr_of_steps,
                                                                                                  java.lang.Double scoreThreshold)
                                                                                           throws java.lang.Exception
        Throws:
        java.lang.Exception