# Path: indra/databases/hgnc_client.py
# def get_uniprot_id(hgnc_id):
# def get_entrez_id(hgnc_id):
# def get_hgnc_from_entrez(entrez_id):
# def get_ensembl_id(hgnc_id):
# def get_hgnc_from_ensembl(ensembl_id):
# def get_hgnc_name(hgnc_id):
# def get_hgnc_id(hgnc_name):
# def get_current_hgnc_id(hgnc_name):
# def get_hgnc_from_mouse(mgi_id):
# def get_hgnc_from_rat(rgd_id):
# def get_rat_id(hgnc_id):
# def get_mouse_id(hgnc_id):
# def get_hgnc_entry(hgnc_id):
# def get_gene_type(hgnc_id: str) -> Union[str, None]:
# def is_kinase(gene_name):
# def is_transcription_factor(gene_name):
# def is_phosphatase(gene_name):
# def get_enzymes(hgnc_id: str) -> Set[str]:
# def get_hgncs_from_enzyme(ec_code: str) -> Set[str]:
# def _read_hgnc_maps():
# def _read_kinases():
# def _read_phosphatases():
# def _read_tfs():
# 
# Path: indra/sources/sparser/processor.py
# class SparserJSONProcessor(object):
# class SparserError(ValueError):
# class InvalidAgent(SparserError):
# class TranslocationWithoutLocations(SparserError):
# class MissingSubj(SparserError):
# class MissingObj(SparserError):
# class UnaryComplex(SparserError):
# class NoAgents(SparserError):
# class MissingEvidenceText(SparserError):
# class InvalidEvidence(SparserError):
#     def __init__(self, json_dict):
#     def get_statements(self):
#     def set_statements_pmid(self, pmid):
#     def get_error_stats(self):
# def fix_agent(agent):
# def fix_json_stmt(json_stmt):
# def fix_json_agent(ag_obj):
# def check_statement_sanity(stmt):
# def _read_ncit_map():
# def _read_famplex_map():


import logging
from collections import defaultdict
from indra.statements import *
from indra.literature import id_lookup
from indra.databases import uniprot_client, hgnc_client
from .processor import ncit_map, famplex_map
            #logger.warning('Skipping collection Agent.')
            return None

        # Find the name, uid and raw-text tags first and get their text
        # content if available
        uid_tag = ref.find("var/[@name='uid']")
        name_tag = ref.find("var/[@name='name']")
        text_tag = ref.find("var/[@name='raw-text']")
        if name_tag is not None and name_tag.text:
            name = name_tag.text
        else:
            name = None
        if uid_tag is not None and uid_tag.text:
            uid = uid_tag.text
        else:
            uid = None
        if text_tag is not None and text_tag.text:
            raw_text = text_tag.text
        else:
            raw_text = None

        # TODO: factor this out and reuse fix_agents
        db_refs = {}
        # Save raw text if available
        if raw_text:
            db_refs['TEXT'] = raw_text
        agent_name = raw_text
        # If we have a proper UID then we try to reconstruct an Agent from that
        if uid is not None and len(uid.split(':')) == 2:
            db_ns, db_id = uid.split(':')

# Path: indra/databases/hgnc_client.py
# def get_uniprot_id(hgnc_id):
# def get_entrez_id(hgnc_id):
# def get_hgnc_from_entrez(entrez_id):
# def get_ensembl_id(hgnc_id):
# def get_hgnc_from_ensembl(ensembl_id):
# def get_hgnc_name(hgnc_id):
# def get_hgnc_id(hgnc_name):
# def get_current_hgnc_id(hgnc_name):
# def get_hgnc_from_mouse(mgi_id):
# def get_hgnc_from_rat(rgd_id):
# def get_rat_id(hgnc_id):
# def get_mouse_id(hgnc_id):
# def get_hgnc_entry(hgnc_id):
# def get_gene_type(hgnc_id: str) -> Union[str, None]:
# def is_kinase(gene_name):
# def is_transcription_factor(gene_name):
# def is_phosphatase(gene_name):
# def get_enzymes(hgnc_id: str) -> Set[str]:
# def get_hgncs_from_enzyme(ec_code: str) -> Set[str]:
# def _read_hgnc_maps():
# def _read_kinases():
# def _read_phosphatases():
# def _read_tfs():
# 
# Path: indra/sources/sparser/processor.py
# class SparserJSONProcessor(object):
# class SparserError(ValueError):
# class InvalidAgent(SparserError):
# class TranslocationWithoutLocations(SparserError):
# class MissingSubj(SparserError):
# class MissingObj(SparserError):
# class UnaryComplex(SparserError):
# class NoAgents(SparserError):
# class MissingEvidenceText(SparserError):
# class InvalidEvidence(SparserError):
#     def __init__(self, json_dict):
#     def get_statements(self):
#     def set_statements_pmid(self, pmid):
#     def get_error_stats(self):
# def fix_agent(agent):
# def fix_json_stmt(json_stmt):
# def fix_json_agent(ag_obj):
# def check_statement_sanity(stmt):
# def _read_ncit_map():
# def _read_famplex_map():


# Path: indra/sources/sparser/xml_processor.py
import logging
from collections import defaultdict
from indra.statements import *
from indra.literature import id_lookup
from indra.databases import uniprot_client, hgnc_client
from .processor import ncit_map, famplex_map

            #logger.warning('Skipping collection Agent.')
            return None

        # Find the name, uid and raw-text tags first and get their text
        # content if available
        uid_tag = ref.find("var/[@name='uid']")
        name_tag = ref.find("var/[@name='name']")
        text_tag = ref.find("var/[@name='raw-text']")
        if name_tag is not None and name_tag.text:
            name = name_tag.text
        else:
            name = None
        if uid_tag is not None and uid_tag.text:
            uid = uid_tag.text
        else:
            uid = None
        if text_tag is not None and text_tag.text:
            raw_text = text_tag.text
        else:
            raw_text = None

        # TODO: factor this out and reuse fix_agents
        db_refs = {}
        # Save raw text if available
        if raw_text:
            db_refs['TEXT'] = raw_text
        agent_name = raw_text
        # If we have a proper UID then we try to reconstruct an Agent from that
        if uid is not None and len(uid.split(':')) == 2:
            db_ns, db_id = uid.split(':')

            be_id = famplex_map.get((db_ns, db_id))