Class AtomTypeMapper

java.lang.Object
org.openscience.cdk.atomtype.mapper.AtomTypeMapper

public class AtomTypeMapper extends Object
An AtomTypeMapper allows the mapping of atom types between atom type schemes. For example, it allows to convert atom types from the CDK scheme to the Sybyl scheme; using this approach it is possible to use the CDK atom type perception algorithm and write the resulting atom types using the Sybyl atom type scheme.
Source code:
main
Belongs to CDK module:
atomtype
  • Method Details

    • getInstance

      public static AtomTypeMapper getInstance(String mappingFile)
      Instantiates an atom type to atom type mapping, based on the given mapping file. For example, the mapping file org/openscience/cdk/dict/data/cdk-sybyl-mappings.owl which defines how CDK atom types are mapped to Sybyl atom types.
      Important! Make sure there is not a leading slash.
      Parameters:
      mappingFile - File name of the OWL file defining the atom type to atom type mappings.
      Returns:
      An instance of AtomTypeMapper for the given mapping file.
    • getInstance

      public static AtomTypeMapper getInstance(String mappingFile, InputStream stream)
      Instantiates an atom type to atom type mapping, based on the given InputStream.
      Parameters:
      mappingFile - Name of the InputStream defining the atom type to atom type mappings.
      stream - the InputStream from which the mappings as read
      Returns:
      An instance of AtomTypeMapper for the given mapping file.
    • mapAtomType

      public String mapAtomType(String type)
      Maps an atom type from one scheme to another, as specified in the input used when creating this AtomTypeMapper instance.
      Parameters:
      type - atom type to map to the target schema
      Returns:
      atom type name in the target schema
    • getMapping

      public String getMapping()
      Returns the name of this mapping. In case of file inputs, it returns the filename, but when the input was an InputStream then the name is less well defined.
      Returns:
      the name of the mapping represented by this AtomTypeMapper.