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
aa61a9c7
Commit
aa61a9c7
authored
2 years ago
by
AndiMajore
Browse files
Options
Downloads
Patches
Plain Diff
added max tissue expression route
parent
0d289152
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
docker-compose-prod.yml
+1
-1
1 addition, 1 deletion
docker-compose-prod.yml
drugstone/urls.py
+3
-1
3 additions, 1 deletion
drugstone/urls.py
drugstone/views.py
+8
-1
8 additions, 1 deletion
drugstone/views.py
with
12 additions
and
3 deletions
docker-compose-prod.yml
+
1
−
1
View file @
aa61a9c7
...
...
@@ -33,7 +33,7 @@ services:
labels
:
-
"
com.centurylinklabs.watchtower.enable=true"
db
:
image
:
postgres
image
:
postgres
:14
container_name
:
drugstone_postgres
restart
:
always
hostname
:
drugstone_postgres
...
...
This diff is collapsed.
Click to expand it.
drugstone/urls.py
+
3
−
1
View file @
aa61a9c7
...
...
@@ -18,7 +18,8 @@ from django.urls import path
from
drugstone.views
import
map_nodes
,
tasks_view
,
result_view
,
\
graph_export
,
TissueView
,
TissueExpressionView
,
query_tissue_proteins
,
TaskView
,
\
adjacent_drugs
,
adjacent_disorders
,
fetch_edges
,
create_network
,
load_network
,
get_license
,
get_datasets
adjacent_drugs
,
adjacent_disorders
,
fetch_edges
,
create_network
,
load_network
,
get_license
,
get_datasets
,
\
get_max_tissue_expression
# cache time is 6 hours
urlpatterns
=
[
...
...
@@ -33,6 +34,7 @@ urlpatterns = [
path
(
'
adjacent_drugs/
'
,
adjacent_drugs
),
path
(
'
adjacent_disorders/
'
,
adjacent_disorders
),
path
(
'
tissue_expression/
'
,
TissueExpressionView
.
as_view
()),
path
(
'
tissue_max_expression/
'
,
get_max_tissue_expression
()),
path
(
'
tissues/
'
,
TissueView
.
as_view
()),
path
(
'
admin/
'
,
admin
.
site
.
urls
),
path
(
'
create_network
'
,
create_network
),
...
...
This diff is collapsed.
Click to expand it.
drugstone/views.py
+
8
−
1
View file @
aa61a9c7
...
...
@@ -10,7 +10,7 @@ import pandas as pd
import
networkx
as
nx
from
django.http
import
HttpResponse
from
django.db.models
import
Q
from
django.db.models
import
Q
,
Max
from
django.db
import
IntegrityError
from
rest_framework.decorators
import
api_view
from
rest_framework.response
import
Response
...
...
@@ -626,6 +626,12 @@ def query_proteins(request) -> Response:
})
@api_view
([
'
GET
'
])
def
get_max_tissue_expression
(
request
)
->
Response
:
tissue
=
Tissue
.
objects
.
get
(
id
=
request
.
query_params
.
get
(
'
tissue
'
))
return
Response
({
max
:
ExpressionLevel
.
objects
.
filter
(
tissue
=
tissue
).
aggregate
(
Max
(
'
expression_level
'
))})
@api_view
([
'
POST
'
])
def
query_tissue_proteins
(
request
)
->
Response
:
threshold
=
request
.
data
[
'
threshold
'
]
...
...
@@ -646,6 +652,7 @@ class TissueView(APIView):
return
Response
(
TissueSerializer
(
many
=
True
).
to_representation
(
tissues
))
class
TissueExpressionView
(
APIView
):
"""
Expression of host proteins in tissues.
...
...
This diff is collapsed.
Click to expand it.
Maier, Andreas
@bba1660
mentioned in commit
5bc5f5ea
·
1 year ago
mentioned in commit
5bc5f5ea
mentioned in commit 5bc5f5ea04e6b12bcf4f838c916cd6f4e150617f
Toggle commit list
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