Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
New DP service
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Yorgo EL MOUBAYED
New DP service
Commits
1ad7ceb8
Commit
1ad7ceb8
authored
3 years ago
by
root
Browse files
Options
Downloads
Patches
Plain Diff
Update API
parent
42b73546
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dataproc/api/views/__pycache__/proc_input_view.cpython-38.pyc
+0
-0
0 additions, 0 deletions
...proc/api/views/__pycache__/proc_input_view.cpython-38.pyc
dataproc/api/views/proc_input_view.py
+131
-19
131 additions, 19 deletions
dataproc/api/views/proc_input_view.py
with
131 additions
and
19 deletions
dataproc/api/views/__pycache__/proc_input_view.cpython-38.pyc
+
0
−
0
View file @
1ad7ceb8
No preview for this file type
This diff is collapsed.
Click to expand it.
dataproc/api/views/proc_input_view.py
+
131
−
19
View file @
1ad7ceb8
...
...
@@ -18,6 +18,9 @@ from api.models.post_refinement_cycles_model import PostRefinementCycles
from
api.models.ligand_model
import
Ligand
from
api.models.ligand_statistics_model
import
LigandStatistics
from
api.models.ligand_solutions_model
import
LigandSolutions
from
api.models.reference_model
import
Reference
from
api.models.structurefactors_model
import
StructureFactors
from
api.models.mtzfile_model
import
MTZ
# Activate logger
logger
=
logging
.
getLogger
(
'
dataproc
'
)
...
...
@@ -31,23 +34,24 @@ def storeProcInput(request):
if
request
.
method
==
'
POST
'
:
json_data
=
json
.
loads
(
request
.
body
)
json_data_report
=
json_data
[
'
GPhL_pipedream
'
]
json_data_ligand
=
json_data
[
'
ligandfitting
'
][
'
ligands
'
][
'
1
'
]
json_data_rc
=
json_data
[
'
refinement
'
][
'
Cycles
'
]
json_data_prc
=
json_data
[
'
ligandfitting
'
][
'
ligands
'
][
'
1
'
][
'
postrefinement
'
][
'
cycles
'
]
json_data_solutions
=
json_data
[
'
ligandfitting
'
][
'
ligands
'
][
'
1
'
][
'
solutions
'
]
json_data_statistics
=
json_data
[
'
ligandfitting
'
][
'
ligands
'
][
'
1
'
][
'
validationstatistics
'
][
'
ligandstatistics
'
]
logger
.
info
(
json_data_statistics
)
logger
.
info
(
json_data_solutions
)
# json_data_report=json_data['GPhL_pipedream']
# json_data_ligand=json_data['ligandfitting']['ligands']['1']
# json_data_rc=json_data['refinement']['Cycles']
# json_data_prc=json_data['ligandfitting']['ligands']['1']['postrefinement']['cycles']
# json_data_solutions=json_data['ligandfitting']['ligands']['1']['solutions']
# json_data_statistics=json_data['ligandfitting']['ligands']['1']['validationstatistics']['ligandstatistics']
json_data_reference
=
json_data
[
'
dataprocessing
'
][
'
referencedata
'
][
'
cell
'
]
# json_data_mtz=json_data['dataprocessing']
try
:
report
=
storeParseReport
(
json_data_report
)
ligand
=
storeParseLigand
(
json_data_ligand
,
report
)
storeParseRC
(
json_data_rc
,
report
)
storeParsePRC
(
json_data_prc
,
ligand
)
storeParseLigandSolutions
(
json_data_solutions
,
ligand
)
storeParseLigandStatistics
(
json_data_statistics
,
ligand
)
# report=storeParseReport(json_data_report)
# ligand=storeParseLigand(json_data_ligand, report)
# storeParseRC(json_data_rc, report)
# storeParsePRC(json_data_prc, ligand)
# storeParseLigandSolutions(json_data_solutions, ligand)
# storeParseLigandStatistics(json_data_statistics, ligand)
structurefactors
=
storeParseStructureFactors
(
json_data_reference
)
# storeParseMTZ(json_data_mtz, structurefactors)
return
JsonResponse
({
"
STATUS
"
:
"
INPUT SUCCESSFULLY REGISTERED
"
})
...
...
@@ -68,12 +72,8 @@ def storeParseReport(data):
# autoprocscalingstatistics=data['dataprocessing']['processingdata']['AutoProcScalingStatistics']
# autoproc=data['dataprocessing']['processingdata']['AutoProc']
# referencedata=data['dataprocessing']['referencedata']
# postrefinement=data['ligandfitting']['ligands']['1']['postrefinement']['cycles']['2']
# molprobity=data['ligandfitting']['ligands']['1']['validationstatistics']['molprobity']
# IF TEST
report
=
Report
(
command
=
data
[
'
command
'
],
jsonversion
=
data
[
'
jsonversion
'
],
runby
=
data
[
'
runby
'
],
...
...
@@ -237,6 +237,89 @@ def storeParseReport(data):
print
(
sys
.
exc_info
()[
0
])
return
({
"
STATUS
"
:
"
ERROR OCCURRED WHILE REGISTERING REPORT
"
})
@csrf_exempt
def
storeParseStructureFactors
(
data
):
"""
Creates nodes for
"""
try
:
structurefactors
=
StructureFactors
(
# uuid=data['uuid'],
# datatype=data['datatype'],
# processingtype=data['processingtype'],
gamma
=
data
[
'
gamma
'
],
a
=
data
[
'
a
'
],
alpha
=
data
[
'
alpha
'
],
b
=
data
[
'
a
'
],
beta
=
data
[
'
b
'
],
c
=
data
[
'
c
'
])
# rsf_source=data['rsf_source'],
# rsf_filesize=data['rsf_filesize'],
# rsf_filepath=data['rsf_filepath'])
structurefactors
.
save
()
# structurefactors2=structurefactors.save()
# structurefactors2=structurefactors.serialize
# connectStructureFactorsRef(structurefactors2['structurefactors_node_properties']['uuid'], ref['ref_node_properties']['uuid'])
return
({
"
STATUS
"
:
"
STRUCTURE FACTORS REGISTERED
"
})
except
:
print
(
sys
.
exc_info
()[
0
])
return
({
"
STATUS
"
:
"
ERROR OCCURRED WHILE REGISTERING RC
"
})
# @csrf_exempt
# def storeParseReferenceData(data, ref):
# """
# Creates nodes for
# """
# try:
# structurefactors=StructureFactors(uuid=data['uuid'],
# datatype=data['datatype'],
# processingtype=data['processingtype'],
# gamma=data['gamma'],
# a=data['a'],
# alpha=data['alpha'],
# b=data['a'],
# beta=data['b'],
# c=data['c'],
# rsf_source=data['rsf_source'],
# rsf_filesize=data['rsf_filesize'],
# rsf_filepath=data['rsf_filepath'])
# structurefactors.save()
# structurefactors2=structurefactors.serialize
# connectStructureFactorsRef(structurefactors2['structurefactors_node_properties']['uuid'], ref['ref_node_properties']['uuid'])
# return ({"STATUS": "REF DATA REGISTERED"})
# except:
# print(sys.exc_info()[0])
# return ({"STATUS": "ERROR OCCURRED WHILE REGISTERING RC"})
@csrf_exempt
def
storeParseMTZ
(
data
,
structurefactors
):
"""
Creates nodes for
"""
try
:
mtz
=
MTZ
(
datatype
=
data
[
'
datatype
'
])
mtz
.
save
()
mtz2
=
mtz
.
serialize
# connectStructureFactorsMTZ(structurefactors['structurefactors_node_properties']['uuid'], mtz2['mtz_node_properties']['uuid'])
return
({
"
STATUS
"
:
"
MTZ DATATYPE REGISTERED
"
})
except
:
print
(
sys
.
exc_info
()[
0
])
return
({
"
STATUS
"
:
"
ERROR OCCURRED WHILE REGISTERING RC
"
})
@csrf_exempt
def
storeParseRC
(
data
,
report
):
...
...
@@ -450,3 +533,32 @@ def connectLigandPRC(data1, data2):
except
:
return
JsonResponse
({
"
STATUS
"
:
"
ERROR OCCURRED WHILE CONNECTING LIGAND TO PRCs
"
},
safe
=
False
)
@csrf_exempt
def
connectStructureFactorsRef
(
data1
,
data2
):
"""
Create a relationship between a SF (Structure factors) and Reference node.
"""
try
:
structurefactors
=
StructureFactors
.
nodes
.
get
(
uuid
=
data1
)
ref
=
Reference
.
nodes
.
get
(
uuid
=
data2
)
return
JsonResponse
({
"
STATUS
"
:
structurefactors
.
labelled
.
connect
(
ref
)},
safe
=
False
)
except
:
return
JsonResponse
({
"
STATUS
"
:
"
ERROR OCCURRED WHILE CONNECTING STRUCTURE FACTORS TO REFERENCE
"
},
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
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment