mordred package

modred descriptor calculator.

class mordred.Descriptor[source]

Bases: object

abstract base class of descriptors.

as_argument

argument representation of descriptor

calculate(mol)[source]

calculate descriptor value.

(abstract method)

coord

get 3D coordinate

dependencies()[source]

descriptor dependencies.

Return type:{str: (Descriptor or None)} or None
explicit_hydrogens = True
fail(exception)[source]

raise known exception and return missing value

classmethod is_descriptor_class(desc)[source]

check calculatable descriptor class or not.

Return type:bool
kekulize = False
mol

get molecule

parameters()[source]

get __init__ arguments of this descriptor instance.

(abstract method)

classmethod preset()[source]

generate preset descriptor instances.

Return type:iterable
require_3D = False
require_connected = False
rethrow_na(exception)[source]

treat any exceptions as known exception

rethrow_zerodiv()[source]

treat zero div as known exception

rtype = None
class mordred.Calculator(descs=[], ignore_3D=False)[source]

Bases: object

descriptor calculator.

Parameters:descs – see register() method
descriptors

all descriptors.

you can get/set/delete descriptor.

echo(s, file=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'>, end='\n')[source]

output message

map(mols, nproc=None, nmols=None, quiet=False, ipynb=False, id=-1)[source]

calculate descriptors over mols.

Parameters:
  • mols (Iterable (Mol)) – moleculars
  • nproc (int or None) – number of process. None is multiprocessing.cpu_count()
  • nmols (None or int) – number of all mols for display progress bar
  • quiet (bool) – suppress progress bar
  • ipynb (bool) – use ipython notebook progress bar
  • id (int) – conformer id
Return type:

Iterator [scalar]

pandas(mols, nproc=None, nmols=None, quiet=False, ipynb=False, id=-1)[source]

calculate descriptors over mols.

Parameters:mol_name (str) – molecular column name
Return type:pandas.DataFrame
register(desc, ignore_3D=False)[source]

register descriptors.

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

descriptors to register

mordred.all_descriptors()[source]

yield all descriptor modules.

Returns:all modules
Return type:Iterator (Descriptor)
mordred.get_descriptors_from_module(mdl)[source]

get descriptors from module.

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