Package chemaxon.descriptors
Class MDFileWriter
java.lang.Object
chemaxon.descriptors.MDWriter
chemaxon.descriptors.MDFileWriter
Writes chemical descriptor sets (
In the output one component is written per file. The unique identifier of
MDSet)s into text files. The
output file can either be a bunch of descriptor files, in which case
one MDSet component is associated with one file; or it can also
be an SDfile, in which case custom tags are written along with the molecule
and with its existing tags that store the MolecularDescriptors
in a format that MDFileReader can interpret. In the output one component is written per file. The unique identifier of
MDSet objects is printed in all files. Always blank space
is used as a separator character. The descriptor file contains two header
lines, the first is the type name of the descriptor, while the second is
the configuration string used in the descriptor generation.- Since:
- JChem 2.0
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionMDFileWriter(int nComponents) Creates a newMDFileWriterobject that storesMDSets that have the given number of components.MDFileWriter(String[] descrNames, String[] types, MDParameters[] settings) Creates and initialises a newMDFileWriterobject that storesMDSets in the named text files component-wise.MDFileWriter(String[] descrNames, String[] types, String[] settings) Creates and initialises a newMDFileWriterobject that storesMDSets in the named text files component-wise.MDFileWriter(String SDfileName, int nComponents) Creates and initializes a newMDFileWriterobject that storesMDSets in the named SDfile.MDFileWriter(String SDfileName, String[] descrNames, String[] types, MDParameters[] settings) Creates and initializes a newMDFileWriterobject that storesMDSets in the named SDfile.MDFileWriter(String SDfileName, String[] descrNames, String[] types, String[] settings) Creates and initializes a newMDFileWriterobject that storesMDSets in the named SDfile.MDFileWriter(String descrName, String type, MDParameters settings) Creates and initializes a newMDFileWriterobject that storesMDSets in the named text file.MDFileWriter(String descrName, String type, String settings) Creates and initializes a newMDFileWriterobject that storesMDSets in the named text file. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the stream, after that no more operations are permitted.getMDParameters(int id) Gets the actual parameter settings of the specified component.getMDSet()Gets the last molecular descriptor set generated and put into the output file.voidWrites the givenMDSetobject into the output files as readable text.voidGenerates theMDSetobject from the given molecular structure and writes result.voidGenerates theMDSetfor the givenMoleculeand writes the descriptors into the output with the given identifier.voidsetBinaryOutputFormat(boolean binaryOutputFormat) Sets binary output format.voidsetComponent(int index, String descrName, String type, MDParameters settings) Sets an individualMDSetcomponent's type and corresponding parameters.voidsetComponent(int index, String descrName, String type, String settings) Sets an individualMDSetcomponent's type and corresponding parameters.voidsetDecimalOutputFormat(boolean decimalOutputFormat) Sets decimal output format.voidsetPrintId(boolean printId) Sets whether unique internal ID-s of structures have to be printed into the output table.
-
Constructor Details
-
MDFileWriter
public MDFileWriter(String[] descrNames, String[] types, MDParameters[] settings) throws MDWriterException Creates and initialises a newMDFileWriterobject that storesMDSets in the named text files component-wise. With this constructor the client of this class can feed inMolecules without dealing with details of generating descriptors.- Parameters:
descrNames- output file namestypes- class names of componentssettings- parameter setting of component- Throws:
MDWriterException- in case of any failures
-
MDFileWriter
public MDFileWriter(String[] descrNames, String[] types, String[] settings) throws MDWriterException Creates and initialises a newMDFileWriterobject that storesMDSets in the named text files component-wise. With this constructor the client of this class can feed inMolecules without dealing with details of generating descriptors.- Parameters:
descrNames- output file namestypes- class names of componentssettings- parameter setting of component- Throws:
MDWriterException- in case of any failures
-
MDFileWriter
public MDFileWriter(int nComponents) Creates a newMDFileWriterobject that storesMDSets that have the given number of components. Components have to be specified by callingsetComponent().- Parameters:
nComponents- number of components of theMDSetto be written
-
MDFileWriter
Creates and initializes a newMDFileWriterobject that storesMDSets in the named text file. Use this constructor when theMDSethas one component only.- Parameters:
descrName- output file nametype- class name of the descriptorsettings- parameter setting- Throws:
MDWriterException- in case of any failures
-
MDFileWriter
Creates and initializes a newMDFileWriterobject that storesMDSets in the named text file. Use this constructor when theMDSethas one component only.- Parameters:
descrName- output file nametype- class name of the descriptorsettings- parameter setting- Throws:
MDWriterException- in case of any failures
-
MDFileWriter
Creates and initializes a newMDFileWriterobject that storesMDSets in the named SDfile. Descriptors generated are also stored as readable strings in custom SDf tags. Components have to be specified by callingsetComponent().- Parameters:
SDfileName- the name of the output SDFilenComponents- number of components of theMDSet
-
MDFileWriter
public MDFileWriter(String SDfileName, String[] descrNames, String[] types, MDParameters[] settings) Creates and initializes a newMDFileWriterobject that storesMDSets in the named SDfile. Descriptors generated are also stored as readable strings in custom SDf tags. All components of the descriptor set is specified by type and parameter settings.- Parameters:
SDfileName- the name of the output SDFiledescrNames- output file namestypes- class names of componentssettings- parameter setting of component
-
MDFileWriter
Creates and initializes a newMDFileWriterobject that storesMDSets in the named SDfile. Descriptors generated are also stored as readable strings in custom SDf tags. All components of the descriptor set is specified by type and parameter settings.- Parameters:
SDfileName- the name of the output SDFiledescrNames- output file namestypes- class names of componentssettings- parameter settings strings
-
-
Method Details
-
setDecimalOutputFormat
public void setDecimalOutputFormat(boolean decimalOutputFormat) Sets decimal output format. In this format all descriptor cells are printed and separated by a comma.- Parameters:
decimalOutputFormat- indicates if decimal format is written
-
setBinaryOutputFormat
public void setBinaryOutputFormat(boolean binaryOutputFormat) Sets binary output format. In this format all descriptor cells are printed as 0 and 1 if this makes sense (i.e for binary fingerprints only).- Parameters:
binaryOutputFormat- indicates if binary format is written- Since:
- JChem 2.3
-
setComponent
Sets an individualMDSetcomponent's type and corresponding parameters. Use this method, when descriptor tytpe have not been specified in the constructor.- Parameters:
index- index of theMDSetcomponentdescrName- output file nametype- class name of the descriptorsettings- parameter setting
-
setComponent
Sets an individualMDSetcomponent's type and corresponding parameters. Use this method, when descriptor tytpe have not been specified in the constructor.- Parameters:
index- index of theMDSetcomponentdescrName- output file nametype- class name of the descriptorsettings- parameters string
-
setPrintId
public void setPrintId(boolean printId) Sets whether unique internal ID-s of structures have to be printed into the output table.- Parameters:
printId- unique id-s are printed or not
-
getMDParameters
Gets the actual parameter settings of the specified component.- Specified by:
getMDParametersin classMDWriter- Parameters:
id- component index- Returns:
- parameter settings
- Since:
- JChem 2.1
-
getMDSet
Gets the last molecular descriptor set generated and put into the output file.- Returns:
- the most recent
MDSet - Since:
- JChem 2.3
-
put
Writes the givenMDSetobject into the output files as readable text.- Parameters:
ds-MDSetto be printed- Throws:
MDWriterException- inherited, never thrown
-
put
Generates theMDSetobject from the given molecular structure and writes result. The descriptors are either written into the descriptor output file (as readable text) or into an SDfile as tags. these two modes of operation depend on how theMDFileWriterobject was created.- Specified by:
putin classMDWriter- Parameters:
mol- generateMDSetfor this structureid- the id of the descriptors in the output- Throws:
MDWriterException- inherited, never thrown
-
put
Generates theMDSetfor the givenMoleculeand writes the descriptors into the output with the given identifier. Note, that themolparameter is not final, because descriptors generated are stored in this object (as properties).- Parameters:
mol- theMoleculeobject to be writtennaturalId- unique identifier of the molecule as given on input- Throws:
MDWriterException- all exceptions (mainly io) are reinterpreted- Since:
- JChem 2.0.1
-
close
Closes the stream, after that no more operations are permitted.- Specified by:
closein classMDWriter- Throws:
MDWriterException- all exceptions (mainly io) are reinterpreted
-