Reference

This page includes the reference documentation for all user-facing code from the Smartclass Python package.

Functions

bfs_search_classes_generator(classes, ...[, ...])

Perform substructure search for chemical classes using Breadth-First Search (BFS) and yield results.

calculate_mcs(mols[, threshold, ...])

Calculate MCS.

check_missing_stereochemistry(smiles[, ...])

Check stereochemistry.

check_smiles_contains_no_dot(smiles)

Checks if SMILES contains no dot.

check_smiles_contains_no_isotope(smiles)

Checks if SMILES contains no isotope.

check_smiles_isomeric(smiles_isomeric[, ...])

Check isomeric smiles.

combine_csv_files(input_files, output_file)

Combine multiple CSV files into a single CSV file.

convert_chemical_formula(text)

Convert chemical formula.

convert_classyfire_dict([classyfire_json, ...])

Converts the classyfire json into a CHEMONTID dictionary.

convert_inchi_to_inchikey(inchi)

Convert a structure InChI to InChIKey.

convert_inchi_to_mass(inchi)

Convert a structure InChI to mass.

convert_inchi_to_mol(inchi)

Convert a structure InChI to MOL.

convert_inchi_to_smiles(inchi)

Convert a structure InChI to SMILES.

convert_list_of_dict(list_of_dict, key, value)

Convert a list of dictionaries to a dictionary with possible inversion.

convert_mol_to_cxsmiles(mol)

Convert a structure MOL to CXSMILES.

convert_mol_to_inchi(mol)

Convert a structure MOL to InChI.

convert_mol_to_inchikey(mol)

Convert a structure MOL to InChIKey.

convert_mol_to_smarts(mol)

Convert a structure MOL to SMARTS.

convert_mol_to_smiles(mol)

Convert a structure MOL to SMILES.

convert_molblock_to_mol(molblock)

Convert a structure MOLBlock to MOL.

convert_smarts_to_mol(smarts)

Convert a structure SMARTS to MOL.

convert_smiles_to_canonical_smiles(smiles)

Convert a structure SMILES to canonical SMILES.

convert_smiles_to_formula(smiles)

Convert a structure SMILES to a molecular formula.

convert_smiles_to_inchi(smiles)

Convert a structure SMILES to InChI.

convert_smiles_to_mass(smiles)

Convert a structure SMILES to an exact mass.

convert_smiles_to_mol(smiles)

Convert a structure SMILES to MOL.

download_file_if_not_exists(url, output)

Downloads a file from the specified URL if it does not exist.

enumerate_structures(mol)

Enumerate structures.

export_dict_to_json(dic, output)

Export dict to json.

export_results(output, results)

Export a list of dictionaries to a CSV file.

fix_inchi_tautomerization(smiles)

Fix InChI tautomerization.

get_class_structures(classes)

Build a dictionary of class_id to class_structure from the provided classes list.

get_num_atoms_bonds(mol)

Get number of atoms and bonds.

get_num_matched_atoms_bonds(mol_1, mol_2)

Get number of matched atoms and bonds.

get_request(url, query[, max_retries, ...])

Send a GET request to a SPARQL endpoint and retrieve JSON data.

load_csv_from_path(path)

Load csv from path.

load_external_classes_file(file[, id_name, ...])

Load a Polars DataFrame from an external tsv file with chemical classes.

load_json_from_path(path)

Load json from path.

load_json_from_url(url)

Load JSON from URL.

load_json_from_url_or_path(url, name)

Load json from URL or path.

load_pkg_bitter_smiles()

Load bitter SMILES data from the package file into a Polars DataFrame.

load_pkg_chemical_hierarchy([file_path])

Load package chemical classes hierarchy.

load_pkg_classes()

Load chemical classes data from the package file into a Polars DataFrame.

load_pkg_data()

Load the package data.

load_pkg_file(file[, directory])

Load data from a package file into a Polars DataFrame.

load_pkg_mappings()

Load chemont__wd mappings data from the package file into a Polars DataFrame.

load_pkg_mia()

Load Mono Indole Alkaloids (MIA) data from the package file into a Polars DataFrame.

load_smiles(input[, column])

Load SMILES.

load_tsv_from_path(path)

Load tsv from path.

read_query(query)

sample_list(list[, samples_max])

Sample from a list of things.

search_class(class_dict, structures, params)

Search for a single class and return the results as a list of dictionaries.

search_classes([classes_file, ...])

Substructure search for chemical classes.

split_csv(input_file, output_dir[, ...])

Split a CSV file into multiple smaller CSV files.

standardize(smiles)

Standardize.