Package chemaxon.jchem.db
Class MDTableHandler
java.lang.Object
chemaxon.jchem.db.MDTableHandler
Class for handling Molecular Descriptor tables.
- Since:
- JChem 2.0
-
Field Summary
-
Constructor Summary
ConstructorDescriptionMDTableHandler
(ConnectionHandler conh, String strucTableName) Creates a new instance of MDTableHandlerMDTableHandler
(ConnectionHandler conh, String tableName, boolean indexTable) Internally used. -
Method Summary
Modifier and TypeMethodDescriptionCreates an MolecularDescriptor based on settings stored in the databasecreateMDSet
(String[] mdNames) Creates an MDSet based on settings stored in the databasevoid
createMDTable
(String descriptorName, String descType, String descSettings, String descComment) Creates a Molecular Descriptor Table.void
createMDTable
(String descriptorName, String descType, String descSettings, String descComment, boolean updateOnInsert) Creates a Molecular Descriptor Table.void
deleteMDConfig
(String mdName, String configName) Deletes the specified MolecularDescriptor settingvoid
deleteMDTable
(String descriptorName) Deletes a Molecular Descriptor Table.getMDComment
(String mdName) Gets the value of the Comment property of the MolecularDescriptor specified by its name from the property table of the JChem database.getMDConfig
(String mdName, String configName) Retrieves the value of the specified MolecularDescriptor configurationString[]
getMDConfigs
(String descriptorName) Retrieves the names of stored configurations associated with a certain Molecular DescriptorgetMDSettings
(String mdName) Gets the value of the Settings property of the MolecularDescriptor specified by its name from the property table of the JChem database.static String
getMDTableName
(String strucTableName, String descriptorName) Generates table name for storing Molecular DescriptorsString[]
Retrieves the names of Molecular Descriptor tables assigned to the structure table and stored in the JChem database.Gets the Type property of the MolecularDescriptor specified by its name.boolean
getMDUpdateOnInsert
(String mdName) Gets the value of the UpdateOnInsert property of the MolecularDescriptor specified by its name from the property table of the JChem database.String[]
Retrieves the names of MolecularDescriptors assigned to the structure table and stored in the JChem database.void
incRegenerateDescriptorTable
(String descriptorName) Calculates missing lines in MD tableboolean
isMDTableValid
(String descriptorName) Tests, if a given MD table is valid or not.boolean
isMDTableValidByAllIDs
(String descriptorName) Tests, whether a given MD table is valid.void
setMDConfig
(String mdName, String configName, String config) Sets the value of the specified MolecularDescriptor configuration
-
Field Details
-
MD_PROPERTY_TYPE
- See Also:
-
MD_PROPERTY_SETTINGS
- See Also:
-
MD_PROPERTY_COMMENT
- See Also:
-
MD_PROPERTY_UPDATE
- See Also:
-
MD_PROPERTY_CONF_PREFIX
- See Also:
-
-
Constructor Details
-
MDTableHandler
Creates a new instance of MDTableHandler- Parameters:
conh
- ConnectionHanlder opened to the databasestrucTableName
- the name of the structure table, the Molecular Descriptors were created using these structures- Throws:
SQLException
- if an sql error encountered
-
MDTableHandler
public MDTableHandler(ConnectionHandler conh, String tableName, boolean indexTable) throws SQLException Internally used. Creates a new instance of MDTableHandler- Parameters:
conh
- ConnectionHanlder opened to the databasetableName
- the name of the structure tableindexTable
- strucTableName is an index table- Throws:
SQLException
- if an sql error encountered
-
-
Method Details
-
getMDTableName
Generates table name for storing Molecular Descriptors- Parameters:
strucTableName
- the name of the structure tabledescriptorName
- the name of the descriptor- Returns:
- the MD table name generated according to conventions
-
createMDTable
public void createMDTable(String descriptorName, String descType, String descSettings, String descComment) throws SQLException Creates a Molecular Descriptor Table. Creates table named "<strucTableName>_MD_<descriptorName>", and stores creation parameters in the property table- Parameters:
descriptorName
- the name of the Molecular DescriptordescType
- the type of the descriptor as a fully qualified class namedescSettings
- the descriptor settings to be used for descriptor generationdescComment
- a comment text for the descriptor table- Throws:
SQLException
- if an sql error encountered
-
createMDTable
public void createMDTable(String descriptorName, String descType, String descSettings, String descComment, boolean updateOnInsert) throws SQLException Creates a Molecular Descriptor Table. Creates table named "<strucTableName>_MD_<descriptorName>", and stores creation parameters in the property table- Parameters:
descriptorName
- the name of the Molecular DescriptordescType
- the type of the descriptor as a fully qualified class namedescSettings
- the descriptor settings to be used for descriptor generationdescComment
- a comment text for the descriptor tableupdateOnInsert
- if set totrue
, the descriptors will be automatically added for inserted structures. The default setting isfalse
.- Throws:
SQLException
- if an sql error encountered
-
deleteMDTable
Deletes a Molecular Descriptor Table. Deletes table named "<strucTableName>_MD_<descriptorName>". Also removes entry from the property table- Parameters:
descriptorName
- the name of the Molecular Descriptor- Throws:
SQLException
- if an sql error encountered
-
isMDTableValid
Tests, if a given MD table is valid or not.
Only tests, whether the maximum value of cd_id is bigger in the structure table than in the MD table (invalid) , or equal (valid)- Parameters:
descriptorName
- the name of the Molecular Descriptor- Returns:
true
if every row has a pair in the two tables
false
if the structure table contains rows not listed in the MD table (import occurred after generation, regeneration is necessary)- Throws:
SQLException
- in case of database error, or if there are rows in the MD table that are not represented in the structure table (this shouldn't occur)
-
isMDTableValidByAllIDs
Tests, whether a given MD table is valid.
Checks if every row in structure table has a pair in the MD table. (this may take some time)- Parameters:
descriptorName
- the name of the Molecular Descriptor- Returns:
true
if every row has a pair in the two tables
false
if the structure table contains rows not listed in the MD table (import occurred after generation, regeneration is necessary)- Throws:
SQLException
- in case of database error, or if there are rows in the MD table that are not represented in the structure table (this shouldn't occur)
-
incRegenerateDescriptorTable
Calculates missing lines in MD table- Parameters:
descriptorName
- the name of the Molecular Descriptor- Throws:
SQLException
- if an sql error encountered
-
getMolecularDescriptors
Retrieves the names of MolecularDescriptors assigned to the structure table and stored in the JChem database.- Returns:
- the descriptor names
- Throws:
SQLException
- if an sql error encountered
-
getMDConfigs
Retrieves the names of stored configurations associated with a certain Molecular Descriptor- Parameters:
descriptorName
- the name of the molecular descriptor- Returns:
- the names of the configurations
- Throws:
SQLException
- if an sql error encountered
-
getMDConfig
Retrieves the value of the specified MolecularDescriptor configuration- Parameters:
mdName
- symbolic (user defined) name of the molecular descriptorconfigName
- the name of the configuration- Returns:
- the retrieved configuration string
- Throws:
SQLException
- if an sql error encountered
-
setMDConfig
Sets the value of the specified MolecularDescriptor configuration- Parameters:
mdName
- symbolic (user defined) name of the molecular descriptorconfigName
- the name of the configurationconfig
- the configuration string- Throws:
SQLException
- if an sql error encountered
-
deleteMDConfig
Deletes the specified MolecularDescriptor setting- Parameters:
mdName
- symbolic (user defined) name of the molecular descriptorconfigName
- the name of the configuration- Throws:
SQLException
- if an sql error encountered
-
getMDSettings
Gets the value of the Settings property of the MolecularDescriptor specified by its name from the property table of the JChem database.- Parameters:
mdName
- name of the MolecularDescriptor- Returns:
- the value of the Settings property
- Throws:
SQLException
- if an sql error encountered
-
getMDType
Gets the Type property of the MolecularDescriptor specified by its name.- Parameters:
mdName
- name of the MolecularDescriptor- Returns:
- type of the MolecularDescriptor
- Throws:
SQLException
- if an sql error encountered
-
getMDComment
Gets the value of the Comment property of the MolecularDescriptor specified by its name from the property table of the JChem database.- Parameters:
mdName
- name of the MolecularDescriptor- Returns:
- optional comment given by the user when the descriptor was created and stored
- Throws:
SQLException
- if an sql error encountered
-
getMDUpdateOnInsert
Gets the value of the UpdateOnInsert property of the MolecularDescriptor specified by its name from the property table of the JChem database.- Parameters:
mdName
- name of the MolecularDescriptor- Returns:
true
if the descriptor should be updated on insert.- Throws:
SQLException
- if an sql error encountered
-
createMDSet
Creates an MDSet based on settings stored in the database- Parameters:
mdNames
- the names of the Molecular Descriptors- Returns:
- the generated MDSet, contains descriptors initialized with their stored settings
- Throws:
SQLException
- if an sql error encountered
-
createMD
Creates an MolecularDescriptor based on settings stored in the database- Parameters:
mdName
- the name of the Molecular Descriptor- Returns:
- the generated descriptor, initialized with its stored settings
- Throws:
SQLException
- if an sql error encountered
-
getMDTables
Retrieves the names of Molecular Descriptor tables assigned to the structure table and stored in the JChem database.- Returns:
- the names of the descriptor tables
- Throws:
SQLException
- if an sql error encountered
-