Skip to content
Snippets Groups Projects
Commit 0f835264 authored by Raphael Bourgeas's avatar Raphael Bourgeas
Browse files

merge

parents b5e45961 f342126d
No related branches found
No related tags found
No related merge requests found
This diff is collapsed.
No preview for this file type
No preview for this file type
......@@ -5,29 +5,29 @@ from uuid import uuid4
from neomodel import StructuredNode, StringProperty, IntegerProperty, UniqueIdProperty, RelationshipTo
# Models imports
from api.models.ligandsfitting_model import LigandsFitting
from api.models.refinement_model import Refinement
from api.models.postrefinement_model import PostRefinement
from api.models.reductionscaling_model import ReductionScaling
from api.models.autoPROC_model import autoPROC
from api.models.rhofit_model import Rhofit
from api.models.buster_model import Buster
from api.models.report_model import Report
from api.models.coordinates_model import Coordinates
from api.models.structurefactors_model import StructureFactors
from api.models.pdbfile_model import PDBFile
from api.models.mmciffile_model import mmCIFFile
from api.models.construct_model import Construct
from api.models.reference_model import Reference
from api.models.pipedream_model import GPhLPipedream
from api.models.pipedream_cmd_options_model import PipedreamCmdOptions
from api.models.autoproc_cmd_options_model import AutoprocCmdOptions
from api.models.buster_cmd_options_model import BusterCmdOptions
from api.models.rhofit_cmd_options_model import RhofitCmdOptions
from api.models.started_model import Started
from api.models.completed_model import Completed
from api.models.error_model import Error
from api.models.importation_model import Importation
# from api.models.ligandsfitting_model import LigandsFitting
# from api.models.refinement_model import Refinement
# from api.models.postrefinement_model import PostRefinement
# from api.models.reductionscaling_model import ReductionScaling
# from api.models.autoPROC_model import autoPROC
# from api.models.rhofit_model import Rhofit
# from api.models.buster_model import Buster
# from api.models.report_model import Report
# from api.models.coordinates_model import Coordinates
# # from api.models.structurefactors_model import StructureFactors
# from api.models.pdbfile_model import PDBFile
# from api.models.mmciffile_model import mmCIFFile
# from api.models.construct_model import Construct
# from api.models.reference_model import Reference
# from api.models.pipedream_model import GPhLPipedream
# from api.models.pipedream_cmd_options_model import PipedreamCmdOptions
# from api.models.autoproc_cmd_options_model import AutoprocCmdOptions
# from api.models.buster_cmd_options_model import BusterCmdOptions
# from api.models.rhofit_cmd_options_model import RhofitCmdOptions
# from api.models.started_model import Started
# from api.models.completed_model import Completed
# from api.models.error_model import Error
# from api.models.importation_model import Importation
class DPStep(StructuredNode):
......@@ -41,29 +41,29 @@ class DPStep(StructuredNode):
# name=StringProperty()
# Relationships
is_fitting=RelationshipTo(LigandsFitting, 'IS')
is_refinement=RelationshipTo(Refinement, 'IS')
is_postrefinement=RelationshipTo(PostRefinement, 'IS')
is_reductionscaling=RelationshipTo(ReductionScaling, 'IS')
is_importation=RelationshipTo(Importation, 'IS')
# is_fitting=RelationshipTo(LigandsFitting, 'IS')
# is_refinement=RelationshipTo(Refinement, 'IS')
# is_postrefinement=RelationshipTo(PostRefinement, 'IS')
# is_reductionscaling=RelationshipTo(ReductionScaling, 'IS')
# is_importation=RelationshipTo(Importation, 'IS')
with_autoproc=RelationshipTo(autoPROC, 'WITH')
with_rhofit=RelationshipTo(Rhofit, 'WITH')
with_buster=RelationshipTo(Buster, 'WITH')
with_pipedream=RelationshipTo(GPhLPipedream, 'WITH')
# with_autoproc=RelationshipTo(autoPROC, 'WITH')
# with_rhofit=RelationshipTo(Rhofit, 'WITH')
# with_buster=RelationshipTo(Buster, 'WITH')
# with_pipedream=RelationshipTo(GPhLPipedream, 'WITH')
genereates_report=RelationshipTo(Report, 'GENERATES')
generates_coordinates=RelationshipTo(Coordinates, 'GENERATES')
generates_structurefactors=RelationshipTo(StructureFactors, 'GENERATES')
# genereates_report=RelationshipTo(Report, 'GENERATES')
# generates_coordinates=RelationshipTo(Coordinates, 'GENERATES')
# # generates_structurefactors=RelationshipTo('StructureFactors', 'GENERATES')
has_status_error=RelationshipTo(Error, 'HAS STATUS')
has_status_completed=RelationshipTo(Completed, 'HAS STATUS')
has_status_started=RelationshipTo(Started, 'HAS STATUS')
# has_status_error=RelationshipTo(Error, 'HAS STATUS')
# has_status_completed=RelationshipTo(Completed, 'HAS STATUS')
# has_status_started=RelationshipTo(Started, 'HAS STATUS')
pipedream_cmd_options=RelationshipTo(PipedreamCmdOptions, 'HAS')
autoproc_cmd_options=RelationshipTo(AutoprocCmdOptions, 'HAS')
buster_cmd_options=RelationshipTo(BusterCmdOptions, 'HAS')
rhofit_cmd_options=RelationshipTo(RhofitCmdOptions, 'HAS')
# pipedream_cmd_options=RelationshipTo(PipedreamCmdOptions, 'HAS')
# autoproc_cmd_options=RelationshipTo(AutoprocCmdOptions, 'HAS')
# buster_cmd_options=RelationshipTo(BusterCmdOptions, 'HAS')
# rhofit_cmd_options=RelationshipTo(RhofitCmdOptions, 'HAS')
@property
def serialize(self):
......
......@@ -5,9 +5,9 @@ from uuid import uuid4
from neomodel import StructuredNode, StringProperty, IntegerProperty, UniqueIdProperty, RelationshipTo
# Models imports
# from api.models.dpstep_model import DPStep
from api.models.mtzfile_model import MTZ
from api.models.scalepackfile_model import ScalepackFile
from api.models.dpstep_model import DPStep
# from api.models.mtzfile_model import MTZ
# from api.models.scalepackfile_model import ScalepackFile
from api.models.reference_model import Reference
# from api.models.construct_model import Construct
......@@ -20,24 +20,20 @@ class StructureFactors(StructuredNode):
# Properties
uuid=StringProperty(unique_index=True, default=uuid4)
# processingtype=StringProperty()
gamma=StringProperty()
a=StringProperty()
alpha=StringProperty()
b=StringProperty()
beta=StringProperty()
c=StringProperty()
# rsf_source=StringProperty()
# rsf_filesize=StringProperty()
# rsf_filepath=StringProperty()
symmetry=StringProperty()
# Relationships
is_scalepack=RelationshipTo('ScalepackFile', 'IS')
is_mtz=RelationshipTo('MTZfile', 'IS')
labelled_ref=RelationshipTo('Reference', 'LABELLED_AS')
# is_scalepack=RelationshipTo('ScalepackFile', 'IS')
# is_mtz=RelationshipTo('MTZfile', 'IS')
labelled_ref=RelationshipTo(Reference, 'LABELLED_AS')
# input_as_ref=RelationshipTo('DPStep', 'INPUT_AS_REFERENCE')
# input_of=RelationshipTo('DPStep', 'INPUT')
input_of=RelationshipTo('DPStep', 'INPUT')
# belongs=RelationshipTo('Construct', 'BELONGS')
@property
......@@ -50,16 +46,13 @@ class StructureFactors(StructuredNode):
return {
'structurefactors_node_properties': {
'uuid': self.uuid,
# 'rsf_source': self.rsf_source,
# 'rsf_filesize': self.rsf_filesize,
# 'rsf_filepath': self.rsf_filepath,
# 'datatype': self.datatype,
# 'processingtype': self.processingtype,
'gamma': self.gamma,
'a': self.a,
'b': self.b,
'beta': self.beta,
'c': self.c,
'symmetry': self.symmetry,
'alpha': self.alpha,
},
}
......@@ -61,7 +61,6 @@ def storeProcInput(request):
# structurefactors=storeParseStructureFactors(json_data_reference)
# storeParseStructureFactors(json_data_reference)
# storeParseMTZ(json_data_mtz, structurefactors)
return JsonResponse({"STATUS": "INPUT SUCCESSFULLY REGISTERED"})
......@@ -218,66 +217,65 @@ def storeParseReport(data):
return ({"STATUS": "ERROR OCCURRED WHILE REGISTERING REPORT"})
@csrf_exempt
def storeParseStructureFactors(data):
def storeParseReference():
"""
Creates nodes for
Creates nodes for reference label
"""
logger.info('ENTER FUNCTION')
try:
# structurefactors=StructureFactors(
# # uuid=data['uuid'],
# # datatype=data['datatype'],
# # processingtype=data['processingtype'],
# gamma=data['gamma'],
# a=data['a'],
# alpha=data['alpha'],
# b=data['b'],
# beta=data['beta'],
# c=data['c'])
# # rsf_source=data['rsf_source'],
# # rsf_filesize=data['rsf_filesize'],
# # rsf_filepath=data['rsf_filepath'])
reference=Reference()
reference.save()
reference2=reference.serialize
return reference2
structurefactors=StructureFactors(
gamma=data['gamma'],
a=data['a'],
alpha=data['alpha'],
b=data['b'],
beta=data['beta'],
c=data['c'])
except:
return ({"STATUS": "ERROR OCCURRED WHILE REGISTERING REFERENCE LABEL NODE"})
logger.info(structurefactors)
@csrf_exempt
def storeParseStructureFactors(data, reference):
"""
Creates nodes for Structure factors with relative properties
"""
try:
structurefactors=StructureFactors(
gamma=data['cell']['gamma'],
a=data['cell']['a'],
alpha=data['cell']['alpha'],
b=data['cell']['b'],
beta=data['cell']['beta'],
c=data['cell']['c'],
symmetry=data['symmetry'])
structurefactors.save()
# structurefactors2=structurefactors.serialize
# structurefactors2=structurefactors.serialize
# connectStructureFactorsRef(structurefactors2['structurefactors_node_properties']['uuid'], ref['ref_node_properties']['uuid'])
logger.info('SAVE DATA')
return structurefactors.serialize
structurefactors2=structurefactors.serialize
connectStructureFactorsRef(structurefactors2['structurefactors_node_properties']['uuid'], reference['ref_node_properties']['uuid'])
return ({"STATUS": "STRUCTURE FACTORS REGISTERED"})
except:
return ({"STATUS": "ERROR OCCURRED WHILE REGISTERING RC"})
# @csrf_exempt
# def storeParseMTZ(data, structurefactors):
# """
# Creates nodes for
# """
# try:
# mtz=MTZ(datatype=data['datatype'])
# mtz.save()
@csrf_exempt
def storeParseDPStep():
# mtz2=mtz.serialize
# # connectStructureFactorsMTZ(structurefactors['structurefactors_node_properties']['uuid'], mtz2['mtz_node_properties']['uuid'])
"""
Creates nodes for dpstep label
"""
# return ({"STATUS": "MTZ DATATYPE REGISTERED"})
try:
dpstep=DPStep()
dpstep.save()
dpstep2=dpstep.serialize
return dpstep2
# except:
# return ({"STATUS": "ERROR OCCURRED WHILE REGISTERING RC"})
except:
return ({"STATUS": "ERROR OCCURRED WHILE REGISTERING DPSTEP LABEL NODE"})
@csrf_exempt
def storeParseRC(data, report):
......@@ -513,17 +511,24 @@ def connectStructureFactorsRef(data1, data2):
"""
Create a relationship between a SF (Structure factors) and Reference node.
"""
logger.info('ENTER FUNCTION')
try:
logger.info('TRY FUNCTION')
structurefactors=StructureFactors.nodes.get(uuid=data1)
ref=Reference.nodes.get(uuid=data2)
return JsonResponse({"STATUS": structurefactors.labelled.connect(ref)}, safe=False)
logger.info(structurefactors)
logger.info(ref)
return JsonResponse({"STATUS": structurefactors.labelled_ref.connect(ref)}, safe=False)
except:
return JsonResponse({"STATUS": "ERROR OCCURRED WHILE CONNECTING STRUCTURE FACTORS TO REFERENCE"}, safe=False)
@csrf_exempt
def connectStructureFactorsMTZ(data1, data2):
def connectStructureFactorsDPStep(data1, data2):
"""
Create a relationship between a SF (Structure factors) and MTZ node.
......@@ -531,8 +536,23 @@ def connectStructureFactorsMTZ(data1, data2):
try:
structurefactors=StructureFactors.nodes.get(uuid=data1)
mtz=MTZ.nodes.get(uuid=data2)
return JsonResponse({"STATUS": structurefactors.is_mtz.connect(mtz)}, safe=False)
dpstep=DPStep.nodes.get(uuid=data2)
return JsonResponse({"STATUS": structurefactors.input_of.connect(dpstep)}, safe=False)
except:
return JsonResponse({"STATUS": "ERROR OCCURRED WHILE CONNECTING STRUCTURE FACTORS TO MTZ"}, safe=False)
return JsonResponse({"STATUS": "ERROR OCCURRED WHILE CONNECTING STRUCTURE FACTORS TO DPSTEP"}, safe=False)
# @csrf_exempt
# def connectStructureFactorsMTZ(data1, data2):
# """
# Create a relationship between a SF (Structure factors) and MTZ node.
# """
# try:
# structurefactors=StructureFactors.nodes.get(uuid=data1)
# mtz=MTZ.nodes.get(uuid=data2)
# return JsonResponse({"STATUS": structurefactors.is_mtz.connect(mtz)}, safe=False)
# except:
# return JsonResponse({"STATUS": "ERROR OCCURRED WHILE CONNECTING STRUCTURE FACTORS TO MTZ"}, safe=False)
asgiref==3.2.10
Django==3.0.8
django-neomodel==0.0.4
neo4j-driver==1.7.2
neobolt==1.7.17
neomodel==3.3.2
neotime==1.7.4
pytz==2020.1
six==1.15.0
sqlparse==0.3.1
djangorestframework==3.12.2
asgiref==3.2.10
Django==3.0.8
django-neomodel==0.0.4
neo4j-driver==4.3.1
neomodel==4.0.4
neotime==1.7.4
pytz==2021.1
six==1.16
sqlparse==0.3.1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment