Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/aspuru-guzik-group/JANUS
/ functions
Functions
46 in github.com/aspuru-guzik-group/JANUS
⨍
Functions
46
◇
Types & classes
3
↓ 7 callers
Function
count_atoms
Count the number of atoms in mol with atomic number atomic_num Parameters: mol (rdkit.Chem.rdchem.Mol) : Molecule in which search is
src/janus/features.py:69
↓ 4 callers
Function
get_selfies_chars
Obtain a list of all selfie characters in string selfies Parameters: selfie (string) : A selfie string - representing a molecule
src/janus/utils.py:8
↓ 3 callers
Method
check_filters
(self, smi_list: List[str])
src/janus/janus.py:166
↓ 3 callers
Method
flatten_list
(nested_list)
src/janus/janus.py:486
↓ 2 callers
Function
count_conseq_double
Return the number of consequtive double bonds in an entire molecule including rings Examples >>> count_conseq_double(Chem.MolFromSmil
src/janus/features.py:116
↓ 2 callers
Function
get_device
(use_gpu: bool)
src/janus/network.py:116
↓ 2 callers
Function
get_fp_scores
Given a list of SMILES (smiles_back), tanimoto similarities are calculated (using Morgan fingerprints) to SMILES (target_smi). Paramet
src/janus/crossover.py:23
↓ 2 callers
Function
mutate_sf
Given a list of SELFIES alphabets, make random changes to the molecule using alphabet. Opertations to molecules are character replacements,
src/janus/mutate.py:20
↓ 2 callers
Method
mutate_smi_list
(self, smi_list: List[str], space="local")
src/janus/janus.py:126
↓ 2 callers
Function
obtain_features
(smi_list: List[str], num_workers: int = 1)
src/janus/network.py:53
↓ 1 callers
Method
check_criteria
Compare with value in memory. If there is an improvement, reset the checkpoint and save the model weights. Return True if stopping cr
src/janus/network.py:95
↓ 1 callers
Function
create_and_train_network
Featurize smiles and train classifier network. Return trained network.
src/janus/network.py:216
↓ 1 callers
Function
create_network
Obtain network Parameters: n_hidden (list) : Intermediate discrm layers (e.g. [100, 10]) device (str) : D
src/janus/network.py:128
↓ 1 callers
Method
crossover_smi_list
(self, smi_list: List[str])
src/janus/janus.py:153
↓ 1 callers
Function
do_x_training_steps
Do steps for training. Set batch_size to -1 for full batch training, and 1 for SGD.
src/janus/network.py:162
↓ 1 callers
Function
get_bond_indeces
Get all the bond indices with Rotatable bonds atoms (generated from 'get_rot_bonds_posn')
src/janus/features.py:23
↓ 1 callers
Function
get_fp_scores
Given a list of SMILES (smiles_back), tanimoto similarities are calculated (using Morgan fingerprints) to SMILES (target_smi). Paramete
src/janus/utils.py:53
↓ 1 callers
Function
get_frags
Create fragments from smi with some radius. Remove duplicates and any fragments that are blank molecules.
src/janus/fragment.py:38
↓ 1 callers
Method
get_good_bad_smiles
Given fitness values of all SMILES in population, and the generation size, this function smplits the population into two lists: kee
src/janus/janus.py:422
↓ 1 callers
Function
get_joint_sim
Get joint similarity values for all smiles in all_smiles, calculated with refernce to starting_smile & target_smile. Parameters --
src/janus/crossover.py:51
↓ 1 callers
Function
get_mol_info
Calculate a set of 51 RdKit properties, collected from above helper functions. Parameters: smi (string) : SMILE string of molecule
src/janus/features.py:179
↓ 1 callers
Function
get_num_bond_types
Calculate the ratio of total number of (single, double, triple, aromatic) bonds to the total number of bonds. Parameters: mol (
src/janus/features.py:82
↓ 1 callers
Function
get_rot_bonds_posn
Return atom indices with Rotatable bonds Examples: >>> get_rot_bonds_posn('CC1=CC=CC=C1') # Toluene (Rotatable Bonds At: CH3 & Benzene
src/janus/features.py:10
↓ 1 callers
Function
obtain_model_pred
(smi_list: List[str], net: nn.Module, use_gpu: bool = True, num_workers: int = 1, batch_size: int = 10
src/janus/network.py:239
↓ 1 callers
Function
obtain_path
Create a single path between molecules starting_smile and target_smile. Parameters ---------- starting_smile : (str) Valid
src/janus/crossover.py:87
↓ 1 callers
Function
obtain_rings
Obtain a list of all rings present in SMILE string smi Examples: >>> obtain_rings('CCC1=CC=CC=C1') ['c1ccccc1'] >>> obtain_rings(
src/janus/features.py:33
↓ 1 callers
Function
perform_crossover
Create multiple paths between SMILES in comb_smi to obtain median molecules, representing the crossover structure. Parameters ----
src/janus/crossover.py:149
↓ 1 callers
Method
restore_best
(self, net, verbose=True)
src/janus/network.py:110
↓ 1 callers
Method
run
Run optimization based on hyperparameters initialized
src/janus/janus.py:178
↓ 1 callers
Function
sanitize_smiles
Return a canonical smile representation of smi Parameters ---------- smi : str smile string to be canonicalized Retur
src/janus/utils.py:26
↓ 1 callers
Method
save_hyperparameters
(self)
src/janus/janus.py:171
↓ 1 callers
Function
size_ring_counter
Get the number of rings of sizes 3 to 20 and the number of consequtive double bonds in a ring Parameters: ring_ls (list) : list of rings
src/janus/features.py:146
↓ 1 callers
Function
train_valid_split
Return a random split of training and validation data. Ratio determines the size of training set. Avoids use of sklearn.
src/janus/network.py:147
Method
__init__
( self, work_dir: str, fitness_function: Callable, start_population: str,
src/janus/janus.py:24
Method
__init__
(self, h_sizes: List[int], n_input: int, n_output: int)
src/janus/network.py:64
Method
__init__
(self, patience, min_delta, mode='minimize')
src/janus/network.py:81
Function
crossover_smiles
Return a list of smiles (crossover molecules) that are ordered (highest to lowest) by joint similarity scores. Parameters ---------
src/janus/crossover.py:219
Function
custom_filter
Function that takes in a smile and returns a boolean. True indicates the smiles PASSES the filter.
tests/example.py:16
Function
fitness_function
User-defined function that takes in individual smiles and outputs a fitness value.
tests/example.py:9
Function
form_fragments
Create fragments of certain radius. Returns a list of fragments using SELFIES characters.
src/janus/fragment.py:52
Method
forward
(self, x)
src/janus/network.py:72
Function
from_yaml
(work_dir, fitness_function, start_population, yaml_file, **kwargs)
src/janus/utils.py:78
Function
get_mol_feature
Given a SMILES string (smi), a user needs to provide code for creating descriptors for the molecules. This will be used as features for the (
src/janus/network.py:27
Method
log
(self)
src/janus/janus.py:482
Function
mutate_smiles
Given an input smile, perform mutations to the strucutre using provided SELFIE alphabet list. 'num_random_samples' number of different SMILES
src/janus/mutate.py:81
Function
sanitize_smiles
Return a canonical smile representation of smi Parameters: smi (string) : smile string to be canonicalized Returns: mol (rdkit.Chem.r
src/janus/fragment.py:21