<commit_before>'''
SYNBIOCHEM-DB (c) University of Manchester 2015

SYNBIOCHEM-DB is licensed under the MIT License.

To view a copy of this license, visit <http://opensource.org/licenses/MIT/>.

@author:  neilswainston
'''
from sbcdb.enzyme_utils import EnzymeManager


class ReactionManager(object):
    '''Class to implement a manager of Reaction data.'''

    def __init__(self):
        '''Constructor.'''
        self.__nodes = {}
        self.__reac_ids = {}
        self.__reac_enz_rels = []
        self.__org_enz_rels = []
        self.__enz_man = EnzymeManager()

    def get_files(self, writer):
        '''Write neo4j import files.'''
        return ([writer.write_nodes(self.__nodes.values(),
                                    'Reaction'),
                 writer.write_nodes(self.__enz_man.get_nodes(),
                                    'Enzyme')],
                [writer.write_rels(self.__reac_enz_rels,
                                   'Reaction', 'Enzyme'),
                 writer.write_rels(self.__enz_man.get_org_enz_rels(),
                                   'Organism', 'Enzyme')])<commit_msg>Fixed minor syntactic bug.<commit_after>'''
SYNBIOCHEM-DB (c) University of Manchester 2015

SYNBIOCHEM-DB is licensed under the MIT License.

To view a copy of this license, visit <http://opensource.org/licenses/MIT/>.

@author:  neilswainston
'''
from sbcdb.enzyme_utils import EnzymeManager


class ReactionManager(object):
    '''Class to implement a manager of Reaction data.'''

    def __init__(self):
        '''Constructor.'''
        self.__nodes = {}
        self.__reac_ids = {}
        self.__reac_enz_rels = []
        self.__org_enz_rels = []
        self.__enz_man = EnzymeManager()

    def write_files(self, writer):
        '''Write neo4j import files.'''
        return ([writer.write_nodes(self.__nodes.values(),
                                    'Reaction'),
                 writer.write_nodes(self.__enz_man.get_nodes(),
                                    'Enzyme')],
                [writer.write_rels(self.__reac_enz_rels,
                                   'Reaction', 'Enzyme'),
                 writer.write_rels(self.__enz_man.get_org_enz_rels(),
                                   'Organism', 'Enzyme')])
{'fraction_non_alphanumeric': 0.1163202122954445, 'fraction_numerical': 0.004422821760283061, 'mean_word_length': 1.9491525423728813, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5796203', 'n_tokens_mistral': 691, 'n_tokens_neox': 628, 'n_words': 134}