Class AtomTypeMapper
- java.lang.Object
-
- org.openscience.cdk.atomtype.mapper.AtomTypeMapper
-
public class AtomTypeMapper extends Object
AnAtomTypeMapper
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 Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static AtomTypeMapper
getInstance(String mappingFile)
Instantiates an atom type to atom type mapping, based on the given mapping file.static AtomTypeMapper
getInstance(String mappingFile, InputStream stream)
Instantiates an atom type to atom type mapping, based on the givenInputStream
.String
getMapping()
Returns the name of this mapping.String
mapAtomType(String type)
Maps an atom type from one scheme to another, as specified in the input used when creating thisAtomTypeMapper
instance.
-
-
-
Method Detail
-
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 fileorg/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 givenInputStream
.- Parameters:
mappingFile
- Name of theInputStream
defining the atom type to atom type mappings.stream
- theInputStream
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 thisAtomTypeMapper
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 anInputStream
then the name is less well defined.- Returns:
- the name of the mapping represented by this
AtomTypeMapper
.
-
-