Skip to content
Snippets Groups Projects
Commit 13e3db3c authored by AndiMajore's avatar AndiMajore
Browse files

security patch; fixing update issues

Former-commit-id: bc6d68252e9f71e99ffa7c5f9fcbcee9e069eae9 [formerly db4cfd0d69a4a31b86b68901e80c30f6233a189e]
Former-commit-id: 12cb75353e319d4f01f72e209ef395f0cbee3bbc
parent a961801e
No related branches found
No related tags found
No related merge requests found
FROM andimajore/miniconda3_kinetic
FROM andimajore/miniconda3_lunar
WORKDIR /usr/src/drugstone/
......
......@@ -116,10 +116,13 @@ class NedrexImporter:
proteins[id] = models.Protein(uniprot_code=id, protein_name=name, gene=gene)
def add_edges(edge):
try:
id = to_id(edge['sourceDomainId'])
protein = proteins[id]
protein.entrez = to_id(edge['targetDomainId'])
gene_to_prots[protein.entrez].add(id)
except:
print(f'Edge could not be saved: {edge["sourceDomainId"]} - {edge["targetDomainId"]}')
def add_genes(node):
id = to_id(node['primaryDomainId'])
......
......@@ -118,6 +118,7 @@ def populate(kwargs):
total_n = 0
nedrex_update = False
if 'all' in kwargs and kwargs['all']:
kwargs['drugs'] = True
kwargs['disorders'] = True
......
......@@ -22,6 +22,9 @@ class DataPopulator:
bulk = set()
uniq = set()
if update:
uniq = {hash(expr) for expr in models.ExpressionLevel.objects.all()}
size = 0
for _, row in df.iterrows():
gene_name = row['Description']
......
......@@ -3,7 +3,7 @@ from celery.schedules import crontab
CELERY_BEAT_SCHEDULE = {
'update_db': {
'task': 'drugstone.tasks.task_update_db_from_nedrex',
'schedule': crontab(day_of_week=2, hour=3, minute=0),
'schedule': crontab(day_of_week=1, hour=22, minute=0),
# 'schedule': crontab(minute='*/1'),
},
}
......@@ -5,7 +5,7 @@ chardet==3.0.4
click==8.1.3
cryptography==39.0.1
decorator==4.4.2
Django==3.2.17
Django==3.2.18
django-cors-headers==3.4.0
django-redis==4.11.0
django-rq-dashboard==0.3.3
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment