class Pair: def __init__(self, receptordb, liganddb): self.ligand = Ligand(liganddb) self.receptor = Receptor(receptordb) def foreachPair(self, pid, sink): self.ligand.foreachId(lambda cid: sink(pid, cid)) def foreach(self, sink, criteria=''): self.receptor.foreachId(lambda pid: self.foreachPair(pid, sink)) def size(self, rcriteria='1=1', lcriteria='1=1'): ligands = self.ligand.size(lcriteria) receptors = self.receptor.size(rcriteria) return ligands * receptors def close(self): self.ligand.close() self.receptor.close()
from carro import Carro from receptor import Receptor from board import Board import time arduino = Board() carro = Carro() receptor = Receptor() while (True): try: receptor.atualizaDados() x = receptor.getX() y = receptor.getY() f = receptor.getF() carro._estercamento.estercar(x) #carro._motor.acelerar(y) if (f == "0"): #carro._freio.setFreio() print("Freando") print("****") except (KeyboardInterrupt): print("Ate mais!") carro._motor.desligar() break
def run_as_node(args): config = ReceptorConfig(args.config, map_args_to_config(args)) receptor = Receptor(config) logger.info("Running as Receptor node with ID: {}".format( receptor.node_id)) node.mainloop(receptor, args.ping_interval)
def run_as_controller(args): config = ReceptorConfig(cmdline_args=map_args_to_config(args)) receptor = Receptor(config) logger.info(f'Starting up as node ID {receptor.node_id}') controller.mainloop(receptor, args.listen_address, args.listen_port, args.socket_path)
from button import Button from receptor import Receptor from commands import ButtonCommand recep = Receptor() butt = Button() butt.set_command(ButtonCommand(recep, {"ola": "mundo"})) butt.action()
import os from parameter import Parameter from receptor import Receptor p = Parameter() dir = p._('project.dir') + '/' project_dir = dir + p._('project.wizard.create.name') data_dir = project_dir + '/data/' molecule = Receptor(data_dir + p._('project.wizard.receptor.db')) columns = p._('project.wizard.receptor_report.columns') molecule.foreachRecord(columns, lambda id, fields: print(id, fields, sep='\t')) molecule.close()
def __init__(self, receptordb, liganddb): self.ligand = Ligand(liganddb) self.receptor = Receptor(receptordb)
from path import Path p = Parameter() pt = Path(p) #locate tree dir = p._('project.dir') + '/' name = p._('project.wizard.create.name') project_dir = dir + name data_dir = project_dir + '/data/' filename = '{}/stage/{}'.format(project_dir, p._('project.wizard.load.receptor')) # import ligands molecule = Receptor(data_dir + p._('project.wizard.receptor.db')) molecule.clear() # import data for id in open(filename): id = id.strip('\n') molecule.add(id) molecule.commit() # download structures def instage(id, pt): return pt.filename('{}.pdb'.format(id), pt.stage, '*.pdb') != None def copy(id, dir, pt, pids):