From 741701df8ff0861b3607a30e9aaf8b8a0c303cdf Mon Sep 17 00:00:00 2001 From: gebele Date: Thu, 13 Jun 2019 15:28:59 +0000 Subject: update with API --- api/api.json | 496 ++++-------------------------------------------------- application.rb | 28 +-- helper.rb | 3 + lib/api.rb | 28 ++- lib/compound.rb | 6 +- lib/dataset.rb | 133 ++------------- lib/endpoint.rb | 10 +- lib/feature.rb | 4 +- lib/model.rb | 16 +- lib/report.rb | 193 +-------------------- lib/substance.rb | 18 +- lib/swagger.rb | 6 +- lib/validation.rb | 24 ++- qmrf_report.rb | 2 - 14 files changed, 119 insertions(+), 848 deletions(-) diff --git a/api/api.json b/api/api.json index 00411f5..38b9a90 100644 --- a/api/api.json +++ b/api/api.json @@ -1,16 +1,8 @@ { "openapi": "3.0.0", - "x-orn-@id": "https://lazar.prod.openrisknet.org", - "x-orn-@type": "x-orn:Service", - "x-orn-@context": { - "@vocab": "http://openrisknet.org/schema#", - "x-orn": "http://openrisknet.org/schema#", - "x-orn-@id": "@id", - "x-orn-@type": "@type" - }, "servers": [ { - "url": "https://lazar.prod.openrisknet.org/" + "url": "https://lazar.in-silico.ch" } ], "info": { @@ -32,7 +24,7 @@ "url": "https://github.com/OpenRiskNet/home/blob/master/openshift/deployments/lazar/README.md" }, "paths": { - "/api/api.json": { + "/api": { "get": { "tags": [ "api" @@ -51,360 +43,8 @@ } } }, - "/compound/descriptor": { + "/api/compound/descriptor": { "get": { - "x-orn-@type": "x-orn:Descriptor", - "x-orn:path": "https://lazar.prod.openrisknet.org/compound/descriptor", - "x-orn:method": "Get", - "x-orn:returns": { - "Openbabel.HBA1": "Number of Hydrogen Bond Acceptors 1 (JoelLib)", - "Openbabel.HBA2": "Number of Hydrogen Bond Acceptors 2 (JoelLib)", - "Openbabel.HBD": "Number of Hydrogen Bond Donors (JoelLib)", - "Openbabel.MP": "Melting point", - "Openbabel.MR": "molar refractivity", - "Openbabel.MW": "Molecular Weight filter", - "Openbabel.TPSA": "topological polar surface area", - "Openbabel.abonds": "Number of aromatic bonds", - "Openbabel.atoms": "Number of atoms", - "Openbabel.bonds": "Number of bonds", - "Openbabel.dbonds": "Number of double bonds", - "Openbabel.logP": "octanol/water partition coefficient", - "Openbabel.nF": "Number of Fluorine Atoms", - "Openbabel.rotors": "Rotatable bonds filter", - "Openbabel.sbonds": "Number of single bonds", - "Openbabel.tbonds": "Number of triple bonds", - "Cdk.SmallRing.nSmallRings": "An enumeration of all the small rings (sizes 3 to 9) in a molecule, which can be obtained quickly and deterministically.", - "Cdk.SmallRing.nAromRings": "An enumeration of all the small rings (sizes 3 to 9) in a molecule, which can be obtained quickly and deterministically.", - "Cdk.SmallRing.nRingBlocks": "An enumeration of all the small rings (sizes 3 to 9) in a molecule, which can be obtained quickly and deterministically.", - "Cdk.SmallRing.nAromBlocks": "An enumeration of all the small rings (sizes 3 to 9) in a molecule, which can be obtained quickly and deterministically.", - "Cdk.SmallRing.nRings3": "An enumeration of all the small rings (sizes 3 to 9) in a molecule, which can be obtained quickly and deterministically.", - "Cdk.SmallRing.nRings4": "An enumeration of all the small rings (sizes 3 to 9) in a molecule, which can be obtained quickly and deterministically.", - "Cdk.SmallRing.nRings5": "An enumeration of all the small rings (sizes 3 to 9) in a molecule, which can be obtained quickly and deterministically.", - "Cdk.SmallRing.nRings6": "An enumeration of all the small rings (sizes 3 to 9) in a molecule, which can be obtained quickly and deterministically.", - "Cdk.SmallRing.nRings7": "An enumeration of all the small rings (sizes 3 to 9) in a molecule, which can be obtained quickly and deterministically.", - "Cdk.SmallRing.nRings8": "An enumeration of all the small rings (sizes 3 to 9) in a molecule, which can be obtained quickly and deterministically.", - "Cdk.SmallRing.nRings9": "An enumeration of all the small rings (sizes 3 to 9) in a molecule, which can be obtained quickly and deterministically.", - "Cdk.FractionalPSA.tpsaEfficiency": "Polar surface area expressed as a ratio to molecular size. Calculates tpsaEfficiency, which is to TPSADescriptor/ molecular weight, in units of square Angstroms per Dalton.", - "Cdk.ZagrebIndex.Zagreb": "The sum of the squared atom degrees of all heavy atoms.", - "Cdk.XLogP.XLogP": "Prediction of logP based on the atom-type method called XLogP.", - "Cdk.WienerNumbers.WPATH": "This class calculates Wiener path number and Wiener polarity number.", - "Cdk.WienerNumbers.WPOL": "This class calculates Wiener path number and Wiener polarity number.", - "Cdk.WHIM.Wlambda1.unity": "Holistic descriptors described by Todeschini et al .", - "Cdk.WHIM.Wlambda2.unity": "Holistic descriptors described by Todeschini et al .", - "Cdk.WHIM.Wlambda3.unity": "Holistic descriptors described by Todeschini et al .", - "Cdk.WHIM.Wnu1.unity": "Holistic descriptors described by Todeschini et al .", - "Cdk.WHIM.Wnu2.unity": "Holistic descriptors described by Todeschini et al .", - "Cdk.WHIM.Wgamma1.unity": "Holistic descriptors described by Todeschini et al .", - "Cdk.WHIM.Wgamma2.unity": "Holistic descriptors described by Todeschini et al .", - "Cdk.WHIM.Wgamma3.unity": "Holistic descriptors described by Todeschini et al .", - "Cdk.WHIM.Weta1.unity": "Holistic descriptors described by Todeschini et al .", - "Cdk.WHIM.Weta2.unity": "Holistic descriptors described by Todeschini et al .", - "Cdk.WHIM.Weta3.unity": "Holistic descriptors described by Todeschini et al .", - "Cdk.WHIM.WT.unity": "Holistic descriptors described by Todeschini et al .", - "Cdk.WHIM.WA.unity": "Holistic descriptors described by Todeschini et al .", - "Cdk.WHIM.WV.unity": "Holistic descriptors described by Todeschini et al .", - "Cdk.WHIM.WK.unity": "Holistic descriptors described by Todeschini et al .", - "Cdk.WHIM.WG.unity": "Holistic descriptors described by Todeschini et al .", - "Cdk.WHIM.WD.unity": "Holistic descriptors described by Todeschini et al .", - "Cdk.WeightedPath.WTPT-1": "The weighted path (molecular ID) descriptors described by Randic. They characterize molecular branching.", - "Cdk.WeightedPath.WTPT-2": "The weighted path (molecular ID) descriptors described by Randic. They characterize molecular branching.", - "Cdk.WeightedPath.WTPT-3": "The weighted path (molecular ID) descriptors described by Randic. They characterize molecular branching.", - "Cdk.WeightedPath.WTPT-4": "The weighted path (molecular ID) descriptors described by Randic. They characterize molecular branching.", - "Cdk.WeightedPath.WTPT-5": "The weighted path (molecular ID) descriptors described by Randic. They characterize molecular branching.", - "Cdk.Weight.MW": "Descriptor based on the weight of atoms of a certain element type. If no element is specified, the returned value is the Molecular Weight", - "Cdk.VAdjMa.VAdjMat": "Descriptor that calculates the vertex adjacency information of a molecule.", - "Cdk.VABC.VABC": "Describes the volume of a molecule.", - "Cdk.TPSA.TopoPSA": "Calculation of topological polar surface area based on fragment contributions .", - "Cdk.RuleOfFive.LipinskiFailures": "This Class contains a method that returns the number failures of the Lipinski's Rule Of Five.", - "Cdk.RotatableBondsCount.nRotB": "Descriptor that calculates the number of nonrotatable bonds on a molecule.", - "Cdk.PetitjeanShapeIndex.topoShape": "The topological and geometric shape indices described Petitjean and Bath et al. respectively. Both measure the anisotropy in a molecule.", - "Cdk.PetitjeanShapeIndex.geomShape": "The topological and geometric shape indices described Petitjean and Bath et al. respectively. Both measure the anisotropy in a molecule.", - "Cdk.PetitjeanNumber.PetitjeanNumber": "Descriptor that calculates the Petitjean Number of a molecule.", - "Cdk.MomentOfInertia.MOMI-X": "Descriptor that calculates the principal moments of inertia and ratios of the principal moments. Als calculates the radius of gyration.", - "Cdk.MomentOfInertia.MOMI-Y": "Descriptor that calculates the principal moments of inertia and ratios of the principal moments. Als calculates the radius of gyration.", - "Cdk.MomentOfInertia.MOMI-Z": "Descriptor that calculates the principal moments of inertia and ratios of the principal moments. Als calculates the radius of gyration.", - "Cdk.MomentOfInertia.MOMI-XY": "Descriptor that calculates the principal moments of inertia and ratios of the principal moments. Als calculates the radius of gyration.", - "Cdk.MomentOfInertia.MOMI-XZ": "Descriptor that calculates the principal moments of inertia and ratios of the principal moments. Als calculates the radius of gyration.", - "Cdk.MomentOfInertia.MOMI-YZ": "Descriptor that calculates the principal moments of inertia and ratios of the principal moments. Als calculates the radius of gyration.", - "Cdk.MomentOfInertia.MOMI-R": "Descriptor that calculates the principal moments of inertia and ratios of the principal moments. Als calculates the radius of gyration.", - "Cdk.MDE.MDEC-11": "Evaluate molecular distance edge descriptors for C, N and O", - "Cdk.MDE.MDEC-12": "Evaluate molecular distance edge descriptors for C, N and O", - "Cdk.MDE.MDEC-13": "Evaluate molecular distance edge descriptors for C, N and O", - "Cdk.MDE.MDEC-14": "Evaluate molecular distance edge descriptors for C, N and O", - "Cdk.MDE.MDEC-22": "Evaluate molecular distance edge descriptors for C, N and O", - "Cdk.MDE.MDEC-23": "Evaluate molecular distance edge descriptors for C, N and O", - "Cdk.MDE.MDEC-24": "Evaluate molecular distance edge descriptors for C, N and O", - "Cdk.MDE.MDEC-33": "Evaluate molecular distance edge descriptors for C, N and O", - "Cdk.MDE.MDEC-34": "Evaluate molecular distance edge descriptors for C, N and O", - "Cdk.MDE.MDEC-44": "Evaluate molecular distance edge descriptors for C, N and O", - "Cdk.MDE.MDEO-11": "Evaluate molecular distance edge descriptors for C, N and O", - "Cdk.MDE.MDEO-12": "Evaluate molecular distance edge descriptors for C, N and O", - "Cdk.MDE.MDEO-22": "Evaluate molecular distance edge descriptors for C, N and O", - "Cdk.MDE.MDEN-11": "Evaluate molecular distance edge descriptors for C, N and O", - "Cdk.MDE.MDEN-12": "Evaluate molecular distance edge descriptors for C, N and O", - "Cdk.MDE.MDEN-13": "Evaluate molecular distance edge descriptors for C, N and O", - "Cdk.MDE.MDEN-22": "Evaluate molecular distance edge descriptors for C, N and O", - "Cdk.MDE.MDEN-23": "Evaluate molecular distance edge descriptors for C, N and O", - "Cdk.MDE.MDEN-33": "Evaluate molecular distance edge descriptors for C, N and O", - "Cdk.MannholdLogP.MLogP": "Descriptor that calculates the LogP based on a simple equation using the number of carbons and hetero atoms .", - "Cdk.LongestAliphaticChain.nAtomLAC": "Returns the number of atoms in the longest aliphatic chain", - "Cdk.LengthOverBreadth.LOBMAX": "Calculates the ratio of length to breadth.", - "Cdk.LengthOverBreadth.LOBMIN": "Calculates the ratio of length to breadth.", - "Cdk.LargestPiSystem.nAtomP": "Returns the number of atoms in the largest pi chain", - "Cdk.LargestChain.nAtomLC": "Returns the number of atoms in the largest chain", - "Cdk.KierHallSmarts.khs.sLi": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.ssBe": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.ssssBe": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.ssBH": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.sssB": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.ssssB": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.sCH3": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.dCH2": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.ssCH2": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.tCH": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.dsCH": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.aaCH": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.sssCH": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.ddC": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.tsC": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.dssC": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.aasC": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.aaaC": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.ssssC": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.sNH3": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.sNH2": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.ssNH2": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.dNH": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.ssNH": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.aaNH": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.tN": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.sssNH": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.dsN": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.aaN": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.sssN": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.ddsN": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.aasN": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.ssssN": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.sOH": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.dO": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.ssO": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.aaO": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.sF": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.sSiH3": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.ssSiH2": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.sssSiH": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.ssssSi": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.sPH2": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.ssPH": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.sssP": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.dsssP": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.sssssP": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.sSH": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.dS": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.ssS": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.aaS": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.dssS": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.ddssS": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.sCl": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.sGeH3": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.ssGeH2": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.sssGeH": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.ssssGe": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.sAsH2": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.ssAsH": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.sssAs": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.sssdAs": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.sssssAs": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.sSeH": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.dSe": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.ssSe": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.aaSe": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.dssSe": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.ddssSe": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.sBr": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.sSnH3": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.ssSnH2": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.sssSnH": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.ssssSn": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.sI": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.sPbH3": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.ssPbH2": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.sssPbH": "Counts the number of occurrences of the E-state fragments", - "Cdk.KierHallSmarts.khs.ssssPb": "Counts the number of occurrences of the E-state fragments", - "Cdk.KappaShapeIndices.Kier1": "Descriptor that calculates Kier and Hall kappa molecular shape indices.", - "Cdk.KappaShapeIndices.Kier2": "Descriptor that calculates Kier and Hall kappa molecular shape indices.", - "Cdk.KappaShapeIndices.Kier3": "Descriptor that calculates Kier and Hall kappa molecular shape indices.", - "Cdk.HybridizationRatio.HybRatio": "Characterizes molecular complexity in terms of carbon hybridization states.", - "Cdk.HBondDonorCount.nHBDon": "Descriptor that calculates the number of hydrogen bond donors.", - "Cdk.HBondAcceptorCount.nHBAcc": "Descriptor that calculates the number of hydrogen bond acceptors.", - "Cdk.GravitationalIndex.GRAV-1": "Descriptor characterizing the mass distribution of the molecule.", - "Cdk.GravitationalIndex.GRAV-2": "Descriptor characterizing the mass distribution of the molecule.", - "Cdk.GravitationalIndex.GRAV-3": "Descriptor characterizing the mass distribution of the molecule.", - "Cdk.GravitationalIndex.GRAVH-1": "Descriptor characterizing the mass distribution of the molecule.", - "Cdk.GravitationalIndex.GRAVH-2": "Descriptor characterizing the mass distribution of the molecule.", - "Cdk.GravitationalIndex.GRAVH-3": "Descriptor characterizing the mass distribution of the molecule.", - "Cdk.GravitationalIndex.GRAV-4": "Descriptor characterizing the mass distribution of the molecule.", - "Cdk.GravitationalIndex.GRAV-5": "Descriptor characterizing the mass distribution of the molecule.", - "Cdk.GravitationalIndex.GRAV-6": "Descriptor characterizing the mass distribution of the molecule.", - "Cdk.FragmentComplexity.fragC": "Class that returns the complexity of a system. The complexity is defined as @cdk.cite{Nilakantan06}", - "Cdk.FMF.FMF": "Descriptor characterizing molecular complexity in terms of its Murcko framework", - "Cdk.EccentricConnectivityIndex.ECCEN": "A topological descriptor combining distance and adjacency information.", - "Cdk.CPSA.PPSA-1": "A variety of descriptors combining surface area and partial charge information", - "Cdk.CPSA.PPSA-2": "A variety of descriptors combining surface area and partial charge information", - "Cdk.CPSA.PPSA-3": "A variety of descriptors combining surface area and partial charge information", - "Cdk.CPSA.PNSA-1": "A variety of descriptors combining surface area and partial charge information", - "Cdk.CPSA.PNSA-2": "A variety of descriptors combining surface area and partial charge information", - "Cdk.CPSA.PNSA-3": "A variety of descriptors combining surface area and partial charge information", - "Cdk.CPSA.DPSA-1": "A variety of descriptors combining surface area and partial charge information", - "Cdk.CPSA.DPSA-2": "A variety of descriptors combining surface area and partial charge information", - "Cdk.CPSA.DPSA-3": "A variety of descriptors combining surface area and partial charge information", - "Cdk.CPSA.FPSA-1": "A variety of descriptors combining surface area and partial charge information", - "Cdk.CPSA.FPSA-2": "A variety of descriptors combining surface area and partial charge information", - "Cdk.CPSA.FPSA-3": "A variety of descriptors combining surface area and partial charge information", - "Cdk.CPSA.FNSA-1": "A variety of descriptors combining surface area and partial charge information", - "Cdk.CPSA.FNSA-2": "A variety of descriptors combining surface area and partial charge information", - "Cdk.CPSA.FNSA-3": "A variety of descriptors combining surface area and partial charge information", - "Cdk.CPSA.WPSA-1": "A variety of descriptors combining surface area and partial charge information", - "Cdk.CPSA.WPSA-2": "A variety of descriptors combining surface area and partial charge information", - "Cdk.CPSA.WPSA-3": "A variety of descriptors combining surface area and partial charge information", - "Cdk.CPSA.WNSA-1": "A variety of descriptors combining surface area and partial charge information", - "Cdk.CPSA.WNSA-2": "A variety of descriptors combining surface area and partial charge information", - "Cdk.CPSA.WNSA-3": "A variety of descriptors combining surface area and partial charge information", - "Cdk.CPSA.RPCG": "A variety of descriptors combining surface area and partial charge information", - "Cdk.CPSA.RNCG": "A variety of descriptors combining surface area and partial charge information", - "Cdk.CPSA.RPCS": "A variety of descriptors combining surface area and partial charge information", - "Cdk.CPSA.RNCS": "A variety of descriptors combining surface area and partial charge information", - "Cdk.CPSA.THSA": "A variety of descriptors combining surface area and partial charge information", - "Cdk.CPSA.TPSA": "A variety of descriptors combining surface area and partial charge information", - "Cdk.CPSA.RHSA": "A variety of descriptors combining surface area and partial charge information", - "Cdk.CPSA.RPSA": "A variety of descriptors combining surface area and partial charge information", - "Cdk.ChiPath.SP-0": "Evaluates the Kier & Hall Chi path indices of orders 0,1,2,3,4,5,6 and 7", - "Cdk.ChiPath.SP-1": "Evaluates the Kier & Hall Chi path indices of orders 0,1,2,3,4,5,6 and 7", - "Cdk.ChiPath.SP-2": "Evaluates the Kier & Hall Chi path indices of orders 0,1,2,3,4,5,6 and 7", - "Cdk.ChiPath.SP-3": "Evaluates the Kier & Hall Chi path indices of orders 0,1,2,3,4,5,6 and 7", - "Cdk.ChiPath.SP-4": "Evaluates the Kier & Hall Chi path indices of orders 0,1,2,3,4,5,6 and 7", - "Cdk.ChiPath.SP-5": "Evaluates the Kier & Hall Chi path indices of orders 0,1,2,3,4,5,6 and 7", - "Cdk.ChiPath.SP-6": "Evaluates the Kier & Hall Chi path indices of orders 0,1,2,3,4,5,6 and 7", - "Cdk.ChiPath.SP-7": "Evaluates the Kier & Hall Chi path indices of orders 0,1,2,3,4,5,6 and 7", - "Cdk.ChiPath.VP-0": "Evaluates the Kier & Hall Chi path indices of orders 0,1,2,3,4,5,6 and 7", - "Cdk.ChiPath.VP-1": "Evaluates the Kier & Hall Chi path indices of orders 0,1,2,3,4,5,6 and 7", - "Cdk.ChiPath.VP-2": "Evaluates the Kier & Hall Chi path indices of orders 0,1,2,3,4,5,6 and 7", - "Cdk.ChiPath.VP-3": "Evaluates the Kier & Hall Chi path indices of orders 0,1,2,3,4,5,6 and 7", - "Cdk.ChiPath.VP-4": "Evaluates the Kier & Hall Chi path indices of orders 0,1,2,3,4,5,6 and 7", - "Cdk.ChiPath.VP-5": "Evaluates the Kier & Hall Chi path indices of orders 0,1,2,3,4,5,6 and 7", - "Cdk.ChiPath.VP-6": "Evaluates the Kier & Hall Chi path indices of orders 0,1,2,3,4,5,6 and 7", - "Cdk.ChiPath.VP-7": "Evaluates the Kier & Hall Chi path indices of orders 0,1,2,3,4,5,6 and 7", - "Cdk.ChiPathCluster.SPC-4": "Evaluates the Kier & Hall Chi path cluster indices of orders 4,5 and 6", - "Cdk.ChiPathCluster.SPC-5": "Evaluates the Kier & Hall Chi path cluster indices of orders 4,5 and 6", - "Cdk.ChiPathCluster.SPC-6": "Evaluates the Kier & Hall Chi path cluster indices of orders 4,5 and 6", - "Cdk.ChiPathCluster.VPC-4": "Evaluates the Kier & Hall Chi path cluster indices of orders 4,5 and 6", - "Cdk.ChiPathCluster.VPC-5": "Evaluates the Kier & Hall Chi path cluster indices of orders 4,5 and 6", - "Cdk.ChiPathCluster.VPC-6": "Evaluates the Kier & Hall Chi path cluster indices of orders 4,5 and 6", - "Cdk.ChiCluster.SC-3": "Evaluates the Kier & Hall Chi cluster indices of orders 3,4,5,6 and 7", - "Cdk.ChiCluster.SC-4": "Evaluates the Kier & Hall Chi cluster indices of orders 3,4,5,6 and 7", - "Cdk.ChiCluster.SC-5": "Evaluates the Kier & Hall Chi cluster indices of orders 3,4,5,6 and 7", - "Cdk.ChiCluster.SC-6": "Evaluates the Kier & Hall Chi cluster indices of orders 3,4,5,6 and 7", - "Cdk.ChiCluster.VC-3": "Evaluates the Kier & Hall Chi cluster indices of orders 3,4,5,6 and 7", - "Cdk.ChiCluster.VC-4": "Evaluates the Kier & Hall Chi cluster indices of orders 3,4,5,6 and 7", - "Cdk.ChiCluster.VC-5": "Evaluates the Kier & Hall Chi cluster indices of orders 3,4,5,6 and 7", - "Cdk.ChiCluster.VC-6": "Evaluates the Kier & Hall Chi cluster indices of orders 3,4,5,6 and 7", - "Cdk.ChiChain.SCH-3": "Evaluates the Kier & Hall Chi chain indices of orders 3,4,5 and 6", - "Cdk.ChiChain.SCH-4": "Evaluates the Kier & Hall Chi chain indices of orders 3,4,5 and 6", - "Cdk.ChiChain.SCH-5": "Evaluates the Kier & Hall Chi chain indices of orders 3,4,5 and 6", - "Cdk.ChiChain.SCH-6": "Evaluates the Kier & Hall Chi chain indices of orders 3,4,5 and 6", - "Cdk.ChiChain.SCH-7": "Evaluates the Kier & Hall Chi chain indices of orders 3,4,5 and 6", - "Cdk.ChiChain.VCH-3": "Evaluates the Kier & Hall Chi chain indices of orders 3,4,5 and 6", - "Cdk.ChiChain.VCH-4": "Evaluates the Kier & Hall Chi chain indices of orders 3,4,5 and 6", - "Cdk.ChiChain.VCH-5": "Evaluates the Kier & Hall Chi chain indices of orders 3,4,5 and 6", - "Cdk.ChiChain.VCH-6": "Evaluates the Kier & Hall Chi chain indices of orders 3,4,5 and 6", - "Cdk.ChiChain.VCH-7": "Evaluates the Kier & Hall Chi chain indices of orders 3,4,5 and 6", - "Cdk.CarbonTypes.C1SP1": "Characterizes the carbon connectivity in terms of hybridization", - "Cdk.CarbonTypes.C2SP1": "Characterizes the carbon connectivity in terms of hybridization", - "Cdk.CarbonTypes.C1SP2": "Characterizes the carbon connectivity in terms of hybridization", - "Cdk.CarbonTypes.C2SP2": "Characterizes the carbon connectivity in terms of hybridization", - "Cdk.CarbonTypes.C3SP2": "Characterizes the carbon connectivity in terms of hybridization", - "Cdk.CarbonTypes.C1SP3": "Characterizes the carbon connectivity in terms of hybridization", - "Cdk.CarbonTypes.C2SP3": "Characterizes the carbon connectivity in terms of hybridization", - "Cdk.CarbonTypes.C3SP3": "Characterizes the carbon connectivity in terms of hybridization", - "Cdk.CarbonTypes.C4SP3": "Characterizes the carbon connectivity in terms of hybridization", - "Cdk.BPol.bpol": "Descriptor that calculates the sum of the absolute value of the difference between atomic polarizabilities of all bonded atoms in the molecule (including implicit hydrogens).", - "Cdk.BondCount.nB": "Descriptor based on the number of bonds of a certain bond order.", - "Cdk.BCUT.BCUTw-1l": "Eigenvalue based descriptor noted for its utility in chemical diversity described by Pearlman et al. .", - "Cdk.BCUT.BCUTw-1h": "Eigenvalue based descriptor noted for its utility in chemical diversity described by Pearlman et al. .", - "Cdk.BCUT.BCUTc-1l": "Eigenvalue based descriptor noted for its utility in chemical diversity described by Pearlman et al. .", - "Cdk.BCUT.BCUTc-1h": "Eigenvalue based descriptor noted for its utility in chemical diversity described by Pearlman et al. .", - "Cdk.BCUT.BCUTp-1l": "Eigenvalue based descriptor noted for its utility in chemical diversity described by Pearlman et al. .", - "Cdk.BCUT.BCUTp-1h": "Eigenvalue based descriptor noted for its utility in chemical diversity described by Pearlman et al. .", - "Cdk.BasicGroupCount.nBase": "Returns the number of basic groups.", - "Cdk.AutocorrelationPolarizability.ATSp1": "The Moreau-Broto autocorrelation descriptors using polarizability", - "Cdk.AutocorrelationPolarizability.ATSp2": "The Moreau-Broto autocorrelation descriptors using polarizability", - "Cdk.AutocorrelationPolarizability.ATSp3": "The Moreau-Broto autocorrelation descriptors using polarizability", - "Cdk.AutocorrelationPolarizability.ATSp4": "The Moreau-Broto autocorrelation descriptors using polarizability", - "Cdk.AutocorrelationPolarizability.ATSp5": "The Moreau-Broto autocorrelation descriptors using polarizability", - "Cdk.AutocorrelationMass.ATSm1": "The Moreau-Broto autocorrelation descriptors using atomic weight", - "Cdk.AutocorrelationMass.ATSm2": "The Moreau-Broto autocorrelation descriptors using atomic weight", - "Cdk.AutocorrelationMass.ATSm3": "The Moreau-Broto autocorrelation descriptors using atomic weight", - "Cdk.AutocorrelationMass.ATSm4": "The Moreau-Broto autocorrelation descriptors using atomic weight", - "Cdk.AutocorrelationMass.ATSm5": "The Moreau-Broto autocorrelation descriptors using atomic weight", - "Cdk.AutocorrelationCharge.ATSc1": "The Moreau-Broto autocorrelation descriptors using partial charges", - "Cdk.AutocorrelationCharge.ATSc2": "The Moreau-Broto autocorrelation descriptors using partial charges", - "Cdk.AutocorrelationCharge.ATSc3": "The Moreau-Broto autocorrelation descriptors using partial charges", - "Cdk.AutocorrelationCharge.ATSc4": "The Moreau-Broto autocorrelation descriptors using partial charges", - "Cdk.AutocorrelationCharge.ATSc5": "The Moreau-Broto autocorrelation descriptors using partial charges", - "Cdk.AtomCount.nAtom": "Descriptor based on the number of atoms of a certain element type.", - "Cdk.AromaticBondsCount.nAromBond": "Descriptor based on the number of aromatic bonds of a molecule.", - "Cdk.AromaticAtomsCount.naAromAtom": "Descriptor based on the number of aromatic atoms of a molecule.", - "Cdk.APol.apol": "Descriptor that calculates the sum of the atomic polarizabilities (including implicit hydrogens).", - "Cdk.ALOGP.ALogP": "Calculates atom additive logP and molar refractivity values as described by Ghose and Crippen and", - "Cdk.ALOGP.ALogp2": "Calculates atom additive logP and molar refractivity values as described by Ghose and Crippen and", - "Cdk.ALOGP.AMR": "Calculates atom additive logP and molar refractivity values as described by Ghose and Crippen and", - "Cdk.AcidicGroupCount.nAcid": "Returns the number of acidic groups.", - "Joelib.FractionRotatableBonds": "JOELIb does not provide meaningful descriptions, see java/JoelibDescriptors.java for details.", - "Joelib.GeometricalDiameter": "JOELIb does not provide meaningful descriptions, see java/JoelibDescriptors.java for details.", - "Joelib.GeometricalRadius": "JOELIb does not provide meaningful descriptions, see java/JoelibDescriptors.java for details.", - "Joelib.GeometricalShapeCoefficient": "JOELIb does not provide meaningful descriptions, see java/JoelibDescriptors.java for details.", - "Joelib.GraphShapeCoefficient": "JOELIb does not provide meaningful descriptions, see java/JoelibDescriptors.java for details.", - "Joelib.KierShape1": "JOELIb does not provide meaningful descriptions, see java/JoelibDescriptors.java for details.", - "Joelib.KierShape2": "JOELIb does not provide meaningful descriptions, see java/JoelibDescriptors.java for details.", - "Joelib.KierShape3": "JOELIb does not provide meaningful descriptions, see java/JoelibDescriptors.java for details.", - "Joelib.LogP": "JOELIb does not provide meaningful descriptions, see java/JoelibDescriptors.java for details.", - "Joelib.MolarRefractivity": "JOELIb does not provide meaningful descriptions, see java/JoelibDescriptors.java for details.", - "Joelib.MolecularWeight": "JOELIb does not provide meaningful descriptions, see java/JoelibDescriptors.java for details.", - "Joelib.PolarSurfaceArea": "JOELIb does not provide meaningful descriptions, see java/JoelibDescriptors.java for details.", - "Joelib.RotatableBonds": "JOELIb does not provide meaningful descriptions, see java/JoelibDescriptors.java for details.", - "Joelib.TopologicalDiameter": "JOELIb does not provide meaningful descriptions, see java/JoelibDescriptors.java for details.", - "Joelib.TopologicalRadius": "JOELIb does not provide meaningful descriptions, see java/JoelibDescriptors.java for details.", - "Joelib.ZagrebIndex1": "JOELIb does not provide meaningful descriptions, see java/JoelibDescriptors.java for details.", - "Joelib.count.AcidicGroups": "JOELIb does not provide meaningful descriptions, see java/JoelibDescriptors.java for details.", - "Joelib.count.AliphaticOHGroups": "JOELIb does not provide meaningful descriptions, see java/JoelibDescriptors.java for details.", - "Joelib.count.AromaticBonds": "JOELIb does not provide meaningful descriptions, see java/JoelibDescriptors.java for details.", - "Joelib.count.AromaticOHGroups": "JOELIb does not provide meaningful descriptions, see java/JoelibDescriptors.java for details.", - "Joelib.count.BasicGroups": "JOELIb does not provide meaningful descriptions, see java/JoelibDescriptors.java for details.", - "Joelib.count.HBA1": "JOELIb does not provide meaningful descriptions, see java/JoelibDescriptors.java for details.", - "Joelib.count.HBA2": "JOELIb does not provide meaningful descriptions, see java/JoelibDescriptors.java for details.", - "Joelib.count.HBD1": "JOELIb does not provide meaningful descriptions, see java/JoelibDescriptors.java for details.", - "Joelib.count.HBD2": "JOELIb does not provide meaningful descriptions, see java/JoelibDescriptors.java for details.", - "Joelib.count.HeavyBonds": "JOELIb does not provide meaningful descriptions, see java/JoelibDescriptors.java for details.", - "Joelib.count.HeteroCycles": "JOELIb does not provide meaningful descriptions, see java/JoelibDescriptors.java for details.", - "Joelib.count.HydrophobicGroups": "JOELIb does not provide meaningful descriptions, see java/JoelibDescriptors.java for details.", - "Joelib.count.NO2Groups": "JOELIb does not provide meaningful descriptions, see java/JoelibDescriptors.java for details.", - "Joelib.count.NumberOfAtoms": "JOELIb does not provide meaningful descriptions, see java/JoelibDescriptors.java for details.", - "Joelib.count.NumberOfB": "JOELIb does not provide meaningful descriptions, see java/JoelibDescriptors.java for details.", - "Joelib.count.NumberOfBonds": "JOELIb does not provide meaningful descriptions, see java/JoelibDescriptors.java for details.", - "Joelib.count.NumberOfBr": "JOELIb does not provide meaningful descriptions, see java/JoelibDescriptors.java for details.", - "Joelib.count.NumberOfC": "JOELIb does not provide meaningful descriptions, see java/JoelibDescriptors.java for details.", - "Joelib.count.NumberOfCl": "JOELIb does not provide meaningful descriptions, see java/JoelibDescriptors.java for details.", - "Joelib.count.NumberOfF": "JOELIb does not provide meaningful descriptions, see java/JoelibDescriptors.java for details.", - "Joelib.count.NumberOfHal": "JOELIb does not provide meaningful descriptions, see java/JoelibDescriptors.java for details.", - "Joelib.count.NumberOfI": "JOELIb does not provide meaningful descriptions, see java/JoelibDescriptors.java for details.", - "Joelib.count.NumberOfN": "JOELIb does not provide meaningful descriptions, see java/JoelibDescriptors.java for details.", - "Joelib.count.NumberOfO": "JOELIb does not provide meaningful descriptions, see java/JoelibDescriptors.java for details.", - "Joelib.count.NumberOfP": "JOELIb does not provide meaningful descriptions, see java/JoelibDescriptors.java for details.", - "Joelib.count.NumberOfS": "JOELIb does not provide meaningful descriptions, see java/JoelibDescriptors.java for details.", - "Joelib.count.OSOGroups": "JOELIb does not provide meaningful descriptions, see java/JoelibDescriptors.java for details.", - "Joelib.count.SO2Groups": "JOELIb does not provide meaningful descriptions, see java/JoelibDescriptors.java for details.", - "Joelib.count.SOGroups": "JOELIb does not provide meaningful descriptions, see java/JoelibDescriptors.java for details." - }, "tags": [ "compound", "descriptor" @@ -434,9 +74,6 @@ } }, "post": { - "x-orn-@type": "x-orn:Prediction", - "x-orn:path": "https://lazar.prod.openrisknet.org/compound/descriptor", - "x-orn:method": "Post", "tags": [ "compound", "descriptor" @@ -470,7 +107,6 @@ "required": true, "content": { "application/x-www-form-urlencoded": { - "x-orn:schema": "application/x-www-form-urlencoded", "schema": { "$ref": "#/components/schemas/postdescriptor" } @@ -479,11 +115,8 @@ } } }, - "/compound/descriptor/{descriptor}": { + "/api/compound/descriptor/{descriptor}": { "get": { - "x-orn-@type": "x-orn:Descriptor", - "x-orn:path": "https://lazar.prod.openrisknet.org/compound/descriptor/{descriptor}", - "x-orn:method": "Get", "tags": [ "compound", "descriptor" @@ -522,11 +155,8 @@ } } }, - "/compound/{InChI}": { + "/api/compound/{InChI}": { "get": { - "x-orn-@type": "x-orn:Compound", - "x-orn:path": "https://lazar.prod.openrisknet.org/compound/{InChI}", - "x-orn:method": "Get", "tags": [ "compound" ], @@ -544,57 +174,43 @@ "description": "OK", "content": { "application/json": { - "x-orn:returns": "application/json", "schema": { - "x-orn:property": "InChI", "type": "string", "example": "InChI=1S/C6H6/c1-2-4-6-5-3-1/h1-6H" } }, "chemical/x-daylight-smiles": { - "x-orn:returns": "chemical/x-daylight-smiles", "schema": { - "x-orn:property": "InChI", "type": "string", "example": "InChI=1S/C6H6/c1-2-4-6-5-3-1/h1-6H" } }, "chemical/x-inchi": { - "x-orn:returns": "chemical/x-inchi", "schema": { - "x-orn:property": "InChI", "type": "string", "example": "InChI=1S/C6H6/c1-2-4-6-5-3-1/h1-6H" } }, "chemical/x-mdl-sdfile": { - "x-orn:returns": "chemical/x-mdl-sdfile", "schema": { - "x-orn:property": "InChI", "type": "string", "example": "InChI=1S/C6H6/c1-2-4-6-5-3-1/h1-6H" } }, "image/png": { - "x-orn:returns": "image/png", "schema": { - "x-orn:property": "InChI", "type": "string", "example": "InChI=1S/C6H6/c1-2-4-6-5-3-1/h1-6H" } }, "image/svg+xml": { - "x-orn:returns": "image/svg+xml", "schema": { - "x-orn:property": "InChI", "type": "string", "example": "InChI=1S/C6H6/c1-2-4-6-5-3-1/h1-6H" } }, "text/plain": { - "x-orn:returns": "text/plain", "schema": { - "x-orn:property": "InChI", "type": "string", "example": "InChI=1S/C6H6/c1-2-4-6-5-3-1/h1-6H" } @@ -610,11 +226,8 @@ } } }, - "/dataset": { + "/api/dataset": { "get": { - "x-orn-@type": "x-orn:Dataset", - "x-orn:path": "https://lazar.prod.openrisknet.org/dataset", - "x-orn:method": "Get", "tags": [ "dataset" ], @@ -643,11 +256,8 @@ } } }, - "/dataset/{id}": { + "/api/dataset/{id}": { "get": { - "x-orn-@type": "x-orn:Dataset", - "x-orn:path": "https://lazar.prod.openrisknet.org/dataset/{id}", - "x-orn:method": "Get", "tags": [ "dataset" ], @@ -665,10 +275,8 @@ "description": "OK", "content": { "text/csv": { - "x-orn:returns": "text/csv" }, "application/csv": { - "x-orn:returns": "text/csv" } } }, @@ -690,11 +298,8 @@ } } }, - "/dataset/{id}/{attribute}": { + "/api/dataset/{id}/{attribute}": { "get": { - "x-orn-@type": "x-orn:Dataset", - "x-orn:path": "https://lazar.prod.openrisknet.org/dataset/{id}/{attribute}", - "x-orn:method": "Get", "tags": [ "dataset" ], @@ -743,11 +348,8 @@ } } }, - "/endpoint": { + "/api/endpoint": { "get": { - "x-orn-@type": "x-orn:Endpoint", - "x-orn:path": "https://lazar.prod.openrisknet.org/endpoint", - "x-orn:method": "Get", "tags": [ "endpoint" ], @@ -776,11 +378,8 @@ } } }, - "/endpoint/{endpoint}": { + "/api/endpoint/{endpoint}": { "get": { - "x-orn-@type": "x-orn:Endpoint", - "x-orn:path": "https://lazar.prod.openrisknet.org/endpoint", - "x-orn:method": "Get", "tags": [ "endpoint" ], @@ -812,11 +411,8 @@ } } }, - "/feature": { + "/api/feature": { "get": { - "x-orn-@type": "x-orn:Feature", - "x-orn:path": "https://lazar.prod.openrisknet.org/feature", - "x-orn:method": "Get", "tags": [ "feature" ], @@ -845,11 +441,8 @@ } } }, - "/feature/{id}": { + "/api/feature/{id}": { "get": { - "x-orn-@type": "x-orn:Feature", - "x-orn:path": "https://lazar.prod.openrisknet.org/feature/{id}", - "x-orn:method": "Get", "tags": [ "feature" ], @@ -884,11 +477,8 @@ } } }, - "/model": { + "/api/model": { "get": { - "x-orn-@type": "x-orn:Model", - "x-orn:path": "https://lazar.prod.openrisknet.org/model", - "x-orn:method": "Get", "tags": [ "model" ], @@ -917,11 +507,8 @@ } } }, - "/model/{id}": { + "/api/model/{id}": { "get": { - "x-orn-@type": "x-orn:Model", - "x-orn:path": "https://lazar.prod.openrisknet.org/model", - "x-orn:method": "Get", "tags": [ "model" ], @@ -953,9 +540,6 @@ } }, "post": { - "x-orn-@type": "x-orn:Prediction", - "x-orn:path": "https://lazar.prod.openrisknet.org/model/{id}", - "x-orn:method": "Post", "tags": [ "model" ], @@ -990,7 +574,6 @@ "required": true, "content": { "application/x-www-form-urlencoded": { - "x-orn:schema": "application/x-www-form-urlencoded", "schema": { "$ref": "#/components/schemas/postmodel" } @@ -999,11 +582,8 @@ } } }, - "/report": { + "/api/report": { "get": { - "x-orn-@type": "x-orn:Report", - "x-orn:path": "https://lazar.prod.openrisknet.org/report", - "x-orn:method": "Get", "tags": [ "report" ], @@ -1032,11 +612,8 @@ } } }, - "/report/{id}": { + "/api/report/{id}": { "get": { - "x-orn-@type": "x-orn:Report", - "x-orn:path": "https://lazar.prod.openrisknet.org/report/{id}", - "x-orn:method": "Get", "tags": [ "report" ], @@ -1051,7 +628,14 @@ ], "responses": { "200": { - "$ref": "#/components/responses/200" + "description": "OK", + "content": { + "application/xml": { + "schema": { + "type": "object" + } + } + } }, "400": { "$ref": "#/components/responses/400" @@ -1068,11 +652,8 @@ } } }, - "/substance": { + "/api/substance": { "get": { - "x-orn-@type": "x-orn:Substance", - "x-orn:path": "https://lazar.prod.openrisknet.org/substance", - "x-orn:method": "Get", "tags": [ "substance" ], @@ -1101,11 +682,8 @@ } } }, - "/substance/{id}": { + "/api/substance/{id}": { "get": { - "x-orn-@type": "x-orn:Substance", - "x-orn:path": "https://lazar.prod.openrisknet.org/substance/{id}", - "x-orn:method": "Get", "tags": [ "substance" ], @@ -1140,11 +718,8 @@ } } }, - "/validation": { + "/api/validation": { "get": { - "x-orn-@type": "x-orn:Validation", - "x-orn:path": "https://lazar.prod.openrisknet.org/validation", - "x-orn:method": "Get", "tags": [ "validation" ], @@ -1173,11 +748,8 @@ } } }, - "/validation/{validationtype}": { + "/api/validation/{validationtype}": { "get": { - "x-orn-@type": "x-orn:Validation", - "x-orn:path": "https://lazar.prod.openrisknet.org/validation/{validationtype}", - "x-orn:method": "Get", "tags": [ "validation" ], @@ -1212,11 +784,8 @@ } } }, - "/validation/{validationtype}/{id}": { + "/api/validation/{validationtype}/{id}": { "get": { - "x-orn-@type": "x-orn:Validation", - "x-orn:path": "https://lazar.prod.openrisknet.org/validation/{validationtype}/{id}", - "x-orn:method": "Get", "tags": [ "validation" ], @@ -1303,7 +872,6 @@ "type": "object", "properties": { "identifier": { - "x-orn:property": "identifier", "type": "string", "example": "O=C1NC(=O)NC=C1" } @@ -1313,12 +881,10 @@ "type": "object", "properties": { "identifier": { - "x-orn:property": "identifier", "type": "string", "example": "O=C1NC(=O)NC=C1" }, "descriptor": { - "x-orn:property": "descriptor", "type": "string", "example": "Openbabel.MW,Openbabel.atoms" } @@ -1383,7 +949,6 @@ "description": "OK", "content": { "application/json": { - "x-orn:returns": "application/json", "schema": { "type": "object" } @@ -1394,7 +959,6 @@ "description": "Created", "content": { "application/json": { - "x-orn:returns": "application/json", "schema": { "type": "object" } @@ -1405,13 +969,11 @@ "description": "Accepted", "content": { "application/json": { - "x-orn:returns": "application/json", "schema": { "type": "object" } }, "text/plain": { - "x-orn:returns": "text/uri-list", "schema": { "type": "object" } diff --git a/application.rb b/application.rb index 43030d0..73ec11a 100644 --- a/application.rb +++ b/application.rb @@ -3,7 +3,7 @@ require_relative 'qmrf_report.rb' require_relative 'task.rb' require_relative 'helper.rb' include OpenTox -=begin + [ "api.rb", "compound.rb", @@ -16,7 +16,6 @@ include OpenTox "swagger.rb", "validation.rb" ].each{ |f| require_relative "./lib/#{f}" } -=end configure :production, :development do STDOUT.sync = true @@ -25,7 +24,6 @@ configure :production, :development do enable :reloader also_reload './helper.rb' also_reload './qmrf_report.rb' -=begin [ "api.rb", "compound.rb", @@ -38,12 +36,10 @@ configure :production, :development do "swagger.rb", "validation.rb" ].each{ |f| also_reload "./lib/#{f}" } -=end end -=begin + before do $paths = [ - "/", "api", "compound", "dataset", @@ -54,24 +50,20 @@ before do "substance", "swagger", "validation"] - if request.path == "/" || $paths.include?(request.path.split("/")[1]) - @accept = request.env['HTTP_ACCEPT'] + if request.path.split("/")[1] == "api" || $paths.include?(request.path.split("/")[2]) + @accept = request.env['HTTP_ACCEPT'].split(",").first response['Content-Type'] = @accept else @version = File.read("VERSION").chomp end end -=end -before do - @version = File.read("VERSION").chomp -end not_found do redirect to('/predict') end -=begin + error do - if request.path == "/" || $paths.include?(request.path.split("/")[1]) + if request.path.split("/")[1] == "api" || $paths.include?(request.path.split("/")[2]) @accept = request.env['HTTP_ACCEPT'] response['Content-Type'] = @accept @accept == "text/plain" ? request.env['sinatra.error'] : request.env['sinatra.error'].to_json @@ -80,20 +72,14 @@ error do haml :error end end -=end -error do - @error = request.env['sinatra.error'] - haml :error -end -=begin # https://github.com/britg/sinatra-cross_origin#responding-to-options options "*" do response.headers["Allow"] = "HEAD,GET,PUT,POST,DELETE,OPTIONS" response.headers["Access-Control-Allow-Headers"] = "X-Requested-With, X-HTTP-Method-Override, Content-Type, Cache-Control, Accept" 200 end -=end + get '/predict/?' do @models = OpenTox::Model::Validation.all @endpoints = @models.collect{|m| m.endpoint}.sort.uniq diff --git a/helper.rb b/helper.rb index 41fd9eb..cb77ffd 100644 --- a/helper.rb +++ b/helper.rb @@ -19,5 +19,8 @@ helpers do doc.to_html.html_safe end + def is_mongoid? + self.match(/^[a-f\d]{24}$/i) ? true : false + end end diff --git a/lib/api.rb b/lib/api.rb index 28e33df..c3b27ce 100644 --- a/lib/api.rb +++ b/lib/api.rb @@ -1,9 +1,23 @@ -# route to swagger API file -get "/api/api.json" do - response['Content-Type'] = "application/json" +get "/api" do api_file = File.join("api", "api.json") - bad_request_error "API Documentation in Swagger JSON is not implemented." unless File.exists?(api_file) - api_hash = JSON.parse(File.read(api_file)) - api_hash["host"] = request.env['HTTP_HOST'] - return api_hash.to_json + halt 400, "API Documentation in Swagger JSON is not implemented." unless File.exists?(api_file) + case @accept + when "text/html" + response['Content-Type'] = "text/html" + index_file = File.join(ENV['HOME'],"swagger-ui/dist/index.html") + File.read(index_file) + when "application/json" + response['Content-Type'] = "application/json" + api_hash = JSON.parse(File.read(api_file)) + api_hash["host"] = request.env['HTTP_HOST'] + return api_hash.to_json + else + halt 400, "unknown MIME type '#{@accept}'" + end +end + +get "/api/api.json" do + response['Content-Type'] = "text/html" + index_file = File.join(ENV['HOME'],"swagger-ui/dist/index.html") + File.read(index_file) end diff --git a/lib/compound.rb b/lib/compound.rb index 77948ab..4606aa4 100644 --- a/lib/compound.rb +++ b/lib/compound.rb @@ -2,7 +2,7 @@ # @param [Header] Accept one of text/plain, application/json # @param [Path] Descriptor name or descriptor ID (e.G.: Openbabel.HBA1, 5755f8eb3cf99a00d8fedf2f) # @return [text/plain, application/json] list of all prediction models -get "/compound/descriptor/?:descriptor?" do +get "/api/compound/descriptor/?:descriptor?" do case @accept when "application/json" return "#{JSON.pretty_generate PhysChem::DESCRIPTORS} " unless params[:descriptor] @@ -15,7 +15,7 @@ get "/compound/descriptor/?:descriptor?" do end end -post "/compound/descriptor/?" do +post "/api/compound/descriptor/?" do bad_request_error "Missing Parameter " unless params[:identifier] && params[:descriptor] descriptors = params['descriptor'].split(',') compound = Compound.from_smiles params[:identifier] @@ -38,7 +38,7 @@ post "/compound/descriptor/?" do end end -get %r{/compound/(InChI.+)} do |input| +get %r{/api/compound/(InChI.+)} do |input| compound = Compound.from_inchi URI.unescape(input) if compound response['Content-Type'] = @accept diff --git a/lib/dataset.rb b/lib/dataset.rb index 749167b..00685b8 100644 --- a/lib/dataset.rb +++ b/lib/dataset.rb @@ -1,136 +1,29 @@ # Get all datasets -get "/dataset/?" do - datasets = Dataset.all +get "/api/dataset/?" do + datasets = Dataset.all #.limit(100) case @accept - when "text/uri-list" - uri_list = datasets.collect{|dataset| uri("/dataset/#{dataset.id}")} - return uri_list.join("\n") + "\n" when "application/json" - datasets = JSON.parse datasets.to_json - list = [] - datasets.each{|d| list << uri("/dataset/#{d["_id"]["$oid"]}")} - return list.to_json + list = datasets.collect{|dataset| uri("/api/dataset/#{dataset.id}")}.to_json + return list else - bad_request_error "Mime type #{@accept} is not supported." + halt 400, "Mime type #{@accept} is not supported." end end # Get a dataset -get "/dataset/:id/?" do - if Task.where(id: params[:id]).exists? - task = Task.find params[:id] - halt 404, "Dataset with id: #{params[:id]} not found." unless task.percent == 100 - $logger.debug task.inspect - response['Content-Type'] = "text/csv" - m = Model::Validation.find task.model_id - dataset = Batch.find task.dataset_id - @ids = dataset.ids - warnings = dataset.warnings.blank? ? nil : dataset.warnings.join("\n") - unless warnings.nil? - @parse = [] - warnings.split("\n").each do |warning| - if warning =~ /^Cannot/ - smi = warning.split("SMILES compound").last.split("at").first - line = warning.split("SMILES compound").last.split("at line").last.split("of").first.strip.to_i - @parse << "Cannot parse SMILES compound#{smi}at line #{line} of #{dataset.source.split("/").last}\n" - end - end - keys_array = [] - warnings.split("\n").each do |warning| - if warning =~ /^Duplicate/ - text = warning.split("ID").first - numbers = warning.split("ID").last.split("and") - keys_array << numbers.collect{|n| n.strip.to_i} - end - end - @dups = {} - keys_array.each do |keys| - keys.each do |key| - @dups[key] = "Duplicate compound at ID #{keys.join(" and ")}\n" - end - end - end - $logger.debug "dups: #{@dups}" - endpoint = "#{m.endpoint}_(#{m.species})" - tempfile = Tempfile.new - header = task.csv - lines = [] - $logger.debug task.predictions - task.predictions[m.id.to_s].each_with_index do |hash,idx| - identifier = hash.keys[0] - prediction_id = hash.values[0] - # add duplicate warning at the end of a line if ID matches - if @dups[idx+1] - if prediction_id.is_a? BSON::ObjectId - if @ids.blank? - lines << "#{idx+1},#{identifier},#{Prediction.find(prediction_id).csv.tr("\n","")},#{@dups[idx+1]}" - else - lines << "#{idx+1},#{@ids[idx]},#{identifier},#{Prediction.find(prediction_id).csv.tr("\n","")},#{@dups[idx+1]}" - end - else - if @ids.blank? - lines << "#{idx+1},#{identifier},\n" - else - lines << "#{idx+1},#{@ids[idx]}#{identifier},\n" - end - end - else - if prediction_id.is_a? BSON::ObjectId - if @ids.blank? - lines << "#{idx+1},#{identifier},#{Prediction.find(prediction_id).csv}" - else - lines << "#{idx+1},#{@ids[idx]},#{identifier},#{Prediction.find(prediction_id).csv}" - end - else - if @ids.blank? - lines << "#{idx+1},#{identifier},\n" - else - lines << "#{idx+1},#{@ids[idx]}#{identifier},\n" - end - end - end - end - (@parse && !@parse.blank?) ? tempfile.write(header+lines.join("")+"\n"+@parse.join("\n")) : tempfile.write(header+lines.join("")) - #tempfile.write(header+lines.join("")) - tempfile.rewind - ######################## -=begin - header = task.csv - lines = [] - task.predictions.each_with_index do |result,idx| - identifier = result[0] - prediction_id = result[1] - prediction = Prediction.find prediction_id - lines << "#{idx+1},#{identifier},#{prediction.csv.tr("\n","")}" - end - return header+lines.join("\n") -=end - return tempfile.read +get "/api/dataset/:id/?" do + dataset = Dataset.find :id => params[:id] + halt 400, "Dataset with id: #{params[:id]} not found." unless dataset + case @accept + when "text/csv", "application/csv" + return dataset.to_csv else - dataset = Dataset.find :id => params[:id] - halt 400, "Dataset with id: #{params[:id]} not found." unless dataset - case @accept - when "application/json" - dataset.data_entries.each do |k, v| - dataset.data_entries[k][:URI] = uri("/substance/#{k}") - end - dataset[:URI] = uri("/dataset/#{dataset.id}") - dataset[:substances] = uri("/dataset/#{dataset.id}/substances") - dataset[:features] = uri("/dataset/#{dataset.id}/features") - return dataset.to_json - when "text/csv", "application/csv" - return dataset.to_csv - else - bad_request_error "Mime type #{@accept} is not supported." - end + bad_request_error "Mime type #{@accept} is not supported." end end # Get a dataset attribute. One of compounds, nanoparticles, substances, features -get "/dataset/:id/:attribute/?" do - if Task.where(id: params[:id]).exists? - halt 400, "No attributes selection available for dataset with id: #{params[:id]}.".to_json - end +get "/api/dataset/:id/:attribute/?" do dataset = Dataset.find :id => params[:id] halt 400, "Dataset with id: #{params[:id]} not found." unless dataset attribs = ["compounds", "nanoparticles", "substances", "features"] diff --git a/lib/endpoint.rb b/lib/endpoint.rb index ef39787..66b7ab2 100644 --- a/lib/endpoint.rb +++ b/lib/endpoint.rb @@ -1,7 +1,7 @@ # Get a list of all endpoints # @param [Header] Accept one of text/uri-list, # @return [text/uri-list] list of all prediction models -get "/endpoint/?" do +get "/api/endpoint/?" do models = Model::Validation.all endpoints = models.collect{|m| m.endpoint}.uniq case @accept @@ -10,14 +10,14 @@ get "/endpoint/?" do when "application/json" return endpoints.to_json else - bad_request_error "Mime type #{@accept} is not supported." + halt 400, "Mime type #{@accept} is not supported." end end -get "/endpoint/:endpoint/?" do +get "/api/endpoint/:endpoint/?" do models = Model::Validation.where(endpoint: params[:endpoint]) list = [] - models.each{|m| list << {m.species => uri("/model/#{m.id}")} } - not_found_error "Endpoint: #{params[:endpoint]} not found." if models.blank? + models.each{|m| list << {m.species => uri("/api/model/#{m.id}")} } + halt 404, "Endpoint: #{params[:endpoint]} not found." if models.blank? return list.to_json end diff --git a/lib/feature.rb b/lib/feature.rb index 06a5b37..3123997 100644 --- a/lib/feature.rb +++ b/lib/feature.rb @@ -1,5 +1,5 @@ # Get all Features -get "/feature/?" do +get "/api/feature/?" do features = Feature.all case @accept when "text/uri-list" @@ -16,7 +16,7 @@ get "/feature/?" do end # Get a feature -get "/feature/:id/?" do +get "/api/feature/:id/?" do case @accept when "application/json" feature = Feature.find :id => params[:id] diff --git a/lib/model.rb b/lib/model.rb index 42f3a95..9bf4f53 100644 --- a/lib/model.rb +++ b/lib/model.rb @@ -1,29 +1,29 @@ # Get a list of all prediction models # @param [Header] Accept one of text/uri-list, # @return [text/uri-list] list of all prediction models -get "/model/?" do +get "/api/model/?" do models = Model::Validation.all case @accept when "text/uri-list" - uri_list = models.collect{|model| uri("/model/#{model.id}")} + uri_list = models.collect{|model| uri("/api/model/#{model.id}")} return uri_list.join("\n") + "\n" when "application/json" models = JSON.parse models.to_json list = [] - models.each{|m| list << uri("/model/#{m["_id"]["$oid"]}")} + models.each{|m| list << uri("/api/model/#{m["_id"]["$oid"]}")} return list.to_json else - bad_request_error "Mime type #{@accept} is not supported." + halt 400, "Mime type #{@accept} is not supported." end end -get "/model/:id/?" do +get "/api/model/:id/?" do model = Model::Validation.find params[:id] - not_found_error "Model with id: #{params[:id]} not found." unless model + halt 400, "Model with id: #{params[:id]} not found." unless model return model.to_json end -post "/model/:id/?" do +post "/api/model/:id/?" do if request.content_type == "application/x-www-form-urlencoded" identifier = params[:identifier].strip.gsub(/\A"|"\Z/,'') compound = Compound.from_smiles identifier @@ -146,6 +146,6 @@ post "/model/:id/?" do tid = @task.id.to_s return 202, to("/task/#{tid}").to_json else - bad_request_error "No accepted content type" + halt 400, "No accepted content type" end end diff --git a/lib/report.rb b/lib/report.rb index f576106..7c06d60 100644 --- a/lib/report.rb +++ b/lib/report.rb @@ -1,208 +1,29 @@ # Get a list of all possible reports to prediction models # @param [Header] Accept one of text/uri-list, # @return [text/uri-list] list of all prediction models -get "/report/?" do +get "/api/report/?" do models = Model::Validation.all case @accept when "text/uri-list" - uri_list = models.collect{|model| uri("/report/#{model.model_id}")} + uri_list = models.collect{|model| uri("/api/report/#{model.model_id}")} return uri_list.join("\n") + "\n" when "application/json" models = JSON.parse models.to_json list = [] - models.each{|m| list << uri("/report/#{m["model_id"]["$oid"]}")} + models.each{|m| list << uri("/api/report/#{m["_id"]["$oid"]}")} return list.to_json else - bad_request_error "Mime type #{@accept} is not supported." + halt 400, "Mime type #{@accept} is not supported." end end -get "/report/:id/?" do +get "/api/report/:id/?" do case @accept when "application/xml" - model = Model::Lazar.find params[:id] - not_found_error "Model with id: #{params[:id]} not found." unless model - prediction_model = Model::Validation.find_by :model_id => params[:id] - validation_template = File.join(File.dirname(__FILE__),"../views/model_details.haml") - - if File.directory?("#{File.dirname(__FILE__)}/../../lazar") - lazar_commit = `cd #{File.dirname(__FILE__)}/../../lazar; git rev-parse HEAD`.strip - lazar_commit = "https://github.com/opentox/lazar/tree/#{lazar_commit}" - else - lazar_commit = "https://github.com/opentox/lazar/releases/tag/v#{Gem.loaded_specs["lazar"].version}" - end - - report = OpenTox::QMRFReport.new - - # QSAR Identifier Title 1.1 - report.value "QSAR_title", "Lazar model for #{prediction_model.species} #{prediction_model.endpoint}" - - # Software coding the model 1.3 - report.change_catalog :software_catalog, :firstsoftware, {:name => "lazar", :description => "lazar Lazy Structure- Activity Relationships", :number => "1", :url => "https://lazar.in-silico.ch", :contact => "info@in-silico.ch"} - report.ref_catalog :QSAR_software, :software_catalog, :firstsoftware - - # Date of QMRF 2.1 - report.value "qmrf_date", "#{Time.now.strftime('%d %B %Y')}" - - # QMRF author(s) and contact details 2.1 - report.change_catalog :authors_catalog, :firstauthor, {:name => "Christoph Helma", :affiliation => "in silico toxicology gmbh", :contact => "Rastatterstr. 41, CH-4057 Basel", :email => "info@in-silico.ch", :number => "1", :url => "www.in-silico.ch"} - report.ref_catalog :qmrf_authors, :authors_catalog, :firstauthor - - # Model developer(s) and contact details 2.5 - report.change_catalog :authors_catalog, :modelauthor, {:name => "Christoph Helma", :affiliation => "in silico toxicology gmbh", :contact => "Rastatterstr. 41, CH-4057 Basel", :email => "info@in-silico.ch", :number => "1", :url => "www.in-silico.ch"} - report.ref_catalog :model_authors, :authors_catalog, :modelauthor - - # Date of model development and/or publication 2.6 - report.value "model_date", "#{Time.parse(model.created_at.to_s).strftime('%Y')}" - - # Reference(s) to main scientific papers and/or software package 2.7 - report.change_catalog :publications_catalog, :publications_catalog_1, {:title => "Maunz, Guetlein, Rautenberg, Vorgrimmler, Gebele and Helma (2013), lazar: a modular predictive toxicology framework ", :url => "http://dx.doi.org/10.3389/fphar.2013.00038"} - report.ref_catalog :references, :publications_catalog, :publications_catalog_1 - - # Reference(s) to main scientific papers and/or software package 2.7 - report.change_catalog :publications_catalog, :publications_catalog_2, {:title => "Maunz A and Helma C (2008) Prediction of chemical toxicity with local support vector regression and activity-specific kernels. SAR & QSAR in Environmental Research 19 (5-6), 413-431", :url => "http://dx.doi.org/10.1080/10629360802358430"} - report.ref_catalog :references, :publications_catalog, :publications_catalog_2 - - # Species 3.1 - report.value "model_species", prediction_model.species - - # Endpoint 3.2 - report.change_catalog :endpoints_catalog, :endpoints_catalog_1, {:name => prediction_model.endpoint, :group => ""} - report.ref_catalog :model_endpoint, :endpoints_catalog, :endpoints_catalog_1 - - # Endpoint Units 3.4 - report.value "endpoint_units", "#{prediction_model.unit}" - - model_type = model.class.to_s.gsub('OpenTox::Model::Lazar','') - - # Type of model 4.1 - report.value "algorithm_type", "#{model_type}" - - # Explicit algorithm 4.2 - report.change_catalog :algorithms_catalog, :algorithms_catalog_1, {:definition => "see Helma 2016 and lazar.in-silico.ch, submitted version: #{lazar_commit}", :description => "Neighbor algorithm: #{model.algorithms["similarity"]["method"].gsub('_',' ').titleize}#{(model.algorithms["similarity"][:min] ? ' with similarity > ' + model.algorithms["similarity"][:min].to_s : '')}"} - report.ref_catalog :algorithm_explicit, :algorithms_catalog, :algorithms_catalog_1 - report.change_catalog :algorithms_catalog, :algorithms_catalog_3, {:definition => "see Helma 2016 and lazar.in-silico.ch, submitted version: #{lazar_commit}", :description => "modified k-nearest neighbor #{model_type}"} - report.ref_catalog :algorithm_explicit, :algorithms_catalog, :algorithms_catalog_3 - if model.algorithms["prediction"] - pred_algorithm_params = (model.algorithms["prediction"][:method] == "rf" ? "random forest" : model.algorithms["prediction"][:method]) - end - report.change_catalog :algorithms_catalog, :algorithms_catalog_2, {:definition => "see Helma 2016 and lazar.in-silico.ch, submitted version: #{lazar_commit}", :description => "Prediction algorithm: #{model.algorithms["prediction"].to_s.gsub('OpenTox::Algorithm::','').gsub('_',' ').gsub('.', ' with ')} #{(pred_algorithm_params ? pred_algorithm_params : '')}"} - report.ref_catalog :algorithm_explicit, :algorithms_catalog, :algorithms_catalog_2 - - # Descriptors in the model 4.3 - if model.algorithms["descriptors"][:type] - report.change_catalog :descriptors_catalog, :descriptors_catalog_1, {:description => "", :name => "#{model.algorithms["descriptors"][:type]}", :publication_ref => "", :units => ""} - report.ref_catalog :algorithms_descriptors, :descriptors_catalog, :descriptors_catalog_1 - end - - # Descriptor selection 4.4 - report.value "descriptors_selection", "#{model.algorithms["feature_selection"].gsub('_',' ')} #{model.algorithms["feature_selection"].collect{|k,v| k.to_s + ': ' + v.to_s}.join(', ')}" if model.algorithms["feature_selection"] - - # Algorithm and descriptor generation 4.5 - report.value "descriptors_generation", "exhaustive breadth first search for paths in chemical graphs (simplified MolFea algorithm)" - - # Software name and version for descriptor generation 4.6 - report.change_catalog :software_catalog, :software_catalog_2, {:name => "lazar, submitted version: #{lazar_commit}", :description => "simplified MolFea algorithm", :number => "2", :url => "https://lazar.in-silico.ch", :contact => "info@in-silico.ch"} - report.ref_catalog :descriptors_generation_software, :software_catalog, :software_catalog_2 - - # Chemicals/Descriptors ratio 4.7 - report.value "descriptors_chemicals_ratio", "not applicable (classification based on activities of neighbors, descriptors are used for similarity calculation)" - - # Description of the applicability domain of the model 5.1 - report.value "app_domain_description", " -

- The applicability domain (AD) of the training set is characterized by - the confidence index of a prediction (high confidence index: close to - the applicability domain of the training set/reliable prediction, low - confidence: far from the applicability domain of the - trainingset/unreliable prediction). The confidence index considers (i) - the similarity and number of neighbors and (ii) contradictory examples - within the neighbors. A formal definition can be found in Helma 2006. -

-

- The reliability of predictions decreases gradually with increasing - distance from the applicability domain (i.e. decreasing confidence index) -

- - " - - # Method used to assess the applicability domain 5.2 - report.value "app_domain_method", "see Helma 2006 and Maunz 2008" - - # Software name and version for applicability domain assessment 5.3 - report.change_catalog :software_catalog, :software_catalog_3, {:name => "lazar, submitted version: #{lazar_commit}", :description => "integrated into main lazar algorithm", :number => "3", :url => "https://lazar.in-silico.ch", :contact => "info@in-silico.ch"} - report.ref_catalog :app_domain_software, :software_catalog, :software_catalog_3 - - # Limits of applicability 5.4 - report.value "applicability_limits", "Predictions with low confidence index, unknown substructures and neighbors that might act by different mechanisms" - - # Availability of the training set 6.1 - report.change_attributes "training_set_availability", {:answer => "Yes"} - - # Available information for the training set 6.2 - report.change_attributes "training_set_data", {:cas => "Yes", :chemname => "Yes", :formula => "Yes", :inchi => "Yes", :mol => "Yes", :smiles => "Yes"} - - # Data for each descriptor variable for the training set 6.3 - report.change_attributes "training_set_descriptors", {:answer => "No"} - - # Data for the dependent variable for the training set 6.4 - report.change_attributes "dependent_var_availability", {:answer => "All"} - - # Other information about the training set 6.5 - report.value "other_info", "#{prediction_model.source}" - - # Pre-processing of data before modelling 6.6 - report.value "preprocessing", (model.class == OpenTox::Model::LazarRegression ? "-log10 transformation" : "none") - - # Robustness - Statistics obtained by leave-many-out cross-validation 6.9 - if prediction_model.repeated_crossvalidation - crossvalidations = prediction_model.crossvalidations - out = haml File.read(validation_template), :layout=> false, :locals => {:model => prediction_model} - report.value "lmo", out - end - - # Mechanistic basis of the model 8.1 - report.value "mechanistic_basis"," -

- Compounds with similar structures (neighbors) are assumed to have - similar activities as the query compound. For the determination of - activity specific similarities only statistically relevant subtructures - (paths) are used. For this reason there is a priori no bias towards - specific mechanistic hypothesis. -

- - " - - # A priori or a posteriori mechanistic interpretation 8.2 - report.value "mechanistic_basis_comments","a posteriori for individual predictions" - - # Other information about the mechanistic interpretation 8.3 - report.value "mechanistic_basis_info","

Hypothesis about biochemical mechanisms can be derived from individual - predictions by inspecting neighbors and relevant fragments.

-

Neighbors are compounds that are similar in respect to a certain - endpoint and it is likely that compounds with high similarity act by - similar mechanisms as the query compound. Links at the webinterface - prove an easy access to additional experimental data and literature - citations for the neighbors and the query structure.

-

Activating and deactivating parts of the query compound are highlighted - in red and green on the webinterface. Fragments that are unknown (or too - infrequent for statistical evaluation are marked in yellow and - additional statistical information about the individual fragments can be - retrieved. Please note that lazar predictions are based on neighbors and - not on fragments. Fragments and their statistical significance are used - for the calculation of activity specific similarities.

" - - # Bibliography 9.2 - report.ref_catalog :bibliography, :publications_catalog, :publications_catalog_1 - report.ref_catalog :bibliography, :publications_catalog, :publications_catalog_2 - report.change_catalog :publications_catalog, :publications_catalog_3, {:title => "Helma (2006), Lazy structure-activity relationships (lazar) for the prediction of rodent carcinogenicity and Salmonella mutagenicity.", :url => "http://dx.doi.org/10.1007/s11030-005-9001-5"} - report.ref_catalog :bibliography, :publications_catalog, :publications_catalog_3 - - # output - response['Content-Type'] = "application/xml" + report = qmrf_report params[:id] return report.to_xml else - bad_request_error "Mime type #{@accept} is not supported." + halt 400, "Mime type #{@accept} is not supported." end end diff --git a/lib/substance.rb b/lib/substance.rb index f493714..5d57505 100644 --- a/lib/substance.rb +++ b/lib/substance.rb @@ -1,5 +1,5 @@ # Get all substances -get "/substance/?" do +get "/api/substance/?" do substances = Substance.all case @accept when "text/uri-list" @@ -10,25 +10,25 @@ get "/substance/?" do substances = JSON.parse list.to_json return JSON.pretty_generate substances else - bad_request_error "Mime type #{@accept} is not supported." + halt 400, "Mime type #{@accept} is not supported." end end # Get a substance by ID -get "/substance/:id/?" do +get "/api/substance/:id/?" do case @accept when "application/json" - mongoid = /^[a-f\d]{24}$/i - halt 400, "Input #{params[:id]} is no valid ID.".to_json unless params[:id].match(mongoid) substance = Substance.find params[:id] if substance - out = {"compound": {"id": substance.id, "inchi": substance.inchi, "smiles": substance.smiles, "warnings": substance.warnings}} - response['Content-Type'] = @accept + out = {"compound": {"id": substance.id, + "inchi": substance.inchi, + "smiles": substance.smiles + }} return JSON.pretty_generate JSON.parse(out.to_json) else - halt 400, "Substance with ID #{input} not found." + halt 400, "Substance with ID #{params[:id]} not found." end else - bad_request_error "Mime type #{@accept} is not supported." + halt 400, "Mime type #{@accept} is not supported." end end diff --git a/lib/swagger.rb b/lib/swagger.rb index acb2ad0..2c3ea87 100644 --- a/lib/swagger.rb +++ b/lib/swagger.rb @@ -1,5 +1,3 @@ -get "/" do - response['Content-Type'] = "text/html" - index_file = File.join(ENV['HOME'],"swagger-ui/dist/index.html") - File.read(index_file) +get "/swagger" do + redirect("/api") end diff --git a/lib/validation.rb b/lib/validation.rb index fad8a44..031b9e1 100644 --- a/lib/validation.rb +++ b/lib/validation.rb @@ -4,7 +4,7 @@ VALIDATION_TYPES = ["repeatedcrossvalidation", "leaveoneout", "crossvalidation", # Get a list of ayll possible validation types # @param [Header] Accept one of text/uri-list, application/json # @return [text/uri-list] URI list of all validation types -get "/validation/?" do +get "/api/validation/?" do uri_list = VALIDATION_TYPES.collect{|validationtype| uri("/validation/#{validationtype}")} case @accept when "text/uri-list" @@ -12,7 +12,7 @@ get "/validation/?" do when "application/json" return uri_list.to_json else - bad_request_error "Mime type #{@accept} is not supported." + halt 400, "Mime type #{@accept} is not supported." end end @@ -20,8 +20,8 @@ end # @param [Header] Accept one of text/uri-list, application/json # @param [Path] Validationtype One of "repeatedcrossvalidation", "leaveoneout", "crossvalidation", "regressioncrossvalidation" # @return [text/uri-list] list of all validations of a validation type -get "/validation/:validationtype/?" do - bad_request_error "There is no such validation type as: #{params[:validationtype]}" unless VALIDATION_TYPES.include? params[:validationtype] +get "/api/validation/:validationtype/?" do + halt 400, "There is no such validation type as: #{params[:validationtype]}" unless VALIDATION_TYPES.include? params[:validationtype] case params[:validationtype] when "repeatedcrossvalidation" validations = Validation::RepeatedCrossValidation.all @@ -35,22 +35,22 @@ get "/validation/:validationtype/?" do case @accept when "text/uri-list" - uri_list = validations.collect{|validation| uri("/validation/#{params[:validationtype]}/#{validation.id}")} + uri_list = validations.collect{|validation| uri("/api/validation/#{params[:validationtype]}/#{validation.id}")} return uri_list.join("\n") + "\n" when "application/json" validations = JSON.parse validations.to_json validations.each_index do |idx| - validations[idx][:URI] = uri("/validation/#{params[:validationtype]}/#{validations[idx]["_id"]["$oid"]}") + validations[idx][:URI] = uri("/api/validation/#{params[:validationtype]}/#{validations[idx]["_id"]["$oid"]}") end return validations.to_json else - bad_request_error "Mime type #{@accept} is not supported." + halt 400, "Mime type #{@accept} is not supported." end end # Get validation representation -get "/validation/:validationtype/:id/?" do - bad_request_error "There is no such validation type as: #{params[:validationtype]}" unless VALIDATION_TYPES.include? params[:validationtype] +get "/api/validation/:validationtype/:id/?" do + halt 400, "There is no such validation type as: #{params[:validationtype]}" unless VALIDATION_TYPES.include? params[:validationtype] case params[:validationtype] when "repeatedcrossvalidation" validation = Validation::RepeatedCrossValidation.find params[:id] @@ -62,10 +62,6 @@ get "/validation/:validationtype/:id/?" do validation = Validation::RegressionCrossValidation.find params[:id] end - not_found_error "#{params[:validationtype]} with id: #{params[:id]} not found." unless validation - #model[:URI] = uri("/model/#{model.id}") - #model[:neighbor_algorithm_parameters][:feature_dataset_uri] = uri("/dataset/#{model[:neighbor_algorithm_parameters][:feature_dataset_id]}") if model[:neighbor_algorithm_parameters][:feature_dataset_id] - #model[:training_dataset_uri] = uri("/dataset/#{model.training_dataset_id}") if model.training_dataset_id - #model[:prediction_feature_uri] = uri("/dataset/#{model.prediction_feature_id}") if model.prediction_feature_id + halt 404, "#{params[:validationtype]} with id: #{params[:id]} not found." unless validation return validation.to_json end diff --git a/qmrf_report.rb b/qmrf_report.rb index cffba77..cb88885 100644 --- a/qmrf_report.rb +++ b/qmrf_report.rb @@ -1,10 +1,8 @@ def qmrf_report id lazarpath = `gem path lazar` lazarpath = File.dirname lazarpath - lazarpath = File.dirname lazarpath qmrfpath = `gem path qsar-report` qmrfpath = File.dirname qmrfpath - qmrfpath = File.dirname qmrfpath prediction_model = Model::Validation.find id model = prediction_model.model -- cgit v1.2.3