Exemple #1
0
def test_hgnc():

    h = HGNC()
    h.get_info()

    h.fetch('symbol', 'ZNF3')

    h.fetch('alias_name', 'A-kinase anchor protein, 350kDa')

    h.search('BRAF')
    h.search('symbol', 'ZNF*')
    h.search('symbol', 'ZNF?')
    h.search('symbol', 'ZNF*+AND+status:Approved')
    h.search('symbol', 'ZNF3+OR+ZNF12')
    h.search('symbol', 'ZNF*+NOT+status:Approved')
Exemple #2
0
def test_hgnc():

    h = HGNC()
    h.get_info()

    h.fetch("symbol", "ZNF3")

    h.fetch("alias_name", "A-kinase anchor protein, 350kDa")

    h.search("BRAF")
    h.search("symbol", "ZNF*")
    h.search("symbol", "ZNF?")
    h.search("symbol", "ZNF*+AND+status:Approved")
    h.search("symbol", "ZNF3+OR+ZNF12")
    h.search("symbol", "ZNF*+NOT+status:Approved")
 def _lookup_hgnc_id(self):
     hgnc_web = HGNC()
     hgnc = hgnc_web.fetch('hgnc_id', self.external_id)
     if hgnc['response']['numFound'] == 1:
         self.name = hgnc['response']['docs'][0]['symbol']
         self.description = hgnc['response']['docs'][0]['name']
         # Get synonyms if requested.
         if self.get_synonyms:
             for item in hgnc['response']['docs'][0]['alias_symbol']:
                 self.synonyms.append(item)
     elif hgnc['response']['numFound'] == 0:
         self.error = "No results found when querying HGNC for {}".format(
             self.external_id)
     return self
Exemple #4
0
def add_sequence_to_nodes(n: str, d: Dict[str, Any]):
    """
    Maps UniProt ACC to UniProt ID. Retrieves sequence from UniProt and adds it to the node as a feature

    :param n: Graph node.
    :type n: str
    :param d: Graph attribute dictionary.
    :type d: Dict[str, Any]
    """
    h = HGNC(verbose=False)
    u = UniProt(verbose=False)

    d["uniprot_ids"] = h.fetch(
        "symbol", d["protein_id"])["response"]["docs"][0]["uniprot_ids"]

    # Todo these API calls should probably be batched
    # Todo mapping with bioservices to support other protein IDs?

    for id in d["uniprot_ids"]:
        d[f"sequence_{id}"] = u.get_fasta_sequence(id)