def process(self, query): if self.canned: canned = dict(self.canned) canned['id'] = query['id'] canned['expanded_units'] = self.expand(query['ranges']) return canned rcad = db.connect(config) def translator(chain): return db.get_translation(rcad, query['pdb'], query['model'], chain) translated = ranges.translate(translator, query['ranges']) #full, summ, reqs = db.seqvar(rcad, query['pdb'], query['model'], # translated) full, summ, reqs = db.seqvarM3A(rcad, query['pdb'], query['model'], translated, int(query['aid'])) return { 'id': query['id'], 'units': query['units'], 'full': full, 'summ': summ, 'reqs': reqs, 'pdb': query['pdb'], 'model': query['model'], 'ranges': query['ranges'], 'expanded_units': self.expand(query['ranges']), 'aid': query['aid'], 'descr': query['descr'] }
def main(config): connection = db.connect(config) data = options(connection) with open(config['options'], 'wb') as out: json.dump(data, out)