Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
iPPIDB
ippidb-web
Commits
419d50c0
Commit
419d50c0
authored
Dec 21, 2020
by
Hervé MENAGER
Browse files
Merge branch 'master' into 'release'
prepare for v1.0.5 See merge request
!22
parents
e8aeca08
0c15a78b
Pipeline
#43964
failed with stages
in 11 minutes and 33 seconds
Changes
7
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
ippisite/ippidb/management/commands/create_labslink_files.py
0 → 100644
View file @
419d50c0
# coding: utf-8
from
django.db.models
import
CharField
,
Value
as
V
from
django.db.models.functions
import
Concat
from
django.db.models
import
F
,
Q
,
Case
,
When
from
ippidb.models
import
RefCompoundBiblio
from
biodblinks.lablinks.command
import
LabsLinkCommand
class
Command
(
LabsLinkCommand
):
queryset
=
(
RefCompoundBiblio
.
objects
.
exclude
(
Q
(
bibliography__source
=
"PT"
))
.
annotate
(
resource_title
=
Concat
(
V
(
"iPPI-DB compound #"
),
F
(
"compound__id"
),
output_field
=
CharField
()
)
)
.
annotate
(
resource_url
=
Concat
(
V
(
"https://ippidb.pasteur.fr/compounds/"
),
F
(
"compound__id"
),
output_field
=
CharField
(),
)
)
.
annotate
(
doi
=
Case
(
When
(
Q
(
bibliography__source
=
"DO"
),
then
=
F
(
"bibliography__id_source"
)),
default
=
None
,
output_field
=
CharField
(),
)
)
.
annotate
(
record_id
=
Case
(
When
(
Q
(
bibliography__source
=
"PM"
),
then
=
F
(
"bibliography__id_source"
)),
default
=
None
,
output_field
=
CharField
(),
)
)
.
annotate
(
record_source
=
Case
(
When
(
Q
(
bibliography__source
=
"PM"
),
then
=
V
(
"MED"
)),
default
=
None
,
output_field
=
CharField
(),
)
)
)
ippisite/ippidb/tests/tests.py
View file @
419d50c0
...
...
@@ -3,6 +3,7 @@ iPPI-DB unit tests
"""
import
json
import
re
from
requests.exceptions
import
SSLError
from
django.contrib.auth
import
get_user_model
from
django.core.management
import
call_command
...
...
@@ -768,9 +769,12 @@ class TestConvertSMILESToIUPAC(TestCase):
def
test_valid
(
self
):
smiles_to_iupacs
=
{
"CCC"
:
"propane"
}
for
smiles
,
expected_iupac
in
smiles_to_iupacs
.
items
():
self
.
assertEqual
(
convert_smiles_to_iupac
(
smiles
).
lower
(),
expected_iupac
.
lower
()
)
try
:
self
.
assertEqual
(
convert_smiles_to_iupac
(
smiles
).
lower
(),
expected_iupac
.
lower
()
)
except
SSLError
:
self
.
skipTest
(
"SSL connection issue with the CACTUS WS, skipping"
)
class
DuplicateGeneNameTestCase
(
TestCase
):
...
...
ippisite/ippidb/tests/tests_contribute.py
View file @
419d50c0
"""
iPPI-DB contribution module tests
"""
from
requests.exceptions
import
HTTPError
from
django.contrib.auth
import
get_user_model
from
django.contrib.auth.models
import
Permission
from
django.contrib.contenttypes.models
import
ContentType
...
...
@@ -22,7 +24,10 @@ class BibliographyIDTestCase(TestCase):
b
=
models
.
Bibliography
()
b
.
source
=
"DO"
b
.
id_source
=
"10.1016/j.bmcl.2013.03.013"
b
.
save
(
autofill
=
True
)
try
:
b
.
save
(
autofill
=
True
)
except
HTTPError
:
self
.
skipTest
(
"Connection error, skipping test"
)
class
ContributionViewsAccessTestCase
(
TestCase
):
...
...
ippisite/ippidb/ws.py
View file @
419d50c0
...
...
@@ -536,3 +536,13 @@ def get_ligand_id(smiles: str) -> str:
raise
EntryNotFoundError
(
smiles
,
msg
=
str
(
f
"ligand for smiles
{
smiles
}
not found in PDB Ligand"
)
)
def
get_orcid_user_details
(
orcid
:
str
)
->
str
:
endpoint
=
f
"https://pub.orcid.org/v3.0/
{
orcid
}
/person"
resp
=
requests
.
get
(
endpoint
,
headers
=
{
"Accept"
:
"application/json"
},)
data
=
resp
.
json
()
return
{
"first"
:
data
[
"name"
][
"given-names"
][
"value"
],
"last"
:
data
[
"name"
][
"family-name"
][
"value"
],
}
ippisite/ippisite/settings.py
View file @
419d50c0
...
...
@@ -58,6 +58,7 @@ INSTALLED_APPS = [
# "allauth.socialaccount.providers.github",
"allauth.socialaccount.providers.orcid"
,
"polymorphic"
,
"biodblinks"
,
]
MIDDLEWARE
=
[
...
...
@@ -191,3 +192,10 @@ GALAXY_COMPOUNDPROPERTIES_WORKFLOWID = None
CELERY_RESULT_BACKEND
=
"django-db"
GA_CODE
=
None
# Django BioDbLinks settings
LABLINKS_ID_PREFIX
=
"https://ippidb.pasteur.fr"
LABLINKS_PROVIDER_ID
=
"2079"
LABLINKS_RESOURCE_NAME
=
"iPPI-DB"
LABLINKS_RESOURCE_DESCRIPTION
=
"iPPI-DB : An interactive database of protein-protein interactions modulators"
LABLINKS_CONTACT_EMAIL
=
"ippidb@pasteur.fr"
ippisite/ippisite/settings.template.py
View file @
419d50c0
...
...
@@ -169,3 +169,10 @@ CRISPY_TEMPLATE_PACK = "bootstrap4"
# celery setting.
CELERY_RESULT_BACKEND
=
'django-db'
# Django BioDbLinks settings
LABLINKS_ID_PREFIX
=
"https://ippidb.pasteur.fr"
LABLINKS_PROVIDER_ID
=
"2079"
LABLINKS_RESOURCE_NAME
=
"iPPI-DB"
LABLINKS_RESOURCE_DESCRIPTION
=
"iPPI-DB : An interactive database of protein-protein interactions modulators"
LABLINKS_CONTACT_EMAIL
=
"ippidb@pasteur.fr"
ippisite/requirements-core.txt
View file @
419d50c0
...
...
@@ -30,3 +30,5 @@ django-crispy-forms
celery==4.4.7
django-polymorphic
boltons
# django-biodblinks App
git+https://gitlab.pasteur.fr/hub/django-biodblinks.git#egg=django-biodblinks==0.1
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment