Skip to content

Commit 7da3659

Browse files
authored
Merge branch 'dev' into resource-allocation-colormap
2 parents fbe01a2 + 08ce025 commit 7da3659

File tree

21 files changed

+521
-171
lines changed

21 files changed

+521
-171
lines changed

CHANGELOG.md

+13-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Qiita changelog
22

3+
Version 2025.01
4+
---------------
5+
6+
Deployed on January 15th, 2025
7+
8+
* The Analysis owner is now displayed in the analysis list and the individual analysis page.
9+
* Admins can now use the per-preparation "Download Data Release" button to get a "BIOM" release; this version is focus on NPH data releases.
10+
* Improved complete_job creation time, which should result in Qiita jobs ([multiple steps](https://qiita.ucsd.edu/static/doc/html/dev/resource_allocation.html) finishing faster; for bencharks visit [patch 93.sql](https://github.com/qiita-spots/qiita/blob/master/qiita_db/support_files/patches/93.sql).
11+
* SPP improvements: TellSeq support added; plugin refactored to allow for easier additions like TellSeq in the future. Job restart greatly improved. Much improved handling of sample-names and ids that contain substrings like ‘I1’ and ‘R2’. New SequenceCount job can count sequences and base-pairs in parallel for any list of fastq files.
12+
* Other general fixes [#3440](https://github.com/qiita-spots/qiita/pull/3440), [#3445](https://github.com/qiita-spots/qiita/pull/3445), [#3446](https://github.com/qiita-spots/qiita/pull/3446),
13+
14+
315
Version 2024.10
416
---------------
517

@@ -206,7 +218,7 @@ Version 2021.11
206218
* Allow chucked download of metadata files in analyses; this allows to process large meta-analysis (like those for The Microsetta Initiative) without worker blockage.
207219
* Added to the qp-qiime2 plugin the possibility of filtering tables based on system available "FeatureData[Sequence]"; to start we added 90/100/150 bps bloom tables.
208220
* Now we can instantiate a study via their title (Study.from_title); this will facilitate orchestration with qebil.
209-
* Speed up Study listing for admins and general users; the admin study display came down from 20 to 2 seconds.
221+
* Speed up Study listing for admins and general users; the admin study display came down from 20 to 2 seconds.
210222
* Fixed the following issues: [3142](https://github.com/qiita-spots/qiita/issues/3142), [3149](https://github.com/qiita-spots/qiita/issues/3149), [3150](https://github.com/qiita-spots/qiita/issues/3150), [3119](https://github.com/qiita-spots/qiita/issues/3119), and [3160](https://github.com/qiita-spots/qiita/issues/3160).
211223

212224

qiita_core/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
# The full license is in the file LICENSE, distributed with this software.
77
# -----------------------------------------------------------------------------
88

9-
__version__ = "2024.10"
9+
__version__ = "2025.01"

qiita_db/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
from . import user
2828
from . import processing_job
2929

30-
__version__ = "2024.10"
30+
__version__ = "2025.01"
3131

3232
__all__ = ["analysis", "artifact", "archive", "base", "commands",
3333
"environment_manager", "exceptions", "investigation", "logger",

qiita_db/archive.py

+17-2
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ def get_merging_scheme_from_job(cls, job):
116116
acmd = job.command
117117
parent = job.input_artifacts[0]
118118
parent_pparameters = parent.processing_parameters
119+
phms = None
119120
if parent_pparameters is None:
120121
parent_cmd_name = None
121122
parent_parameters = None
@@ -125,12 +126,26 @@ def get_merging_scheme_from_job(cls, job):
125126
parent_cmd_name = pcmd.name
126127
parent_parameters = parent_pparameters.values
127128
parent_merging_scheme = pcmd.merging_scheme
128-
129-
return qdb.util.human_merging_scheme(
129+
if not parent_merging_scheme['ignore_parent_command']:
130+
gp = parent.parents[0]
131+
gp_params = gp.processing_parameters
132+
if gp_params is not None:
133+
gp_cmd = gp_params.command
134+
phms = qdb.util.human_merging_scheme(
135+
parent_cmd_name, parent_merging_scheme,
136+
gp_cmd.name, gp_cmd.merging_scheme,
137+
parent_parameters, [], gp_params.values)
138+
139+
hms = qdb.util.human_merging_scheme(
130140
acmd.name, acmd.merging_scheme,
131141
parent_cmd_name, parent_merging_scheme,
132142
job.parameters.values, [], parent_parameters)
133143

144+
if phms is not None:
145+
hms = qdb.util.merge_overlapping_strings(hms, phms)
146+
147+
return hms
148+
134149
@classmethod
135150
def retrieve_feature_values(cls, archive_merging_scheme=None,
136151
features=None):

qiita_db/metadata_template/prep_template.py

+13-3
Original file line numberDiff line numberDiff line change
@@ -808,14 +808,24 @@ def _get_node_info(workflow, node):
808808

809809
parent_cmd_name = None
810810
parent_merging_scheme = None
811+
phms = None
811812
if pcmd is not None:
812813
parent_cmd_name = pcmd.name
813814
parent_merging_scheme = pcmd.merging_scheme
815+
if not parent_merging_scheme['ignore_parent_command']:
816+
phms = _get_node_info(workflow, parent)
814817

815-
return qdb.util.human_merging_scheme(
818+
hms = qdb.util.human_merging_scheme(
816819
ccmd.name, ccmd.merging_scheme, parent_cmd_name,
817820
parent_merging_scheme, cparams, [], pparams)
818821

822+
# if the parent should not ignore its parent command, then we need
823+
# to merge the previous result with the new one
824+
if phms is not None:
825+
hms = qdb.util.merge_overlapping_strings(hms, phms)
826+
827+
return hms
828+
819829
def _get_predecessors(workflow, node):
820830
# recursive method to get predecessors of a given node
821831
pred = []
@@ -871,7 +881,7 @@ def _get_predecessors(workflow, node):
871881
'artifact transformation']
872882
merging_schemes = {
873883
qdb.archive.Archive.get_merging_scheme_from_job(j): {
874-
x: y.id for x, y in j.outputs.items()}
884+
x: str(y.id) for x, y in j.outputs.items()}
875885
# we are going to select only the jobs that were a 'success', that
876886
# are not 'hidden' and that have an output - jobs that are not
877887
# hidden and a successs but that do not have outputs are jobs which
@@ -989,7 +999,7 @@ def _get_predecessors(workflow, node):
989999
init_artifacts = {
9901000
wkartifact_type: f'{starting_job.id}:'}
9911001
else:
992-
init_artifacts = {wkartifact_type: self.artifact.id}
1002+
init_artifacts = {wkartifact_type: str(self.artifact.id)}
9931003

9941004
cmds_to_create.reverse()
9951005
current_job = None

qiita_db/support_files/patches/94.sql

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ CREATE TABLE qiita.resource_allocation_column_names (
2424
INSERT INTO qiita.resource_allocation_column_names(col_name) VALUES
2525
('samples'), ('columns'), ('input_size'),
2626
('samples*columns'), ('samples*input_size'),
27-
('columns*input_size'), ('samples*columns*input_size');
27+
('columns*input_size'), ('samples*columns*input_size');
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
INSERT INTO qiita.allocation_equations(equation_name, expression)
2+
VALUES
3+
('mem_model1', '(k * (np.log(x))) + (x * a) + b'),
4+
('mem_model2', '(k * (np.log(x))) + (b * ((np.log(x))**2)) + a'),
5+
('mem_model3', '(k * (np.log(x))) + (b * ((np.log(x))**2)) + (a * ((np.np.log(x))**3))'),
6+
('mem_model4', '(k * (np.log(x))) + (b * ((np.log(x))**2)) + (a * ((np.log(x))**2.5))'),
7+
('time_model1', 'a + b + ((np.log(x)) * k)'),
8+
('time_model2', 'a + (b * x) + ((np.log(x)) * k)'),
9+
('time_model3', 'a + (b * ((np.log(x))**2)) + ((np.log(x)) * k)'),
10+
('time_model4', '(a * ((np.log(x))**3)) + (b * ((np.log(x))**2)) + ((np.log(x)) * k)');

qiita_db/test/test_util.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -790,9 +790,11 @@ def test_generate_analysis_list(self):
790790
exp = [{'mapping_files': [
791791
(16, qdb.util.get_filepath_information(16)['fullpath'])],
792792
'description': 'A test analysis', 'artifacts': [8, 9], 'name':
793-
'SomeAnalysis', 'analysis_id': 1, 'visibility': 'private'},
793+
'SomeAnalysis', 'owner': '[email protected]', 'analysis_id': 1,
794+
'visibility': 'private'},
794795
{'mapping_files': [], 'description': 'Another test analysis',
795796
'artifacts': [], 'name': 'SomeSecondAnalysis',
797+
'owner': '[email protected]',
796798
'analysis_id': 2, 'visibility': 'private'}]
797799
# removing timestamp for testing
798800
for i in range(len(obs)):

qiita_db/util.py

+26-4
Original file line numberDiff line numberDiff line change
@@ -2076,7 +2076,7 @@ def generate_analysis_list(analysis_ids, public_only=False):
20762076
return []
20772077

20782078
sql = """
2079-
SELECT analysis_id, a.name, a.description, a.timestamp,
2079+
SELECT analysis_id, a.name, a.description, a.timestamp, a.email,
20802080
array_agg(DISTINCT artifact_id),
20812081
array_agg(DISTINCT visibility),
20822082
array_agg(DISTINCT CASE WHEN filepath_type = 'plain_text'
@@ -2097,7 +2097,8 @@ def generate_analysis_list(analysis_ids, public_only=False):
20972097

20982098
qdb.sql_connection.TRN.add(sql, [tuple(analysis_ids)])
20992099
for row in qdb.sql_connection.TRN.execute_fetchindex():
2100-
aid, name, description, ts, artifacts, av, mapping_files = row
2100+
aid, name, description, ts, owner, artifacts, \
2101+
av, mapping_files = row
21012102

21022103
av = 'public' if set(av) == {'public'} else 'private'
21032104
if av != 'public' and public_only:
@@ -2118,7 +2119,7 @@ def generate_analysis_list(analysis_ids, public_only=False):
21182119
results.append({
21192120
'analysis_id': aid, 'name': name, 'description': description,
21202121
'timestamp': ts.strftime("%m/%d/%y %H:%M:%S"),
2121-
'visibility': av, 'artifacts': artifacts,
2122+
'visibility': av, 'artifacts': artifacts, 'owner': owner,
21222123
'mapping_files': mapping_files})
21232124

21242125
return results
@@ -2336,7 +2337,6 @@ def resource_allocation_plot(df, col_name_str, curr_column):
23362337
Column name for the x axis that will be used to build the plots.
23372338
curr_column: pd.Series, requirew
23382339
Pandas Series representing a column with col_name_str.
2339-
23402340
Returns
23412341
----------
23422342
matplotlib.pyplot object
@@ -3008,3 +3008,25 @@ def merge_rows(rows):
30083008
row['node_model']]
30093009
qdb.sql_connection.TRN.add(sql, sql_args=to_insert)
30103010
qdb.sql_connection.TRN.execute()
3011+
3012+
3013+
def merge_overlapping_strings(str1, str2):
3014+
"""Helper function to merge 2 overlapping strings
3015+
3016+
Parameters
3017+
----------
3018+
str1: str
3019+
Initial string
3020+
str2: str
3021+
End string
3022+
3023+
Returns
3024+
----------
3025+
str
3026+
The merged strings
3027+
"""
3028+
overlap = ""
3029+
for i in range(1, min(len(str1), len(str2)) + 1):
3030+
if str1.endswith(str2[:i]):
3031+
overlap = str2[:i]
3032+
return str1 + str2[len(overlap):]

qiita_pet/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
# The full license is in the file LICENSE, distributed with this software.
77
# -----------------------------------------------------------------------------
88

9-
__version__ = "2024.10"
9+
__version__ = "2025.01"

qiita_pet/handlers/analysis_handlers/base_handlers.py

+1
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ def analysis_description_handler_get_request(analysis_id, user):
8585
'analysis_is_public': analysis.is_public,
8686
'analysis_description': analysis.description,
8787
'analysis_mapping_id': analysis.mapping_file,
88+
'analysis_owner': analysis.owner.email,
8889
'alert_type': alert_type,
8990
'artifacts': artifacts,
9091
'analysis_reservation': analysis._slurm_reservation()[0],

qiita_pet/handlers/analysis_handlers/tests/test_base_handlers.py

+3
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ def test_analysis_description_handler_get_request(self):
3838
'analysis_id': 1,
3939
'analysis_description': 'A test analysis',
4040
'analysis_mapping_id': 16,
41+
'analysis_owner': '[email protected]',
4142
'analysis_is_public': False,
4243
'alert_type': 'info',
4344
'artifacts': {
@@ -67,6 +68,7 @@ def test_analysis_description_handler_get_request(self):
6768
'analysis_id': 1,
6869
'analysis_description': 'A test analysis',
6970
'analysis_mapping_id': 16,
71+
'analysis_owner': '[email protected]',
7072
'analysis_is_public': False,
7173
'alert_type': 'info',
7274
'artifacts': {
@@ -98,6 +100,7 @@ def test_analysis_description_handler_get_request(self):
98100
'analysis_id': 1,
99101
'analysis_description': 'A test analysis',
100102
'analysis_mapping_id': 16,
103+
'analysis_owner': '[email protected]',
101104
'analysis_is_public': False,
102105
'alert_type': 'danger',
103106
'artifacts': {

qiita_pet/handlers/api_proxy/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
from .user import (user_jobs_get_req)
3939
from .util import check_access, check_fp
4040

41-
__version__ = "2024.10"
41+
__version__ = "2025.01"
4242

4343
__all__ = ['prep_template_summary_get_req', 'data_types_get_req',
4444
'study_get_req', 'sample_template_filepaths_get_req',

0 commit comments

Comments
 (0)