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

Merge branch 'production_ready' into 'master'

PDBE-4104: Added optional match for tax, experiment and assembly

See merge request pdbe-kb/services/pdbe-graph-api!398
parents 8ab48dff 4940588b
......@@ -558,9 +558,9 @@ def get_best_structures_observed(accession):
query = """
MATCH (unp:UniProt)<-[unp_rel:HAS_UNIPROT_OBS_SEGMENT]-(entity:Entity)<-[:HAS_ENTITY]-(entry:Entry)
WHERE unp.ACCESSION=$accession
MATCH (entry)-[:EXPERIMENT]->(method:Method)
MATCH (unp)-[:HAS_TAXONOMY]->(tax:Taxonomy)
MATCH (entity)-[:IS_PART_OF_ASSEMBLY]->(assembly:Assembly {PREFERED:'True'})
OPTIONAL MATCH (entry)-[:EXPERIMENT]->(method:Method)
OPTIONAL MATCH (unp)-[:HAS_TAXONOMY]->(tax:Taxonomy)
OPTIONAL MATCH (entity)-[:IS_PART_OF_ASSEMBLY]->(assembly:Assembly {PREFERED:'True'})
RETURN toInteger(unp.LENGTH), toInteger(assembly.ID), entry.ID, toInteger(tax.TAX_ID), method.METHOD, toInteger(entity.ID), entry.RESOLUTION, unp_rel.OBSERVED, unp_rel.STRUCT_ASYM_ID, toInteger(unp_rel.UNP_START) AS unp_start, toInteger(unp_rel.UNP_END), toInteger(unp_rel.PDB_START), toInteger(unp_rel.PDB_END)
ORDER BY toInteger(unp_rel.RANKING_SCORES[7]) DESC, unp_start
"""
......@@ -571,9 +571,9 @@ def get_best_structures_observed(accession):
WITH unp, toInteger(rel.UNP_START) AS unpStart, toInteger(rel.UNP_END) AS unpEnd
MATCH (unp)<-[unp_rel:HAS_UNIPROT_OBS_SEGMENT]-(entity:Entity)<-[:HAS_ENTITY]-(entry:Entry)
WHERE toInteger(unp_rel.UNP_START) >= unpStart AND toInteger(unp_rel.UNP_END) <= unpEnd
MATCH (entry)-[:EXPERIMENT]->(method:Method)
MATCH (unp)-[:HAS_TAXONOMY]->(tax:Taxonomy)
MATCH (entity)-[:IS_PART_OF_ASSEMBLY]->(assembly:Assembly {PREFERED:'True'})
OPTIONAL MATCH (entry)-[:EXPERIMENT]->(method:Method)
OPTIONAL MATCH (unp)-[:HAS_TAXONOMY]->(tax:Taxonomy)
OPTIONAL MATCH (entity)-[:IS_PART_OF_ASSEMBLY]->(assembly:Assembly {PREFERED:'True'})
RETURN toInteger(unp.LENGTH), toInteger(assembly.ID), entry.ID, toInteger(tax.TAX_ID), method.METHOD, toInteger(entity.ID), entry.RESOLUTION, unp_rel.OBSERVED, unp_rel.STRUCT_ASYM_ID, toInteger(unp_rel.UNP_START) AS unp_start, toInteger(unp_rel.UNP_END), toInteger(unp_rel.PDB_START), toInteger(unp_rel.PDB_END)
ORDER BY toInteger(unp_rel.RANKING_SCORES[7]) DESC, unp_start
"""
......
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