Commit 958d0831 authored by Sreenath Sasidharan Nair's avatar Sreenath Sasidharan Nair

Merge branch 'production_ready' into 'master'

Production ready

See merge request pdbe-kb/services/pdbe-graph-api!390
parents df71e26b 97b0ec3c
......@@ -13,6 +13,7 @@ import random
import collections
import more_itertools as mit
import config
import ast
from plugins import request_handler
import util_common
......@@ -20,6 +21,7 @@ import neo4j_model
from residue import get_mappings_for_residue_binding_site
from itertools import groupby
from util_common import parse_number
print('[COMPOUND] Starting')
......
......@@ -3207,18 +3207,20 @@ def get_uniprot_variation_api(uniprot_accession):
api_result[uniprot_accession]["features"].append(items)
# PDBE-3712: Get Missense3D variation details
# PDBE-3956: Get FoldX variation details
query = """
MATCH (unp:UniProt {ACCESSION: $uniprot_accession})-[:HAS_UNP_RESIDUE]->(unpRes:UNPResidue)<-[:MAP_TO_UNIPROT_RESIDUE]-(pdbRes:PDBResidue)<-[resRel:FUNPDBE_ANNOTATION_FOR]-(funGroup:FunPDBeResidueGroup)-[:FUNPDBE_RESIDUE_GROUP_OF]->(funEntry:FunPDBeEntry {DATA_RESOURCE:'Missense3D'})
WITH toInteger(unpRes.ID) AS unpRes, pdbRes.CHEM_COMP_ID AS pdbResCode, resRel.AA_VARIANT AS variant, resRel.AA_VARIANT_CAUSES AS causes, SPLIT(funEntry.SQL_ID, '_')[0] AS pdbId, funEntry.RESOURCE_ENTRY_URL AS entryUrl, funGroup.LABEL AS label ORDER BY unpRes
RETURN unpRes, pdbResCode, variant, causes, pdbId, entryUrl, label
MATCH (unp:UniProt {ACCESSION: $uniprot_accession})-[:HAS_UNP_RESIDUE]->(unpRes:UNPResidue)<-[:MAP_TO_UNIPROT_RESIDUE]-(pdbRes:PDBResidue)<-[resRel:FUNPDBE_ANNOTATION_FOR]-(funGroup:FunPDBeResidueGroup)-[:FUNPDBE_RESIDUE_GROUP_OF]->(funEntry:FunPDBeEntry)
WHERE funEntry.DATA_RESOURCE IN ['Missense3D', 'FoldX']
WITH toInteger(unpRes.ID) AS unpRes, pdbRes.CHEM_COMP_ID AS pdbResCode, resRel.AA_VARIANT AS variant, resRel.AA_VARIANT_CAUSES AS causes, SPLIT(funEntry.SQL_ID, '_')[0] AS pdbId, funEntry.RESOURCE_ENTRY_URL AS entryUrl, funGroup.LABEL AS label, funEntry.DATA_RESOURCE AS resource ORDER BY unpRes
RETURN unpRes, pdbResCode, variant, causes, pdbId, entryUrl, label, resource
"""
missense_details = list(graph.run(query, parameters = {
details = list(graph.run(query, parameters = {
"uniprot_accession": uniprot_accession
}))
for row in missense_details:
(unp_res_id, pdb_res_code, variant, variant_causes, pdb_id, entry_url, label) = row
for row in details:
(unp_res_id, pdb_res_code, variant, variant_causes, pdb_id, entry_url, label, resource) = row
result_data = {
"type": "VARIANT",
......@@ -3229,10 +3231,10 @@ def get_uniprot_variation_api(uniprot_accession):
"wildType": get_amino_three_to_one(pdb_res_code),
"polyphenPrediction": "",
"polyphenScore": None,
"clinicalSignificances": "missense",
"clinicalSignificances": "missense" if resource == "Missense3D" else "foldx",
"siftScore": None,
"consequenceType": variant_causes,
"genomicLocation": f"""Missense3D_{pdb_id}_{get_amino_three_to_one(pdb_res_code)}>{get_amino_three_to_one(variant)}""",
"genomicLocation": f"""{resource}_{pdb_id}_{get_amino_three_to_one(pdb_res_code)}>{get_amino_three_to_one(variant)}""",
"sourceType": "prediction",
"category": label,
"resourceUrl": entry_url
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment