Commit df71e26b authored by Sreenath Sasidharan Nair's avatar Sreenath Sasidharan Nair

Merge branch 'production_ready' into 'master'

PDBE-4126: Fixed issue with duplicate chain labels

See merge request pdbe-kb/services/pdbe-graph-api!389
parents 1c467d87 5ba61ea1
......@@ -506,10 +506,12 @@ def get_funpdbe_annotation_for_entry(entry_id):
# sample entry: 1a08
query = """
MATCH (entry:Entry {ID:$entry_id})<-[:FUNPDBE_DATA_RELATED_TO]-(funpdbe_entry:FunPDBeEntry)<-[:FUNPDBE_RESIDUE_GROUP_OF]-(funpdbe_group:FunPDBeResidueGroup)-[residue_rel:FUNPDBE_ANNOTATION_FOR]->(pdb_res)-[chain_rel:IS_IN_CHAIN]->(chain:Chain)<-[:CONTAINS_CHAIN]-(entity:Entity), (funpdbe_entry)-[:HAS_EVIDENCE_CODE]->(evidence_code:EvidenceCodeOntology)
RETURN funpdbe_entry.DATA_RESOURCE, funpdbe_entry.RELEASE_DATE, funpdbe_entry.RESOURCE_ENTRY_URL, COLLECT(evidence_code.ECO_CODE), funpdbe_group.LABEL, funpdbe_group.ORDINAL_ID, entity.ID, chain.AUTH_ASYM_ID, pdb_res.ID, chain_rel.AUTH_SEQ_ID, pdb_res.CHEM_COMP_ID, chain_rel.PDB_INS_CODE, residue_rel.RAW_SCORE, residue_rel.CONFIDENCE_SCORE, residue_rel.CONFIDENCE_CLASSIFICATION ORDER BY toInteger(entity.ID), chain.AUTH_ASYM_ID, toInteger(pdb_res.ID)
MATCH (entry:Entry {ID:$entry_id})<-[:FUNPDBE_DATA_RELATED_TO]-(funpdbe_entry:FunPDBeEntry)<-[:FUNPDBE_RESIDUE_GROUP_OF]-(funpdbe_group:FunPDBeResidueGroup)-[residue_rel:FUNPDBE_ANNOTATION_FOR]->(pdb_res:PDBResidue)-[chain_rel:IS_IN_CHAIN]->(chain:Chain)<-[:CONTAINS_CHAIN]-(entity:Entity),
(funpdbe_entry)-[:HAS_EVIDENCE_CODE]->(evidence_code:EvidenceCodeOntology)
WHERE chain.AUTH_ASYM_ID=residue_rel.CHAIN_LABEL
RETURN funpdbe_entry.DATA_RESOURCE, funpdbe_entry.RELEASE_DATE, funpdbe_entry.RESOURCE_ENTRY_URL, COLLECT(evidence_code.ECO_CODE), funpdbe_group.LABEL, funpdbe_group.ORDINAL_ID, entity.ID, chain.AUTH_ASYM_ID, pdb_res.ID, chain_rel.AUTH_SEQ_ID, pdb_res.CHEM_COMP_ID, chain_rel.PDB_INS_CODE, residue_rel.RAW_SCORE, residue_rel.CONFIDENCE_SCORE, residue_rel.CONFIDENCE_CLASSIFICATION
ORDER BY toInteger(entity.ID), chain.AUTH_ASYM_ID, toInteger(pdb_res.ID)
"""
mappings = list(graph.run(query, parameters={
'entry_id': str(entry_id)
}))
......@@ -552,8 +554,8 @@ def get_funpdbe_annotation_for_entry(entry_id):
"author_residue_number": "" if auth_seq_id is None else int(auth_seq_id),
"chem_comp_id": chem_comp_id,
"author_insertion_code": "" if pdb_ins_code is None else pdb_ins_code,
"raw_score": float(raw_score),
"confidence_score": float(conf_score),
"raw_score": None if not raw_score else float(raw_score),
"confidence_score": None if not conf_score else float(conf_score),
"confidence_classification": conf_class
})
......@@ -612,8 +614,11 @@ def get_specific_funpdbe_annotation_for_entry(origin, entry_id):
# """
query = """
MATCH (entry:Entry {ID:$entry_id})<-[:FUNPDBE_DATA_RELATED_TO]-(funpdbe_entry:FunPDBeEntry {DATA_RESOURCE:$origin})<-[:FUNPDBE_RESIDUE_GROUP_OF]-(funpdbe_group:FunPDBeResidueGroup)-[residue_rel:FUNPDBE_ANNOTATION_FOR]->(pdb_res)-[chain_rel:IS_IN_CHAIN]->(chain:Chain)<-[:CONTAINS_CHAIN]-(entity:Entity), (funpdbe_entry)-[:HAS_EVIDENCE_CODE]->(evidence_code:EvidenceCodeOntology)
RETURN funpdbe_entry.DATA_RESOURCE, funpdbe_entry.RELEASE_DATE, funpdbe_entry.RESOURCE_ENTRY_URL, COLLECT(evidence_code.ECO_CODE), funpdbe_group.LABEL, funpdbe_group.ORDINAL_ID, entity.ID, chain.AUTH_ASYM_ID, pdb_res.ID, chain_rel.AUTH_SEQ_ID, pdb_res.CHEM_COMP_ID, chain_rel.PDB_INS_CODE, residue_rel.RAW_SCORE, residue_rel.CONFIDENCE_SCORE, residue_rel.CONFIDENCE_CLASSIFICATION ORDER BY toInteger(entity.ID), chain.AUTH_ASYM_ID, toInteger(pdb_res.ID)
MATCH (entry:Entry {ID:$entry_id})<-[:FUNPDBE_DATA_RELATED_TO]-(funpdbe_entry:FunPDBeEntry {DATA_RESOURCE:$origin})<-[:FUNPDBE_RESIDUE_GROUP_OF]-(funpdbe_group:FunPDBeResidueGroup)-[residue_rel:FUNPDBE_ANNOTATION_FOR]->(pdb_res)-[chain_rel:IS_IN_CHAIN]->(chain:Chain)<-[:CONTAINS_CHAIN]-(entity:Entity),
(funpdbe_entry)-[:HAS_EVIDENCE_CODE]->(evidence_code:EvidenceCodeOntology)
WHERE chain.AUTH_ASYM_ID=residue_rel.CHAIN_LABEL
RETURN funpdbe_entry.DATA_RESOURCE, funpdbe_entry.RELEASE_DATE, funpdbe_entry.RESOURCE_ENTRY_URL, COLLECT(evidence_code.ECO_CODE), funpdbe_group.LABEL, funpdbe_group.ORDINAL_ID, entity.ID, chain.AUTH_ASYM_ID, pdb_res.ID, chain_rel.AUTH_SEQ_ID, pdb_res.CHEM_COMP_ID, chain_rel.PDB_INS_CODE, residue_rel.RAW_SCORE, residue_rel.CONFIDENCE_SCORE, residue_rel.CONFIDENCE_CLASSIFICATION
ORDER BY toInteger(entity.ID), chain.AUTH_ASYM_ID, toInteger(pdb_res.ID)
"""
mappings = list(graph.run(query, parameters={
......@@ -658,8 +663,8 @@ def get_specific_funpdbe_annotation_for_entry(origin, entry_id):
"author_residue_number": "" if auth_seq_id is None else int(auth_seq_id),
"chem_comp_id": chem_comp_id,
"author_insertion_code": "" if pdb_ins_code is None else pdb_ins_code,
"raw_score": float(raw_score),
"confidence_score": float(conf_score),
"raw_score": None if not raw_score else float(raw_score),
"confidence_score": None if not conf_score else float(conf_score),
"confidence_classification": conf_class
})
......
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