Skip to content
Snippets Groups Projects
Commit 0a398c57 authored by Yorgo EL MOUBAYED's avatar Yorgo EL MOUBAYED
Browse files

Update repository

parent 77d42d1c
No related merge requests found
Showing
with 0 additions and 372 deletions
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'newapi.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
) from exc
execute_from_command_line(sys.argv)
if __name__ == '__main__':
main()
File deleted
File deleted
File deleted
File deleted
from django.contrib import admin
# Register your models here.
from django.apps import AppConfig
class MynewapiConfig(AppConfig):
name = 'mynewapi'
from django.db import models, StatisticalReport
from neomodel import StructuredNode, StringProperty, IntegerProperty,UniqueIdProperty, RelationshipTo, DateTimeProperty, BooleanProperty
class Report(StructuredNode):
report_path=StringProperty()
report_source=StringProperty()
report_size=StringProperty()
# Relationships
is_statisticalreport=RelationshipTo(StatisticalReport, 'IS')
\ No newline at end of file
from django.db import models, report, DPStep, MTZfile, ScalepackFile, Reference, Construct
from neomodel import StructuredNode, StringProperty, IntegerProperty,UniqueIdProperty, RelationshipTo, DateTimeProperty, BooleanProperty
class RefelctionStructureFactors(StructuredNode):
rsf_source=StringProperty()
rsf_filesize=StringProperty()
rsf_filepath=StringProperty()
# Relationships
input_as_ref=RelationshipTo(DPStep, 'INPUT_AS_REFERENCE')
input_of=RelationshipTo(DPStep, 'INPUT')
generates_mtz=RelationshipTo(MTZfile, 'GENERATES')
generates_scalepack=RelationshipTo(ScalepackFile, 'GENERATES')
labelled=RelationshipTo(Reference, 'LABELLED')
belongs=RelationshipTo(Construct, 'BELONGS')
\ No newline at end of file
from django.db import models
from neomodel import StructuredNode, StringProperty, IntegerProperty,UniqueIdProperty, RelationshipTo, DateTimeProperty, BooleanProperty
# class City(StructuredNode):
# code = StringProperty(unique_index=True, required=True)
# name = StringProperty(index=True, default="city")
#####################################
# Nodes and properties of the model #
#####################################
class LigandsFitting(StructuredNode):
uid=UniqueIdProperty()
dp_step_name = StringProperty()
created_at=DateTimeProperty()
updated_at=DateTimeProperty()
pipedream_id=IntegerProperty()
score=IntegerProperty()
fitting_success=BooleanProperty()
class Refinement(StructuredNode):
uid=UniqueIdProperty()
dp_step_name=StringProperty()
created_at=DateTimeProperty()
updated_at=DateTimeProperty()
class PostRefinement(StructuredNode):
uid=UniqueIdProperty()
dp_step_name=StringProperty()
pipedream_id=IntegerProperty()
created_at=DateTimeProperty()
updated_at=DateTimeProperty()
class ReductionScaling(StructuredNode):
uid=UniqueIdProperty()
dp_step_name=StringProperty()
created_at=DateTimeProperty()
updated_at=DateTimeProperty()
class autoPROC(StructuredNode):
uid=UniqueIdProperty()
tool_name=StringProperty()
class Buster(StructuredNode):
uid=UniqueIdProperty()
tool_name=StringProperty()
class Rhofit(StructuredNode):
uid=UniqueIdProperty()
tool_name=StringProperty()
class StatisticalReport(StructuredNode):
uid=UniqueIdProperty()
report_name=StringProperty()
class ComputingHost(StructuredNode):
ch_softwares=StringProperty()
ch_softwares_number=IntegerProperty()
class StorageHost(StructuredNode):
sh_files=StringProperty()
sh_files_number=IntegerProperty()
##########################################################################
class Report(StructuredNode):
report_path=StringProperty()
report_source=StringProperty()
report_size=StringProperty()
# Relationships
is_statisticalreport=RelationshipTo(StatisticalReport, 'IS')
class RefelctionStructureFactors(StructuredNode):
rsf_source=StringProperty()
rsf_filesize=StringProperty()
rsf_filepath=StringProperty()
# Relationships
input_as_ref=RelationshipTo(DPStep, 'INPUT_AS_REFERENCE')
input_of=RelationshipTo(DPStep, 'INPUT')
generates_mtz=RelationshipTo(MTZfile, 'GENERATES')
generates_scalepack=RelationshipTo(ScalepackFile, 'GENERATES')
labelled=RelationshipTo(Reference, 'LABELLED')
belongs=RelationshipTo(Construct, 'BELONGS')
class DPStep(StructuredNode):
# Relationships
is_fitting=RelationshipTo(LigandsFitting, 'IS')
is_refinement=RelationshipTo(Refinement, 'IS')
is_postrefinement=RelationshipTo(PostRefinement, 'IS')
is_reductionscaling=RelationshipTo(ReductionScaling, 'IS')
with_tool_1=RelationshipTo(autoPROC, 'WITH')
with_tool_2=RelationshipTo(Rhofit, 'WITH')
with_tool_3=RelationshipTo(Buster, 'WITH')
genereates_report=RelationshipTo(Report, 'GENERATES')
# generates_coordinates=RelationshipTo(Coordinates, 'GENERATES')
generates_rsf=RelationshipTo(RefelctionStructureFactors, 'GENERATES')
class Coordinates(StructuredNode):
coordinates_source=StringProperty(unique_index=True, required=True)
coordinates_filesize=StringProperty(unique_index=True, required=True)
coordinates_filepath=StringProperty(unique_index=True, required=True)
# Relationships
input_as_ref=RelationshipTo(DPStep, 'INPUT_AS_REFERENCE')
input_of=RelationshipTo(DPStep, 'INPUT')
has_pdb=RelationshipTo(PDBFile, 'HAS')
has_mmcif=RelationshipTo(mmCIFFile, 'HAS')
belongs=RelationshipTo(Construct, 'BELONGS')
labelled=RelationshipTo(Reference, 'LABELLED')
class DataCollection (StructuredNode):
collection_type=StringProperty()
collection_size=StringProperty()
# Relationships
genereates_dataset=RelationshipTo(Datatset, 'GENERATES')
class Datatset(StructuredNode):
dataset_file_no=IntegerProperty()
dataset_size=StringProperty()
# Relationships
input_of=RelationshipTo(DPStep, 'INPUT')
stored=RelationshipTo(StorageHost, 'STORED')
belongs=RelationshipTo(Construct, 'BELONGS')
class mmCIFFile(StructuredNode):
uid=UniqueIdProperty()
coordinates_filetype=StringProperty(unique_index=True, required=True)
class PDBFile(StructuredNode):
uid=UniqueIdProperty()
coordinates_filetype=StringProperty(unique_index=True, required=True)
class MTZfile(StructuredNode):
uid=UniqueIdProperty()
rsf_filetype = StringProperty(unique_index=True, required=True)
class ScalepackFile(StructuredNode):
uid=UniqueIdProperty()
rsf_filetype = StringProperty(unique_index=True, required=True)
class Reference(StructuredNode):
uid=UniqueIdProperty()
class OCF(StructuredNode):
# Relationships
has_rsf=RelationshipTo(RefelctionStructureFactors, 'HAS')
has_coordinates=RelationshipTo(Coordinates, 'HAS')
class Construct(StructuredNode):
# Relationships
has_ocf=RelationshipTo(OCF, 'HAS')
has_storage_host=RelationshipTo(StorageHost, 'HAS')
has_computing_host=RelationshipTo(ComputingHost, 'HAS')
class Ligand(StructuredNode):
# Relationships
associated=RelationshipTo(Datatset, 'ASSOCIATED')
from django.test import TestCase
# Create your tests here.
from django.shortcuts import render
# Create your views here.
File deleted
File deleted
File deleted
"""
ASGI config for newapi project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'newapi.settings')
application = get_asgi_application()
"""
Django settings for newapi project.
Generated by 'django-admin startproject' using Django 3.1.6.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""
from pathlib import Path
import os
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '=013nqbp3o8hr9e*it$b1um^%ke*uxqvt5qnp=xe6@^20a)d!b'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'mynewapi.apps.MynewapiConfig',
'django_neomodel'
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
ROOT_URLCONF = 'newapi.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
WSGI_APPLICATION = 'newapi.wsgi.application'
# Database
# https://docs.djangoproject.com/en/3.1/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
}
}
NEOMODEL_NEO4J_BOLT_URL = os.environ.get('NEO4J_BOLT_URL','bolt://neo4j:neo4@localhost:7687')
# Password validation
# https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]
# Internationalization
# https://docs.djangoproject.com/en/3.1/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/3.1/howto/static-files/
STATIC_URL = '/static/'
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