Package chemaxon.descriptors
Class MDDBReader
java.lang.Object
chemaxon.descriptors.MDReader
chemaxon.descriptors.MDDBReader
Class for reading MolecularDescriptors from a database.
Capable of generating MolecularDescriptors on-the-fly from molecules if
required.
- Since:
- JChem 2.0
-
Field Summary
Fields inherited from class chemaxon.descriptors.MDReader
cloneResult, firstId, generateDescriptor, generateId, id, idTagName, lastReadMolecule, mdSet, takeTags -
Constructor Summary
ConstructorsConstructorDescriptionMDDBReader(ConnectionHandler ch, String strucTableName, MDSet mdSet, String sqlCondition) Deprecated.MDDBReader(ConnectionHandler ch, String strucTableName, String[] mdNames, String sqlCondition) Deprecated.MDDBReader(String strucTableName, ConnectionHandler ch, MDSet mdSet, String query) Constructs a new MDDBReader object.MDDBReader(String strucTableName, ConnectionHandler ch, String[] mdNames, String query) Constructs a new MDDBReader object.MDDBReader(String strucTableName, ConnectionHandler ch, String[] mdNames, String query, int[] filterIDList, int[] filterIDNotList, boolean indexTable) Constructs a new MDDBReader object. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes down the descriptor stream.intGets the cd_id that belongs to the last processed descriptor from the structure tablegetMDSet()Gets the molecular descriptor set.Gets the molecule that belongs to the last processed descriptor from the structure tablenext()Fetches the next element form the stream or returnsnullwhen there are no more accessible data.voidreset()Initializes theMolecularDescriptorstream.Methods inherited from class chemaxon.descriptors.MDReader
createMDSetComponent, getCloneResult, setCloneResult, setFirstId, setGenerateId, setIdTagName, setTakeTag
-
Constructor Details
-
MDDBReader
@Deprecated public MDDBReader(ConnectionHandler ch, String strucTableName, MDSet mdSet, String sqlCondition) Deprecated.Constructs a new MDDBReader object. Using this constructor the descriptors will be generated on-the-fly.- Parameters:
ch- a ConnectionHandler with an open connection to the databasestrucTableName- name of the structure tablemdSet- the contains the appropriate descriptorssqlCondition- a condition to be used in an SQL where clause (e.g: "cd_id > 1000"). Ifnull, then all rows are retrieved.
-
MDDBReader
Constructs a new MDDBReader object. Using this constructor the descriptors will be generated on-the-fly.- Parameters:
strucTableName- name of the structure tablech- a ConnectionHandler with an open connection to the databasemdSet- the contains the appropriate descriptorsquery- SQL query for filtering. It should contain the cd_id values. Example "select cd_id from mystructures where cd_id > 1000"). Ifnull, then all rows are retrieved.
-
MDDBReader
@Deprecated public MDDBReader(ConnectionHandler ch, String strucTableName, String[] mdNames, String sqlCondition) Deprecated.Constructs a new MDDBReader object. Using this constructor the descriptors will be read from database- Parameters:
ch- a ConnectionHandler with an open connection to the databasestrucTableName- name of the structure tablemdNames- the names of the descriptors stored in the databasesqlCondition- a condition to be used in an SQL where clause (e.g: "cd_id > 1000").Ifnullor empty string all rows are retrieved.
-
MDDBReader
Constructs a new MDDBReader object. Using this constructor the descriptors will be read from database- Parameters:
strucTableName- name of the structure tablech- a ConnectionHandler with an open connection to the databasemdNames- the names of the descriptors stored in the databasequery- SQL query for filtering. It should contain the cd_id values. Example "select cd_id from mystructures where cd_id > 1000"). Ifnull, then all rows are retrieved.
-
MDDBReader
public MDDBReader(String strucTableName, ConnectionHandler ch, String[] mdNames, String query, int[] filterIDList, int[] filterIDNotList, boolean indexTable) Constructs a new MDDBReader object. Using this constructor the descriptors will be read from database- Parameters:
strucTableName- name of the structure tablech- a ConnectionHandler with an open connection to the databasemdNames- the names of the descriptors stored in the databasequery- SQL query for filtering. It should contain the cd_id values. Example "select cd_id from mystructures where cd_id > 1000"). Ifnull, then all rows are retrieved.filterIDList- a cd_id list to filter with. No filtering ifnull.filterIDNotList- excluded cd_id listindexTable- true if used from cartridge- Since:
- JChem 3.1
-
-
Method Details
-
getMDSet
Gets the molecular descriptor set. This method is provided in order to allow the used intervene into descriptor generation (for instance by overriding parameter settings). -
reset
Initializes theMolecularDescriptorstream. If the stream is not empty the consequent call tonext()returns the first element.- Overrides:
resetin classMDReader- Throws:
MDReaderException- when failed to reset the reader
-
next
Fetches the next element form the stream or returnsnullwhen there are no more accessible data. Also initializes the stream, if necessary.- Specified by:
nextin classMDReader- Returns:
nullif couldn't read descriptor or no more descriptors to read- Throws:
MDReaderException- when failed reading the next descriptor set
-
getMolecule
Gets the molecule that belongs to the last processed descriptor from the structure table- Overrides:
getMoleculein classMDReader- Returns:
- the requested molecule, or
nullif not found - Throws:
MDReaderException- when failed reading the next descriptor set
-
getLastID
public int getLastID()Gets the cd_id that belongs to the last processed descriptor from the structure table- Returns:
- the ID, or -1 if not found
-
close
Closes down the descriptor stream. After this, no more operation is permitted on the stream.
NOTE: Doesn't close the database connection specified in the ConnectionHandler.- Specified by:
closein classMDReader- Throws:
MDReaderException- when failed to close the input stream
-
MDDBReader(java.lang.String, chemaxon.util.ConnectionHandler, chemaxon.descriptors.MDSet, java.lang.String)instead.