### Install Mordred via Pip Source: https://github.com/mordred-descriptor/mordred/blob/develop/README.rst Shows how to install Mordred using pip, with an option to include extra dependencies. ```console $ pip install 'mordred[full]' ``` ```console # or $ pip install mordred ``` -------------------------------- ### Run Mordred Tests Source: https://github.com/mordred-descriptor/mordred/blob/develop/README.rst Command to execute the built-in tests for the Mordred installation. ```console $ python -m mordred.tests ``` -------------------------------- ### Install Mordred via Conda Source: https://github.com/mordred-descriptor/mordred/blob/develop/README.rst Provides the command to install the Mordred library using Conda, including necessary channels for dependencies like RDKit. ```console $ conda install -c rdkit -c mordred-descriptor mordred ``` -------------------------------- ### Electronegativity Data for Period 6 (Part 1) Source: https://github.com/mordred-descriptor/mordred/blob/develop/mordred/data/allred_rocow_electron_negativity.txt This snippet contains electronegativity values for elements in Period 6, from Cesium to Barium, and the start of the Lanthanoid series. The data is presented as a list of values, with '-' indicating missing entries. ```text 0.86 # 55 Cs 0.97 # 56 Ba # Lanthanoid 1.08 # 57 La - # 58 Ce - # 59 Pr - # 60 Nd - # 61 Pm - # 62 Sm - # 63 Eu - # 64 Gd - # 65 Tb - # 66 Dy - # 67 Ho - # 68 Er - # 69 Tm - # 70 Yb - # 71 Lu ``` -------------------------------- ### Display Mordred Help Information Source: https://github.com/mordred-descriptor/mordred/blob/develop/README.rst Shows the help message for the Mordred command-line interface, detailing all available options and arguments. ```console $ python -m mordred --help ``` -------------------------------- ### Mordred Descriptor Calculation Source: https://github.com/mordred-descriptor/mordred/blob/develop/README.rst Demonstrates how to initialize the Mordred Calculator with all descriptors, calculate descriptors for a single molecule using SMILES, and calculate descriptors for multiple molecules, including outputting to a pandas DataFrame. ```python from rdkit import Chem from mordred import Calculator, descriptors # create descriptor calculator with all descriptors calc = Calculator(descriptors, ignore_3D=True) print(len(calc.descriptors)) # calculate single molecule mol = Chem.MolFromSmiles('c1ccccc1') print(calc(mol)[:3]) # calculate multiple molecule mols = [Chem.MolFromSmiles(smi) for smi in ['c1ccccc1Cl', 'c1ccccc1O', 'c1ccccc1N']] # as pandas df = calc.pandas(mols) print(df['SLogP']) ``` -------------------------------- ### Sphinx Extensions for Documentation Source: https://github.com/mordred-descriptor/mordred/blob/develop/extra/requirements/requirements-pip.txt This section details Sphinx extensions used for generating project documentation. These tools enhance the documentation process, particularly for projects with bibliographies and specific themes. ```text sphinx-rtd-theme sphinxcontrib-bibtex ``` -------------------------------- ### Descriptor Retrieval Functions Source: https://github.com/mordred-descriptor/mordred/blob/develop/docs/mordred.rst Documentation for functions used to retrieve descriptors within the mordred package. ```APIDOC get_descriptors_in_module(module) - Retrieves all descriptor classes available in a given module. - Parameters: - module: The module object to inspect. - Returns: A list of descriptor classes. get_descriptors_from_module(module) - Retrieves all descriptor instances from a given module. - Parameters: - module: The module object to inspect. - Returns: A list of descriptor instances. ``` -------------------------------- ### Flake8 Plugins for Code Quality Source: https://github.com/mordred-descriptor/mordred/blob/develop/extra/requirements/requirements-pip.txt This section lists various flake8 plugins used to enforce coding standards, improve readability, and catch common errors. These plugins help maintain a consistent and high-quality codebase. ```text flake8-quotes flake8-print flake8-black flake8-comprehensions flake8-docstrings flake8-sorted-keys flake8-regex flake8-string-format ``` -------------------------------- ### Calculate Multiple Specific Descriptors (ABCIndex and AcidBase) Source: https://github.com/mordred-descriptor/mordred/blob/develop/README.rst Calculates both ABCIndex and AcidBase descriptors for molecules in a SMILES file and outputs the results. ```console $ python -m mordred example.smi -d ABCIndex -d AcidBase ``` -------------------------------- ### Process Multiple Input Files Source: https://github.com/mordred-descriptor/mordred/blob/develop/README.rst Calculates specified descriptors (ABCIndex in this case) for molecules from multiple input SMILES files. ```console $ python -m mordred example.smi example2.smi -d ABCIndex ``` -------------------------------- ### mordred.Calculator Class Source: https://github.com/mordred-descriptor/mordred/blob/develop/docs/mordred.rst Documentation for the Calculator class in the mordred package. This class is likely responsible for performing descriptor calculations. ```APIDOC mordred.Calculator :members: - Handles the calculation of molecular descriptors. - Likely manages a collection of descriptors and applies them to molecules. ``` -------------------------------- ### Calculate Number of Descriptors Source: https://github.com/mordred-descriptor/mordred/blob/develop/README.rst Demonstrates how to calculate the total number of 2D and 3D descriptors available in the Mordred library. It initializes a Calculator with specified descriptor sets and counts the available descriptors. ```python from mordred import Calculator, descriptors n_all = len(Calculator(descriptors, ignore_3D=False).descriptors) n_2D = len(Calculator(descriptors, ignore_3D=True).descriptors) print("2D: {:5}\\n3D: {:5}\\n------------\\ntotal: {:5}".format(n_2D, n_all - n_2D, n_all)) ``` -------------------------------- ### mordred.Descriptor Class Source: https://github.com/mordred-descriptor/mordred/blob/develop/docs/mordred.rst Documentation for the Descriptor class in the mordred package. This class is likely the base class for all descriptor implementations. ```APIDOC mordred.Descriptor :members: - Base class for all molecular descriptors in mordred. - Likely defines the interface for calculating descriptors. ``` -------------------------------- ### Calculate Descriptors and Save to CSV with Progress Source: https://github.com/mordred-descriptor/mordred/blob/develop/README.rst Calculates molecular descriptors and saves them to a CSV file, displaying a progress bar during the process. ```console $ python -m mordred example.smi -o example.csv ``` -------------------------------- ### Element Data from Handbook of Chemistry and Physics Source: https://github.com/mordred-descriptor/mordred/blob/develop/mordred/data/ionization_potential.txt This snippet represents data extracted from the Handbook of Chemistry and Physics, listing atomic numbers and associated numerical values for chemical elements. The data is presented in a simple, human-readable format. ```python # Project: /mordred-descriptor/mordred # Handbook of Chemistry and Physics, 94th Edition, 2013-2014, pg10-197 # 1 13.598443 # 1 H 24.587387 # 2 He # 2 5.391719 # 3 Li 9.32270 # 4 Be 8.29802 # 5 B 11.26030 # 6 C 14.5341 # 7 N 13.61805 # 8 O 17.4228 # 9 F 21.56454 # 10 Ne # 3 5.139076 # 11 Na 7.646235 # 12 Mg 5.985768 # 13 Al 8.15168 # 14 Si 10.48669 # 15 P 10.36001 # 16 S 12.96763 # 17 Cl 15.759610 # 18 Ar # 4 4.3406633 # 19 K 6.11316 # 20 Ca 6.56149 # 21 Sc 6.82812 # 22 Ti 6.74619 # 23 V 6.76651 # 24 Cr 7.43402 # 25 Mn 7.9024 # 26 Fe 7.88101 # 27 Co 7.6398 # 28 Ni 7.72638 # 29 Cu 9.394199 # 30 Zn 5.999301 # 31 Ga 7.89943 # 32 Ge 9.7886 # 33 As 9.75239 # 34 Se 11.8138 # 35 Br 13.99961 # 36 Kr # 5 4.177128 # 37 Rb 5.69485 # 38 Sr 6.2173 # 39 Y 6.63390 # 40 Zr 6.75885 # 41 Nb 7.09243 # 42 Mo 7.28 # 43 Tc 7.36050 # 44 Ru 7.45890 # 45 Rh 8.3369 # 46 Pd 7.57623 # 47 Ag 8.99382 # 48 Cd 5.78636 # 49 In 7.34392 # 50 Sn 8.60839 # 51 Sb 9.0096 # 52 Te 10.45126 # 53 I 12.12984 # 54 Xe # 6 3.893905 # 55 Cs 5.211664 # 56 Ba # Lanthanoid 5.5769 # 57 La 5.5387 # 58 Ce 5.473 # 59 Pr 5.5250 # 60 Nd 5.582 # 61 Pm 5.6437 # 62 Sm 5.67038 # 63 Eu 6.14980 # 64 Gd 5.8638 # 65 Tb 5.9389 # 66 Dy 6.0215 # 67 Ho 6.1077 # 68 Er 6.18431 # 69 Tm 6.25416 # 70 Yb 5.42586 # 71 Lu # 6 cont. 6.82507 # 72 Hf 7.54957 # 73 Ta 7.86403 # 74 W 7.83352 # 75 Re 8.43823 # 76 Os 8.96702 # 77 Ir 8.9588 # 78 Pt 9.22553 # 79 Au 10.4375 # 80 Hg 6.108194 # 81 Tl 7.41663 # 82 Pb 7.2855 # 83 Bi 8.414 # 84 Po - # 85 At 10.7485 # 86 Rn # 7 4.072741 # 87 Fr 5.278423 # 88 Ra # Actinoid 5.17 # 89 Ac 6.3067 # 90 Th 5.89 # 91 Pa 6.1941 # 92 U 6.2657 # 93 Np 6.0260 # 94 Pu 5.9738 # 95 Am 5.9914 # 96 Cm 6.1979 # 97 Bk 6.2817 # 98 Cf 6.42 # 99 Es 6.50 # 100 Fm 6.58 # 101 Md 6.65 # 102 No 4.9 # 103 Lr # 7 cont. 6.0 # 104 Rf ``` -------------------------------- ### mordred.descriptors Module Documentation Source: https://github.com/mordred-descriptor/mordred/blob/develop/docs/subpackages/mordred.descriptors.rst This section details the members, undocumented members, and inheritance of the mordred.descriptors module. It is generated using Sphinx's automodule directive. ```python .. automodule:: mordred.descriptors :members: :undoc-members: :show-inheritance: ``` -------------------------------- ### Electronegativity Data for Period 6 (Part 2) Source: https://github.com/mordred-descriptor/mordred/blob/develop/mordred/data/allred_rocow_electron_negativity.txt This snippet contains electronegativity values for the continuation of Period 6 elements, from Hafnium to Astatine. The data is presented as a list of values, with '-' indicating missing entries. ```text # 6 cont. 1.23 # 72 Hf 1.33 # 73 Ta 1.40 # 74 W 1.46 # 75 Re 1.52 # 76 Os 1.55 # 77 Ir 1.44 # 78 Pt 1.42 # 79 Au 1.44 # 80 Hg 1.44 # 81 Tl 1.55 # 82 Pb 1.67 # 83 Bi 1.76 # 84 Po 1.90 # 85 At ``` -------------------------------- ### Calculate All Descriptors from SMILES Source: https://github.com/mordred-descriptor/mordred/blob/develop/README.rst Calculates all available molecular descriptors for molecules listed in a SMILES file and outputs the results in CSV format. ```console $ python -m mordred example.smi ``` -------------------------------- ### Mordred Descriptor Data Sections Source: https://github.com/mordred-descriptor/mordred/blob/develop/mordred/data/mc_gowan_volume.txt This snippet displays the categorized data from the Mordred descriptor project. Each section contains numerical values and corresponding element identifiers. ```plaintext # 1 8.71 # 1 H 6.75 # 2 He # 2 22.23 # 3 Li 20.27 # 4 Be 18.31 # 5 B 16.35 # 6 C 14.39 # 7 N 12.43 # 8 O 10.47 # 9 F 8.51 # 10 Ne # 3 32.71 # 11 Na 30.75 # 12 Mg 28.79 # 13 Al 26.83 # 14 Si 24.87 # 15 P 22.91 # 16 S 20.95 # 17 Cl 18.99 # 18 Ar # 4 51.89 # 19 K 50.28 # 20 Ca 48.68 # 21 Sc 47.07 # 22 Ti 45.47 # 23 V 43.86 # 24 Cr 42.26 # 25 Mn 40.65 # 26 Fe 39.05 # 27 Co 37.44 # 28 Ni 35.84 # 29 Cu 34.23 # 30 Zn 32.63 # 31 Ga 31.02 # 32 Ge 29.42 # 33 As 27.81 # 34 Se 26.21 # 35 Br 24.60 # 36 Kr # 5 60.22 # 37 Rb 58.61 # 38 Sr 57.01 # 39 Y 55.40 # 40 Zr 53.80 # 41 Nb 52.19 # 42 Mo 50.59 # 43 Tc 48.98 # 44 Ru 47.38 # 45 Rh 45.77 # 46 Pd 44.17 # 47 Ag 42.56 # 48 Cd 40.96 # 49 In 39.35 # 50 Sn 37.75 # 51 Sb 36.14 # 52 Te 34.54 # 53 I 32.93 # 54 Xe # 6 77.25 # 55 Cs 76.00 # 56 Ba # Lanthanoid 74.75 # 57 La 73.49 # 58 Ce 72.24 # 59 Pr 70.99 # 60 Nd 69.74 # 61 Pm 68.49 # 62 Sm 67.23 # 63 Eu 65.98 # 64 Gd 64.73 # 65 Tb 63.48 # 66 Dy 62.23 # 67 Ho 60.97 # 68 Er 59.72 # 69 Tm 58.47 # 70 Yb 57.22 # 71 Lu # 6 cont. 55.97 # 72 Hf 54.71 # 73 Ta 53.46 # 74 W 52.21 # 75 Re 50.96 # 76 Os 49.71 # 77 Ir 48.45 # 78 Pt 47.20 # 79 Au 45.95 # 80 Hg 44.70 # 81 Tl 43.45 # 82 Pb 42.19 # 83 Bi 40.94 # 84 Po 39.69 # 85 At 38.44 # 86 Rn # 7 75.59 # 87 Fr 74.34 # 88 Ra # Actinoid 73.09 # 89 Ac 71.83 # 90 Th 70.58 # 91 Pa 69.33 # 92 U 68.08 # 93 Np 66.83 # 94 Pu 65.57 # 95 Am 64.32 # 96 Cm 63.07 # 97 Bk 61.82 # 98 Cf 60.57 # 99 Es 59.31 # 100 Fm 58.06 # 101 Md 56.81 # 102 No 55.56 # 103 Lr ``` -------------------------------- ### Electronegativity Values by Atomic Number Source: https://github.com/mordred-descriptor/mordred/blob/develop/mordred/data/sanderson_electron_negativity.txt This snippet lists electronegativity values for elements, indexed by their atomic number. It includes data for periods 1 through 6, with some elements marked as '-' indicating missing or not applicable values. The data is sourced from scientific publications and web resources. ```data # Project: /mordred-descriptor/mordred # Content: # # Sanderson, RT. Electronegativity and Bond Energy. J. Am. Chem. Soc. 1983, 105: 2259-2261. # # Remaining values come from http://www.talete.mi.it/help/dragon_help/weighting_schemes.htm # 1 2.592 # 1 H - # 2 He # 2 0.670 # 3 Li 1.810 # 4 Be 2.275 # 5 B 2.746 # 6 C 3.194 # 7 N 3.654 # 8 O 4.000 # 9 F 4.5 # 10 Ne # 3 0.560 # 11 Na 1.318 # 12 Mg 1.714 # 13 Al 2.138 # 14 Si 2.515 # 15 P 2.957 # 16 S 3.475 # 17 Cl 3.31 # 18 Ar # 4 0.445 # 19 K 0.946 # 20 Ca 1.02 # 21 Sc 1.09 # 22 Ti 1.39 # 23 V 1.66 # 24 Cr 2.2 # 25 Mn 2.2 # 26 Fe 2.56 # 27 Co 1.94 # 28 Ni 2.033 # 29 Cu 2.223 # 30 Zn 2.419 # 31 Ga 2.618 # 32 Ge 2.816 # 33 As 3.014 # 34 Se 3.219 # 35 Br 2.91 # 36 Kr # 5 0.312 # 37 Rb 0.721 # 38 Sr 0.65 # 39 Y 0.9 # 40 Zr 1.42 # 41 Nb 1.15 # 42 Mo - # 43 Tc - # 44 Ru - # 45 Rh - # 46 Pd 1.826 # 47 Ag 1.978 # 48 Cd 2.138 # 49 In 2.298 # 50 Sn 2.458 # 51 Sb 2.618 # 52 Te 2.778 # 53 I 2.34 # 54 Xe # 6 0.220 # 55 Cs 0.651 # 56 Ba # Lanthanoid - # 57 La - # 58 Ce - # 59 Pr - # 60 Nd - # 61 Pm - # 62 Sm - # 63 Eu - # 64 Gd - # 65 Tb - # 66 Dy - # 67 Ho - # 68 Er - # 69 Tm - # 70 Yb - # 71 Lu # 6 cont. - # 72 Hf - # 73 Ta 0.98 # 74 W - # 75 Re - # 76 Os - # 77 Ir - # 78 Pt - # 79 Au 2.195 # 80 Hg 2.246 # 81 Tl 2.291 # 82 Pb 2.342 # 83 Bi ``` -------------------------------- ### Stream Read for Low Memory Usage Source: https://github.com/mordred-descriptor/mordred/blob/develop/README.rst Calculates descriptors by streaming input molecules, which is suitable for large files with limited memory. It also saves the output to a CSV file. ```console $ python -m mordred example.smi -s -o example.csv ``` -------------------------------- ### mordred.error Module Documentation Source: https://github.com/mordred-descriptor/mordred/blob/develop/docs/subpackages/mordred.error.rst This section details the mordred.error module, which contains custom exception classes used within the mordred library. It lists all members, including undocumented ones, and shows inheritance relationships. ```APIDOC .. automodule:: mordred.error :members: :undoc-members: :show-inheritance: ``` -------------------------------- ### mordred.Result Class Source: https://github.com/mordred-descriptor/mordred/blob/develop/docs/mordred.rst Documentation for the Result class in the mordred package. This class likely holds the results of descriptor calculations. ```APIDOC mordred.Result :members: - Represents the result of a descriptor calculation. - Likely contains methods and attributes for accessing calculated descriptor values. ``` -------------------------------- ### Calculate Specific Descriptors (ABCIndex) Source: https://github.com/mordred-descriptor/mordred/blob/develop/README.rst Calculates only the ABCIndex descriptor for molecules in a SMILES file and outputs the results. ```console $ python -m mordred example.smi -d ABCIndex ```