Skip to content

Commit 6a2ce3c

Browse files
committed
Merge branch 'v5.0.0'
2 parents 744ee57 + 1ae52a1 commit 6a2ce3c

135 files changed

Lines changed: 3339 additions & 919 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

DEPLOYING.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ The following are the steps to perform a deployment in production. In case you w
4545
- `CGDS_CHUNK_SIZE`: size **in bytes** of the chunk in which the files of a CGDS study are downloaded, the bigger it is, the faster the download is, but the more server memory it consumes. Default `2097152`, i.e. 2MB.
4646
- `THRESHOLD_ORDINAL`: number of different values for the GEM (CNA) information to be considered ordinal, if the number is <= to this value then it is considered categorical/ordinal and a boxplot is displayed, otherwise, it is considered continuous and the common correlation graph is displayed. Default `5`.
4747
- `THRESHOLD_GEM_SIZE_TO_COLLECT`: GEM file size threshold (in MB) for the GEM dataset to be available in memory. This has a HUGE impact on the performance of the analysis. If the size is less than or equal to this threshold, it is allocated in memory, otherwise, it will be read lazily from the disk. If None GGCA automatically allocates in memory when the GEM dataset size is small (<= 100MB). Therefore, if you want to force to always use RAM to improve performance you should set a very high threshold, on the contrary, if you want a minimum memory usage at the cost of poor performance, set it to `0`. Default `None`.
48+
- `MIN_PASSWORD_LEN`: Defines the minimum required length for user passwords when updating their profile. If the provided password is shorter than this length, the update will be rejected. Default `8`.
4849
- PostgreSQL:
4950
- `POSTGRES_USERNAME`: PostgreSQL connection username. **Must be equal to** `POSTGRES_USER`.
5051
- `POSTGRES_PASSWORD`: PostgreSQL connection password. **Must be equal to** `POSTGRES_PASSWORD`.
@@ -179,7 +180,7 @@ To integrate with [Modulector][modulector] and/or [BioAPI][bioapi] using `docker
179180
name: 'multiomix-network'
180181
```
181182
3. The new versions of BioAPI and Modulector already come with service names suitable for integration with Multiomix. But **if you have any old version of those platforms**, change the Modulector and BioAPI configuration so that it does not conflict with the Multiomix configuration:
182-
1. Rename all the services in the Modulector and BioAPI `docker-compose.yml` files with the suffix `_modulector` and `_bioapi`. And rename `web` service to `modulector` or `bioapi` respectively. **NOTE:** do not forget to rename the `depends_on` parameters, and the database connection parameters to point to the new services names.
183+
1. Rename all the services in the Modulector and BioAPI `docker-compose.yml` files with the suffix `_modulector` and `_bioapi`. For example `mongo_bioapi`, `web_bioapi` and `nginx_bioapi` in the case of BioAPI. **NOTE:** do not forget to rename the `depends_on` parameters, and the database connection parameters to point to the new services names.
183184
2. Change the following block in the NGINX configuration files. In Modulector it's `config/nginx/conf.d/modulector.conf`, in BioAPI it's `/nginx/conf.d/default.conf`:
184185
```
185186
# Old
@@ -191,7 +192,7 @@ To integrate with [Modulector][modulector] and/or [BioAPI][bioapi] using `docker
191192
# New
192193
upstream web {
193194
ip_hash;
194-
server modulector:8000; # Or bioapi, dependening on which config file you're
195+
server web_modulector:8000; # Or web_bioapi, dependening on which config file you're editing
195196
}
196197
```
197198
4. Set Multiomix parameters:

docker-compose_dist.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ services:
6060

6161
# Celery worker for correlation analysis
6262
correlation-analysis-worker:
63-
image: omicsdatascience/multiomix:5.4.0-celery
63+
image: omicsdatascience/multiomix:5.5.0-celery
6464
restart: 'always'
6565
depends_on:
6666
- db
@@ -77,7 +77,7 @@ services:
7777

7878
# Celery worker for feature selection experiments
7979
fs-experiments-worker:
80-
image: omicsdatascience/multiomix:5.4.0-celery
80+
image: omicsdatascience/multiomix:5.5.0-celery
8181
restart: 'always'
8282
depends_on:
8383
- db
@@ -94,7 +94,7 @@ services:
9494

9595
# Celery worker for statistical validations and trained models
9696
stats-worker:
97-
image: omicsdatascience/multiomix:5.4.0-celery
97+
image: omicsdatascience/multiomix:5.5.0-celery
9898
restart: 'always'
9999
depends_on:
100100
- db
@@ -111,7 +111,7 @@ services:
111111

112112
# Celery worker for inference experiments
113113
inference-worker:
114-
image: omicsdatascience/multiomix:5.4.0-celery
114+
image: omicsdatascience/multiomix:5.5.0-celery
115115
restart: 'always'
116116
depends_on:
117117
- db
@@ -128,7 +128,7 @@ services:
128128

129129
# Celery worker for sync CGDSStudies
130130
sync-datasets-worker:
131-
image: omicsdatascience/multiomix:5.4.0-celery
131+
image: omicsdatascience/multiomix:5.5.0-celery
132132
restart: 'always'
133133
depends_on:
134134
- db
@@ -145,7 +145,7 @@ services:
145145

146146
# Django Backend Server
147147
multiomix:
148-
image: omicsdatascience/multiomix:5.4.0
148+
image: omicsdatascience/multiomix:5.5.0
149149
restart: 'always'
150150
# environment:
151151
# DJANGO_SETTINGS_MODULE: 'multiomics_intermediate.settings_prod'
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Generated by Django 4.2.15 on 2024-10-23 13:51
2+
3+
from django.conf import settings
4+
from django.db import migrations, models
5+
6+
7+
class Migration(migrations.Migration):
8+
9+
dependencies = [
10+
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
11+
('api_service', '0060_experiment_shared_users'),
12+
]
13+
14+
operations = [
15+
migrations.AlterField(
16+
model_name='experiment',
17+
name='shared_users',
18+
field=models.ManyToManyField(blank=True, related_name='shared_users_correlation_analysis', to=settings.AUTH_USER_MODEL),
19+
),
20+
]

src/api_service/mrna_service.py

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,28 @@ class MRNAService(object):
1313

1414
def __init__(self):
1515
modulector_settings = settings.MODULECTOR_SETTINGS
16-
self.url_modulector_prefix = f"http://{modulector_settings['host']}:{modulector_settings['port']}"
16+
self.url_modulector_prefix = self.__build_url(modulector_settings)
1717

1818
bioapi_settings = settings.BIOAPI_SETTINGS
19-
self.url_bioapi_prefix = f"http://{bioapi_settings['host']}:{bioapi_settings['port']}"
19+
self.url_bioapi_prefix = self.__build_url(bioapi_settings)
20+
21+
@staticmethod
22+
def __build_url(settings: Dict[str, Any]) -> str:
23+
"""
24+
Constructs the URL based on the settings provided.
25+
If the port is the default for the protocol (80 for http, 443 for https), it is omitted.
26+
Otherwise, the port is included in the URL.
27+
@param settings: Dictionary containing protocol, host, and port information.
28+
@return: Constructed URL as a string.
29+
"""
30+
protocol = settings['protocol']
31+
host = settings['host']
32+
port = settings['port']
33+
34+
if (protocol == 'http' and port == 80) or (protocol == 'https' and port == 443):
35+
return f"{protocol}://{host}"
36+
else:
37+
return f"{protocol}://{host}:{port}"
2038

2139
@staticmethod
2240
def __generate_rest_query_params(get_request: QueryDict) -> str:

src/api_service/serializers.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from .models import Experiment, ExperimentSource, GeneGEMCombination, GeneMiRNACombination, GeneCNACombination, \
66
GeneMethylationCombination, ExperimentClinicalSource
77
from rest_framework import serializers
8-
8+
from django.contrib.auth import get_user_model
99

1010
class GeneGEMCombinationSerializer(serializers.ModelSerializer):
1111
"""GeneGEMCombination serializer"""
@@ -58,11 +58,17 @@ class Meta:
5858
model = ExperimentSource
5959
fields = '__all__'
6060

61+
class LimitedUserSerializer(serializers.ModelSerializer):
62+
"""A lightweight serializer for User model"""
63+
class Meta:
64+
model = get_user_model()
65+
fields = ['id', 'username']
6166

6267
class ExperimentSerializer(serializers.ModelSerializer):
6368
"""Experiment serializer"""
6469
mRNA_source = ExperimentSourceSerializer()
6570
gem_source = ExperimentSourceSerializer()
71+
user = LimitedUserSerializer()
6672
tag = TagSerializer()
6773

6874
class Meta:
@@ -83,7 +89,9 @@ class Meta:
8389
'p_values_adjustment_method',
8490
'type',
8591
'tag',
86-
'clinical_source_id'
92+
'clinical_source_id',
93+
'is_public',
94+
'user'
8795
]
8896

8997

src/api_service/urls.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,5 +71,19 @@
7171
name='survival_data'),
7272
path('mirna-data', views.mirna_data_action, name='mirna_data'),
7373
path('methylation-data', views.methylation_data_action, name='methylation_data'),
74-
path('stop-experiment', views.stop_experiment_action, name='stop_experiment')
74+
path('stop-experiment', views.stop_experiment_action, name='stop_experiment'),
75+
path('non-institutions', views.InstitutionNonExperimentsSharedListView.as_view(), name='institution-non-experiments-list'),
76+
path('non-institutions/<int:experiment_id>/', views.InstitutionNonExperimentsSharedListView.as_view()),
77+
path('non-users', views.UsersNonExperimentsSharedListView.as_view(), name='user-non-experiments-list'),
78+
path('non-users/<int:experiment_id>/', views.UsersNonExperimentsSharedListView.as_view()),
79+
path('share-experiment-to-institution', views.AddInstitutionToExperimentView.as_view(), name='share-experiment-to-institution'),
80+
path('share-experiment-to-user', views.AddUserToExperimentView.as_view(), name='share-experiment-to-user'),
81+
path('shared-institution', views.UsersExperimentsSharedListView.as_view(), name='shared-institution'),
82+
path('shared-users/<int:experiment_id>/', views.UsersExperimentsSharedListView.as_view(), ),
83+
path('shared-users', views.InstitutionExperimentsSharedListView.as_view(), name='shared-users'),
84+
path('shared-institution/<int:experiment_id>/', views.InstitutionExperimentsSharedListView.as_view(), ),
85+
path('switch-institution-public-view', views.ToggleExperimentPublicView.as_view(), name='switch-experiment-public-view'),
86+
path('remove-institution', views.RemoveInstitutionFromExperimentView.as_view(), name='remove-institution'),
87+
path('remove-user', views.RemoveUserFromExperimentView.as_view(), name='remove-user')
88+
7589
]

0 commit comments

Comments
 (0)