Package uk.ac.cam.ch.wwmm.opsin
Class OpsinResult
- java.lang.Object
-
- uk.ac.cam.ch.wwmm.opsin.OpsinResult
-
public class OpsinResult extends java.lang.Object
Holds the structure OPSIN has generated from a name Additionally holds a status code for whether name interpretation was successful- Author:
- dl387
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
OpsinResult.OPSIN_RESULT_STATUS
Whether parsing the chemical name was successful, encountered problems or was unsuccessful.
If the result is notOpsinResult.OPSIN_RESULT_STATUS.FAILURE
then a structure has been generated
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getChemicalName()
Returns the chemical name that this OpsinResult was generated fromjava.lang.String
getCml()
Generates the CML corresponding to the molecule described by the name If name generation failed i.e.java.lang.String
getExtendedSmiles()
Experimental function that generates the extended SMILES corresponding to the molecule described by the name If name generation failed i.e.java.lang.String
getMessage()
Returns a message explaining why generation of a molecule from the name failed This string will be blank when no problems were encounteredjava.lang.String
getPrettyPrintedCml()
Generates the CML corresponding to the molecule described by the name
If name generation failed i.e.java.lang.String
getSmiles()
Generates the SMILES corresponding to the molecule described by the name
If name generation failed i.e.java.lang.String
getSmiles(int options)
Generates the SMILES corresponding to the molecule described by the name
If name generation failed i.e.OpsinResult.OPSIN_RESULT_STATUS
getStatus()
Returns an enum indicating whether interpreting the chemical name was successful If an issue was identified but a chemical structure could be still be deduced the status isOpsinResult.OPSIN_RESULT_STATUS.WARNING
java.util.List<OpsinWarning>
getWarnings()
A list of warnings encountered when the result wasOpsinResult.OPSIN_RESULT_STATUS.WARNING
This list of warnings is immutableboolean
nameAppearsToBeAmbiguous()
Convenience method to check if one of the associated OPSIN warnings wasOpsinWarning.OpsinWarningType.APPEARS_AMBIGUOUS
boolean
stereochemistryIgnored()
Convenience method to check if one of the associated OPSIN warnings wasOpsinWarning.OpsinWarningType.STEREOCHEMISTRY_IGNORED
-
-
-
Method Detail
-
getStatus
public OpsinResult.OPSIN_RESULT_STATUS getStatus()
Returns an enum indicating whether interpreting the chemical name was successful If an issue was identified but a chemical structure could be still be deduced the status isOpsinResult.OPSIN_RESULT_STATUS.WARNING
- Returns:
OpsinResult.OPSIN_RESULT_STATUS
status
-
getMessage
public java.lang.String getMessage()
Returns a message explaining why generation of a molecule from the name failed This string will be blank when no problems were encountered- Returns:
- String explaining problems encountered
-
getChemicalName
public java.lang.String getChemicalName()
Returns the chemical name that this OpsinResult was generated from- Returns:
- String containing the original chemical name
-
getCml
public java.lang.String getCml()
Generates the CML corresponding to the molecule described by the name If name generation failed i.e. the OPSIN_RESULT_STATUS is FAILURE then null is returned- Returns:
- Chemical Markup Language as a String
-
getPrettyPrintedCml
public java.lang.String getPrettyPrintedCml()
Generates the CML corresponding to the molecule described by the name
If name generation failed i.e. the OPSIN_RESULT_STATUS is FAILURE then null is returned
The CML is indented- Returns:
- Idented Chemical Markup Language as a String
-
getSmiles
public java.lang.String getSmiles()
Generates the SMILES corresponding to the molecule described by the name
If name generation failed i.e. the OPSIN_RESULT_STATUS is FAILURE then null is returned- Returns:
- SMILES as a String
-
getSmiles
public java.lang.String getSmiles(int options)
Generates the SMILES corresponding to the molecule described by the name
If name generation failed i.e. the OPSIN_RESULT_STATUS is FAILURE then null is returned.
Theoptions
parameter is used to control the output by a set of binary flags. This is primarily used to control the output layers in ChemAxon Extended SMILES (CXSMILES).// only the include the enhanced stereo layers result.getSmiles(SmilesOptions.CXSMILES_ENHANCED_STEREO); // only the include the enhanced stereo and polymer layers result.getSmiles(SmilesOptions.CXSMILES_ENHANCED_STEREO | SmilesOptions.CXSMILES_POLYMERS);
- Parameters:
options
- binary flags ofSmilesOptions
(default:SmilesOptions.DEFAULT
))- Returns:
- SMILES as a String
- See Also:
SmilesOptions
-
getExtendedSmiles
public java.lang.String getExtendedSmiles()
Experimental function that generates the extended SMILES corresponding to the molecule described by the name If name generation failed i.e. the OPSIN_RESULT_STATUS is FAILURE then null is returned If the molecule doesn't utilise any features made possible by extended SMILES this is equivalent togetSmiles()
- Returns:
- Extended SMILES as a String
-
getWarnings
public java.util.List<OpsinWarning> getWarnings()
A list of warnings encountered when the result wasOpsinResult.OPSIN_RESULT_STATUS.WARNING
This list of warnings is immutable- Returns:
- A list of
OpsinWarning
-
nameAppearsToBeAmbiguous
public boolean nameAppearsToBeAmbiguous()
Convenience method to check if one of the associated OPSIN warnings wasOpsinWarning.OpsinWarningType.APPEARS_AMBIGUOUS
- Returns:
- true if name appears to be ambiguous
-
stereochemistryIgnored
public boolean stereochemistryIgnored()
Convenience method to check if one of the associated OPSIN warnings wasOpsinWarning.OpsinWarningType.STEREOCHEMISTRY_IGNORED
- Returns:
- true if stereochemistry was ignored to interpret the name
-
-