In case you want to remove the data fields from the structures stored in sdf format, the following UPDATE statement can be helpful:
UPDATE <table> SET <structure_column> = substring(<structure_column>::text,'^.*M\ \ END')::molecule('molecule_subtype');
Example:
UPDATE mytable SET mol = substring(mol::text,'^.*M\ \ END')::molecule('sample');
The following business rules can be defined in the molecule type files.
If you want more than one combination of the above listed business rule parameters be available - for example you want to run searches with and without tautomer search - you have to create separate table columns with different molecule types. Unfortunately, this means duplication, multiplication of the stored chemical structure data.
By default, the extensions chemaxon_type and chemaxon_framework are installed into the PUBLIC schema of the PostgreSQL database. However, there can be cases when these extensions must be installed into a different schema. For example, if there is an object - like a table - named to molecule already present in the PUBLIC schema.
The following steps should be executed:
CREATE SCHEMA chemaxon;
CREATE EXTENSION chemaxon_type WITH SCHEMA chemaxon;
CREATE EXTENSION chemaxon_framework WITH SCHEMA chemaxon;
CREATE EXTENSION hstore; -- this extension does not need to be installed into the chemaxon schema
In order to make searches able to use these extensions, search_path must be modified.
Session level modification:
SET search_path TO chemaxon,public;
Database level modification:
ALTER DATABASE <db_name> SET search_path TO chemaxon,public;
See further possibilities in PostgreSQL documentation about schema search path.
JPC can only be successfully installed if the
CREATE EXTENSION HSTORE;
step of the installation process can be executed.
HSTORE extension is part of the contrib package of PostgreSQL database (for example postgresql-contrib-12), so it is necassary to have the contrib package installed.
Use the is_valid_molecule method. Note, there are some structures which are qualified as valid, but cannot be indexed by the cartridge.
Check the logs on the server in /var/log/jchem-psql/. The log level can be set in /etc/chemaxon/jpc-log4j.xml, see documentation.
In the client log when running insert scripts, the insert is successful, but warnings appear:
INSERT INTO <table_name>
Warnings: <...> Invalid molecule source: <error> See PostgreSQL documentation .
By this query (preferably on an indexed table):
select * from test except select * from test where '*'|<|mol;
In Amazon environment, JChem PostgreSQL Cartridge requires a PostreSQL database installed on an EC2 instance, it does not work with Amazon PosgreSQL RDS.
Two setups are possible:
JPC is tested in Amazon environment. Other cloud provider's environment was not tested, but we see no reason why they shouldn't work.
If the create index process is not finished sucessfully, you can check the log file /var/log/jchem-psql/stderr.log and look for the characters label=> and copy the number following label=>.
If this number is - for example - 8589934592, the row where the molecule stopping the create index process is present can be identified with the following SQL statement:
SELECT *
FROM <tablename> where (ctid::text::point)[0]::bigint +
(ctid::text::point)[1]::bigint * POWER(2,32) = 8589934592;
Reindexing is needed.
drop index <indexname>
update table_name set structure_column_name = structure_column_name::text::molecule('molecule_type_name');
create index ...
In the case molecule types with tautomer=GENERIC parameter, similarity search gives false results. These is no workaround at the moment, please do not execute similarity search in structure columns having molecule type with tautomer=GENERIC parameter. From version 21.9.0 similarity search works correctly even in the case of molecule types with tautomer=GENERIC parameter.
If you log in to a database and immediately call drop index, e.g.
drop index <index_name>;
the JPC-specific call won't be executed. This means that the index data won't be cleared up in the JChem Server. The following workarounds are recommended: