Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
backend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Cosy-Bio
Drugst.One
backend
Commits
8568dbb2
Commit
8568dbb2
authored
2 years ago
by
AndiMajore
Browse files
Options
Downloads
Patches
Plain Diff
updated open nedrex_v2 api route; circumvented nedrex version issue
Former-commit-id:
a0ef822c
parent
5ddc2aa0
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
drugstone/management/commands/populate_db.py
+7
-7
7 additions, 7 deletions
drugstone/management/commands/populate_db.py
drugstone/management/includes/DatasetLoader.py
+4
-2
4 additions, 2 deletions
drugstone/management/includes/DatasetLoader.py
with
11 additions
and
9 deletions
drugstone/management/commands/populate_db.py
+
7
−
7
View file @
8568dbb2
...
@@ -86,8 +86,8 @@ class Command(BaseCommand):
...
@@ -86,8 +86,8 @@ class Command(BaseCommand):
def
populate
(
kwargs
):
def
populate
(
kwargs
):
nedrex_api_url_
unlicenced
=
"
https://nedrex
-api-open.zbh.uni-hamburg.de/
"
nedrex_api_url_
open
=
"
https://
api.
nedrex
.net/open
"
nedrex_api_url_licenced
=
"
https://nedrex-api-licenced.zbh.uni-hamburg.de/
"
nedrex_api_url_licenced
=
"
https://nedrex-api-licenced.zbh.uni-hamburg.de/
licensed
"
data_dir
=
kwargs
[
'
data_dir
'
]
data_dir
=
kwargs
[
'
data_dir
'
]
...
@@ -102,7 +102,7 @@ def populate(kwargs):
...
@@ -102,7 +102,7 @@ def populate(kwargs):
cache
=
NodeCache
()
cache
=
NodeCache
()
update
=
True
if
kwargs
[
'
update
'
]
else
False
update
=
True
if
kwargs
[
'
update
'
]
else
False
importer
=
NedrexImporter
(
nedrex_api_url_licenced
,
nedrex_api_url_
unlicenced
,
cache
)
importer
=
NedrexImporter
(
nedrex_api_url_licenced
,
nedrex_api_url_
open
,
cache
)
populator
=
DataPopulator
(
cache
)
populator
=
DataPopulator
(
cache
)
total_n
=
0
total_n
=
0
...
@@ -152,7 +152,7 @@ def populate(kwargs):
...
@@ -152,7 +152,7 @@ def populate(kwargs):
if
kwargs
[
'
protein_drug
'
]:
if
kwargs
[
'
protein_drug
'
]:
print
(
'
Importing PDIs from unlicenced NeDRexDB...
'
)
print
(
'
Importing PDIs from unlicenced NeDRexDB...
'
)
n
=
NedrexImporter
.
import_drug_target_interactions
(
importer
,
n
=
NedrexImporter
.
import_drug_target_interactions
(
importer
,
DatasetLoader
.
get_drug_target_nedrex
(
nedrex_api_url_
unlicenced
,
False
),
DatasetLoader
.
get_drug_target_nedrex
(
nedrex_api_url_
open
,
False
),
update
)
update
)
total_n
+=
n
total_n
+=
n
print
(
f
'
Imported
{
n
}
PDIs from unlicenced NeDRexDB
'
)
print
(
f
'
Imported
{
n
}
PDIs from unlicenced NeDRexDB
'
)
...
@@ -179,7 +179,7 @@ def populate(kwargs):
...
@@ -179,7 +179,7 @@ def populate(kwargs):
print
(
'
Importing PDis from unlicenced NeDRexDB...
'
)
print
(
'
Importing PDis from unlicenced NeDRexDB...
'
)
n
=
NedrexImporter
.
import_protein_disorder_associations
(
importer
,
n
=
NedrexImporter
.
import_protein_disorder_associations
(
importer
,
DatasetLoader
.
get_protein_disorder_nedrex
(
DatasetLoader
.
get_protein_disorder_nedrex
(
nedrex_api_url_
unlicenced
,
False
),
nedrex_api_url_
open
,
False
),
update
)
update
)
total_n
+=
n
total_n
+=
n
print
(
f
'
Imported
{
n
}
PDis from unlicenced NeDRexDB
'
)
print
(
f
'
Imported
{
n
}
PDis from unlicenced NeDRexDB
'
)
...
@@ -196,7 +196,7 @@ def populate(kwargs):
...
@@ -196,7 +196,7 @@ def populate(kwargs):
if
kwargs
[
'
drug_disorder
'
]:
if
kwargs
[
'
drug_disorder
'
]:
print
(
'
Importing DrDis from unlicenced NeDRexDB...
'
)
print
(
'
Importing DrDis from unlicenced NeDRexDB...
'
)
n
=
NedrexImporter
.
import_drug_disorder_indications
(
importer
,
n
=
NedrexImporter
.
import_drug_disorder_indications
(
importer
,
DatasetLoader
.
get_drug_disorder_nedrex
(
nedrex_api_url_
unlicenced
,
False
),
DatasetLoader
.
get_drug_disorder_nedrex
(
nedrex_api_url_
open
,
False
),
update
)
update
)
total_n
+=
n
total_n
+=
n
print
(
f
'
Imported
{
n
}
DrDis from unlicenced NeDRexDB
'
)
print
(
f
'
Imported
{
n
}
DrDis from unlicenced NeDRexDB
'
)
...
@@ -217,7 +217,7 @@ def populate(kwargs):
...
@@ -217,7 +217,7 @@ def populate(kwargs):
if
kwargs
[
'
protein_protein
'
]:
if
kwargs
[
'
protein_protein
'
]:
print
(
'
Importing PPIs from unlicenced NeDRexDB...
'
)
print
(
'
Importing PPIs from unlicenced NeDRexDB...
'
)
n
=
NedrexImporter
.
import_protein_protein_interactions
(
importer
,
n
=
NedrexImporter
.
import_protein_protein_interactions
(
importer
,
DatasetLoader
.
get_ppi_nedrex
(
nedrex_api_url_
unlicenced
,
False
),
DatasetLoader
.
get_ppi_nedrex
(
nedrex_api_url_
open
,
False
),
update
)
update
)
total_n
+=
n
total_n
+=
n
print
(
f
'
Imported
{
n
}
PPIs from unlicended NeDRexDB
'
)
print
(
f
'
Imported
{
n
}
PPIs from unlicended NeDRexDB
'
)
...
...
This diff is collapsed.
Click to expand it.
drugstone/management/includes/DatasetLoader.py
+
4
−
2
View file @
8568dbb2
...
@@ -39,7 +39,9 @@ def get_ppi_biogrid():
...
@@ -39,7 +39,9 @@ def get_ppi_biogrid():
def
get_nedrex_version
():
def
get_nedrex_version
():
version
=
get_today_version
()
version
=
get_today_version
()
try
:
try
:
version
=
get_metadata
()[
'
version
'
]
real_version
=
get_metadata
()[
'
version
'
]
if
real_version
!=
"
0.0.0
"
:
version
=
real_version
except
RetryError
:
except
RetryError
:
pass
pass
return
version
return
version
...
...
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