diffalign.utils package¶
Subpackages¶
Submodules¶
diffalign.utils.chem module¶
- diffalign.utils.chem.set_rdmol_positions(rdkit_mol, pos)[source]¶
- Parameters:
rdkit_mol – An rdkit.Chem.rdchem.Mol object.
pos – (N_atoms, 3)
diffalign.utils.common module¶
diffalign.utils.dataloader module¶
diffalign.utils.datasets module¶
- class diffalign.utils.datasets.MolClusterData(x: Tensor | None = None, edge_index: Tensor | None = None, edge_attr: Tensor | None = None, y: Tensor | int | float | None = None, pos: Tensor | None = None, time: Tensor | None = None, **kwargs)[source]¶
Bases:
Data
- class diffalign.utils.datasets.PackedConformationDataset(path, transform=None)[source]¶
Bases:
ConformationDataset
- class diffalign.utils.datasets.SidechainConformationDataset(path, transform=None, cutoff=10.0, max_residue=5000, fix_subgraph=False)[source]¶
Bases:
ConformationDataset
- diffalign.utils.datasets.accumulate_grad_from_subgraph(model, atom_type, pos, bond_index, bond_type, batch, atom2res, batch_size=8, device='cuda:0', is_sidechain=None, is_alpha=None, pos_gt=None, cutoff=10.0, max_residue=5000, transform=None)[source]¶
decompose the protein to subgraphs
evaluate subgraphs using trained models
accumulate atom-wise grads
return grads
- diffalign.utils.datasets.get_test_set_with_large_num_conf(base_path, dataset_name, block, tot_mol_size=1000, seed=None, confmin=50, confmax=500)[source]¶
base_path: directory that contains GEOM dataset dataset_name: dataset name, should be in [qm9, drugs] conf_per_mol: keep mol that has at least conf_per_mol confs, and sampling the most probable conf_per_mol confs train_size ratio, val = test = (1-train_size) / 2 tot_mol_size: max num of mols. The total number of final confs should be tot_mol_size * conf_per_mol seed: rand seed for RNG
- diffalign.utils.datasets.preprocess_GEOM_dataset(base_path, dataset_name, max_conf=5, train_size=0.8, max_size=9999999999, seed=None)[source]¶
- diffalign.utils.datasets.preprocess_GEOM_dataset_with_fixed_num_conf(base_path, dataset_name, conf_per_mol=5, train_size=0.8, tot_mol_size=50000, seed=None)[source]¶
base_path: directory that contains GEOM dataset dataset_name: dataset name, should be in [qm9, drugs] conf_per_mol: keep mol that has at least conf_per_mol confs, and sampling the most probable conf_per_mol confs train_size ratio, val = test = (1-train_size) / 2 tot_mol_size: max num of mols. The total number of final confs should be tot_mol_size * conf_per_mol seed: rand seed for RNG
diffalign.utils.misc module¶
diffalign.utils.transforms module¶
diffalign.utils.visualize module¶
- diffalign.utils.visualize.visualize_mol(mol, size=(300, 300), surface=False, opacity=0.5)[source]¶
Draw molecule in 3D
Args:¶
mol: rdMol, molecule to show size: tuple(int, int), canvas size style: str, type of drawing molecule
style can be ‘line’, ‘stick’, ‘sphere’, ‘carton’
surface, bool, display SAS opacity, float, opacity of surface, range 0.0-1.0
Return:¶
viewer: py3Dmol.view, a class for constructing embedded 3Dmol.js views in ipython notebooks.