mordred package

modred descriptor calculator.

mordred.all_descriptors()[source]

yield all descriptors.

Returns:all modules
Return type:Iterator (module)
class mordred.Calculator(*descs)[source]

Bases: object

descriptor calculator.

Parameters:descs – see register() method
map(mols, processes=None, error_mode='raise', callback=None, error_callback=None)[source]

calculate descriptors over mols.

Parameters:
  • mols (Iterable (Mol)) – moleculars
  • processes (int or None) – number of process. None is multiprocessing.cpu_count()
  • error_mode (str) –
    • ‘raise’: raise Exception
    • ‘ignore’: ignore Exception
    • ‘log’: print Exception to stderr and ingore Exception
  • callback (Callable ([(Descriptor, scalar)]) -> None) – call when calculate finished par molecule
  • error_callback (Callable (Exception) -> scalar) – call when Exception raised
Return type:

Iterator ((Mol, [(Descriptor, scalar)]]))

register(*descs)[source]

register descriptors.

Parameters:descs (module, Descriptor class/instance or Iterable) –

descriptors to register

class mordred.Descriptor[source]

Bases: object

abstract base class of descriptors.

calculate(mol)[source]

calculate descriptor value.

(abstract method)

dependencies()[source]

descriptor dependencies.

Return type:{str: (Descriptor or None)} or None
explicit_hydrogens = True
gasteiger_charges = False
classmethod is_descriptor_class(desc)[source]

check calculatable descriptor class or not.

Return type:bool
kekulize = False
classmethod preset()[source]

generate preset descriptor instances.

(abstract classmethod)

Return type:iterable
require_connected = False
rtype

alias of NoneType

mordred.get_descriptors_from_module(mdl)[source]

get descriptors from module.

Parameters:mdl (module) – module to search
Return type:[Descriptor]