Пример #1
0
    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 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']
        }
Пример #3
0
def main(config):
    connection = db.connect(config)
    data = options(connection)

    with open(config['options'], 'wb') as out:
        json.dump(data, out)
Пример #4
0
def main(config):
    connection = db.connect(config)
    data = options(connection)

    with open(config['options'], 'wb') as out:
        json.dump(data, out)