filter

Module filter

This modules contains the class Filter, which is used to filter molecules using molecular descriptors.

class npfc.filter.Filter(descriptors={'elements': <function <lambda>>, 'molecular_formula': <function <lambda>>, 'molecular_weight': <function <lambda>>, 'num_atoms_nitrogen': <function <lambda>>, 'num_atoms_oxygen': <function <lambda>>, 'num_hba': <function <lambda>>, 'num_hbd': <function <lambda>>, 'num_heavy_atoms': <function <lambda>>, 'num_rings': <function <lambda>>, 'num_rings_arom': <function <lambda>>, 'num_rotatable_bonds': <function <lambda>>, 'ring_size_max': <function <lambda>>, 'ring_size_min': <function <lambda>>, 'slogp': <function <lambda>>, 'tpsa': <function <lambda>>})[source]

A class for filtering molecules based on molecular descriptors.

Create a Filter object.

compute_descriptors(mol, descriptors=None)[source]

Compute descriptors. A subset of descriptors can be computed if a list of descriptor names is provided. To get an idea of what descriptors can be computed, the method get_possible_descriptors can be used.

Parameters
  • mol (Mol) – the input molecule

  • descriptors (Optional[List]) – the list of descriptors to compute. If none is provided, all possible descriptors are computed.

Return type

dict

Returns

a dictionary with all descriptors

filter_mol(mol, expr)[source]

Filter a molecule based on an expression. Two types of expressions are currently supported:

  • inclusion/exclusion
    • ‘elements not in C, N, O’

    • ‘elements in C, N, O’

  • numeric
    • ‘num_heavy_atoms > 3’

    • ‘100.0 < molecular_weight <= 1000.0’

    • ‘num_rings’ != 0’

    • ‘num_rings == 0’

Parameters
  • mol (Mol) – the input molecule

  • expr (str) – the filter to apply

Return type

bool

Returns

True if the molecule passes the filter, False otherwise

get_possible_descriptors()[source]

Return a list of all descriptors that can be computed using this module.

Return type

List

Returns

the list of descriptors that can be computed

npfc.filter.count_violations_fragment_like(molecular_weight, slogp, num_hba, num_hbd)[source]

Congreve, M., Carr, R., Murray, C., Jhoti, H., 2003. A “Rule of Three” for fragment-based lead discovery? Drug Discovery Today 8, 876–877. doi:10.1016/S1359-6446(03)02831-9

npfc.filter.count_violations_fragment_like_ext(num_fragment_like_violations, tpsa, num_rotatable_bonds)[source]

Congreve, M., Carr, R., Murray, C., Jhoti, H., 2003. A “Rule of Three” for fragment-based lead discovery? Drug Discovery Today 8, 876–877. doi:10.1016/S1359-6446(03)02831-9

npfc.filter.count_violations_lead_like(molecular_weight, slogp, num_rotatable_bonds)[source]

http://zinc.docking.org/browse/subsets/ Teague, Davis, Leeson, Oprea, Angew Chem Int Ed Engl. 1999 Dec 16;38(24):3743-3748.

npfc.filter.count_violations_lipinski(molecular_weight, slogp, num_hbd, num_hba)[source]

Lipinski, J Pharmacol Toxicol Methods. 2000 Jul-Aug;44(1):235-49.

npfc.filter.count_violations_ppi_like(molecular_weight, slogp, num_hba, num_rings)[source]

Hamon, V., Bourgeas, R., Ducrot, P., Theret, I., Xuereb, L., Basse, M.J., Brunel, J.M., Combes, S., Morelli, X., Roche, P., 2013. 2P2IHUNTER: a tool for filtering orthosteric protein–protein interaction modulators via a dedicated support vector machine. Journal of The Royal Society Interface 11. doi:10.1098/rsif.2013.0860

npfc.filter.count_violations_veber(num_rotatable_bonds, tpsa)[source]

Veber DF, Johnson SR, Cheng HY, Smith BR, Ward KW, Kopple KD (June 2002). “Molecular properties that influence the oral bioavailability of drug candidates”. J. Med. Chem. 45 (12): 2615–23.

npfc.filter.get_min_max_ring_sizes(mol)[source]

Return a tuple wih (minimum, maximum) ring sizes of the input molecule. In case the molecule is linear, (0, 0) is returned.