The aim of this page is to provide help for migrating applications based on JChem Oracle Cartridge (JOC) API to JChem PostgreSQL (JPC) API by collecting their different solutions for the main functionality areas. This page supplements the information available on the below linked video and pages.
JChem Oracle Cartridge API documentation
JChem Oracle Cartridge Developer guide
JChem PostgreSQL API documentation
JOC provides many CREATE INDEX parameters for setting different business logic to the given structure column. JPC does not provide any CREATE INDEX parameter. The business logic settings can be applied differently, mainly by the configuration of Molecule types.
JOC also provides some ALTER INDEX parameters, but ALTER INDEX cannot be applied on JPC domain indexes (chemindex and sortedchemindex).
JOC Parameter(s) | JPC solution | Comment | |
---|---|---|---|
JChem table specific parameters | JChemPropertiesTable regenerateTable |
N/A | JChem tables are not supported in JPC |
type of structures (molecules, queries, reactions, any structures, markush) | structureType | specification is not needed markush type is not supported |
|
stereo assumption mode (absolute or relative) | absoluteStereo | in Molecule type file: stereoAssumption parameter |
|
standardizer configuration | std_config std_conf:sql |
in Molecule type file: standardizerAction setting or standardizerFile parameter |
|
fingerprint configuration | pat_length fp_size fp_bit |
in Molecule type file the following parameters: fpLenght fpEdges fpOnes |
|
tautomer mode | tautomerEqualityMode | in Molecule type file: tautomer parameter |
|
duplicate filtering | duplicateFiltering | N/A | recommended solution: execute duplicate search against the table before inserting a structure into it if multiple structures are to be inserted, batch this operation using a temporary table |
considering tautomers in duplicate search by default | TDF | in Molecule type file: tautomer parameter apply the Molecule type file name as subtype of the molecule type column |
Note, that in this case the specified tautomer mode will be used in case of substructure and full fragment searches as well. |
chemical term columns | autoCalcCt | standard SQL using the appropriate chemterm function | see example here |
specifying table name where non indexable structures are stored | errorTableName | this method is provided | See here how to check for invalid structures in the table or in the index. |
In JOC, there are many search options implemented. See their list at jc_compare. JPC has only a few search options. The table below contains mainly only those JOC search options which have their JPC equivalent or almost equivalent.
SELECT * FROM <tablename> where <JOC_owner>.jc_compare(<column>, '<query_structure>', '<parameters>')=1;
where
SELECT * FROM <tablename> where '<query_structure>' <operator> <column>;
or
SELECT * FROM <tablename> where query_transform('<query_structure>', '<parameters>') <operator> <column>;
where
JOC Parameters | JPC solution | Comment | |
---|---|---|---|
duplicate search | t:d | |=| | in JOC jc_equals also provides duplicate search |
substructure search | t:s | |<| | in JOC jc_contains also provides substructure search |
full fragment search | t:ff | |<=| | works the same way in JPC as in JOC |
full structure search | t:f | N/A | recommended solution: FULLFRAGMENT search with an additional condition for fragment count matching - using fragmentCount chemical term - requiring the same fragment count for the query and target see example here |
superstructure search | t:u | |>| | works the same way in JPC as in JOC |
similarity search | t:i | |~| |<~| |~>| |
in JOC jc_tanimoto and jc_dissimilarity also provide similarity search |
dissimilarityThreshold simThreshold |
dissimilarity threshold can be defined as shown here | ||
dissimilarityMetric | N/A | only Tanimoto metric is supported in JPC | |
tautomer search | tautomerSearch | in Molecule type file: tautomer parameter the type file name applied in <type>_search |
JPC provides variety of tautomer combinations for duplicate and substructure search: GENERIC, NORMAL_CANONIC_GENERIC_HYBRID, NORMAL_CANONIC_NORMAL_GENERIC_HYBRID see details here |
isotope | isotope | IGNOREISOTOPE only in substructure and full fragment search |
|
charge | charge | IGNORECHARGE only in substructure and full fragment search |
|
double bond stereo | doubleBondStereo | DBSMARKEDONLY only in substructure and full fragment search |
|
tetrahedral stereo | ignore tetrahedral stereo | IGNORETETRAHEDRALSTEREO only in substructure and full fragment search |
JOC: Those SMILES/SMARTS strings which can be interpreted even in SMILES and SMARTS, the default interpretation mode is SMARTS in case of query structures. JPC: Those SMILES/SMARTS strings which can be interpreted even in SMILES and SMARTS, the default interpretation mode is SMILES in case of query structures.
Refers to jc_standardizeb and their function analogues as well. In JPC, the standardization actions are defined in the Molecule type files. These Molecule type files must be defined upfront and need to be initialized by running service jchem-psql init.
jc_standardize(structure IN VARCHAR2/CLOB/BLOB, param IN VARCHAR2) RETURN VARCHAR2/CLOB/BLOB;
where param can be the standardizer action string or configuration
standardize(structure::molecule('<type>'))
where <type> is the name of Molecule type file containing the relevant standardizer configuration
Refers to jc_molconvert analogues (like jc_molconvertc, jcf.molconvert, jcf.moconvertc, ...) as well.
jc_molconvert (structure IN VARCHAR2/BLOB/CLOB, options_outputformat IN VARCHAR2) RETURN VARCHAR2/BLOB/CLOB;
molconvert('structure', 'format')
Refers to jc_evaluate analogues (like jc_evaluate_x, jcf.evaluate, jcf.evaluate_x, ...) as well.
jc_evaluate ('structure' IN VARCHAR2/CLOB/BLOB, expression IN VARCHAR2, options IN VARCHAR2)
where options refer to the chemical term expression
chemterm('chemical_term','structure')
Structure checker/fixer operations are executed as chemical terms.
SELECT jc_evaluate_x('structure', 'chemTerms:check("checkerAction")') from dual;
SELECT jc_evaluate_x('structure', 'chemTerms:fix("checkerAction->fixerAction")') from dual;
Structure checker/fixer operations are executed as chemical terms.
SELECT chemterm('check(''checkerAction’')','molecule');
SELECT chemterm('fix(''checkerAction->fixerAction'')','molecule');