def load(self): # Add button to ribbon for settings flare.main_window().ribbon["FlareNet"]["Settings"].add_button( 'Settings', self.settings) self.checker_thread = threading.Thread( target=self.viewer_changed_checker) self.checker_thread.start()
def settings(self): # Get flare main window window = flare.main_window().widget() # Open settings dialog form = Form(flare=self, parent=window) form.show()
def check_camera(self): view = flare.main_window().camera.save_view() if self.last_view != view: self.last_view = view if self.websocket: self.websocket.send_json(command='view_change', data=dict(key=self.key, view=view)) print('View changed')
def set_camera(self, matrix): self.last_view = matrix flare.main_window().camera.restore_view(view=matrix)
from cresset import flare project = flare.main_window().project for l in project.ligands: f_name = l.title.split(':1')[0] l.minimize() l.write_file(f_name + '.mol2')
'/Users/toni_brain/Projects/git/BioSimSpace_examples/Flare/bioactivity-18_16_53_02.txt' ) as hnd: rows = csv.reader(hnd, delimiter='\t') for i, row in enumerate(rows): if (i == 0): headers = list(row) else: table.append(list(row)) headers_dict = {h: i for i, h in enumerate(headers)} smiles_idx = headers_dict['CANONICAL_SMILES'] pchembl_idx = headers_dict['PCHEMBL_VALUE'] chemblid_idx = headers_dict['CMPD_CHEMBLID'] p = flare.Project() if (flare.main_window()): flare.main_window().project = p smiles_set = set() props = Properties() n_vec = props.GetPropertyNames() rdk_mols = [] for row in table: mol = filter_extract_mol(row, headers_dict) if (mol is None): continue row[smiles_idx] = Chem.MolToSmiles(mol) if (row[smiles_idx] in smiles_set): continue smiles_set.add(row[smiles_idx])
addCoords=(mol.GetNumConformers() > 0), explicitOnly=True) Chem.SanitizeMol(mol_copy) mol_copy.ClearComputedProps() mol_copy.UpdatePropertyCache() res.append(mol_copy) return res # load molecules: lig02_pdb = open("17.pdb", "r").read() lig12_pdb = open("18.pdb", "r").read() if flare: ligands = flare.main_window().project.ligands lig02 = ligands.extend(flare.read_string(lig02_pdb, "pdb"))[-1] lig12 = ligands.extend(flare.read_string(lig12_pdb, "pdb"))[-1] lig02_mol = lig02.to_rdmol() lig12_mol = lig12.to_rdmol() else: lig02_mol = rdmolfiles.MolFromPDBBlock(lig02_pdb) lig12_mol = rdmolfiles.MolFromPDBBlock(lig12_pdb) # make list of molecules to map the MCS to: perturbation_pair = [] perturbation_pair.append(lig02_mol) perturbation_pair.append(lig12_mol) MCS_object = rdFMCS.FindMCS(perturbation_pair, completeRingsOnly=True)