From facf6d932e55f06471d96316fe0d669b6b409041 Mon Sep 17 00:00:00 2001 From: bistline Date: Thu, 29 Aug 2024 11:05:14 -0400 Subject: [PATCH 1/2] Ignore differential expression jobs when computing ingestSummary event --- app/models/delete_queue_job.rb | 1 + app/models/ingest_job.rb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/delete_queue_job.rb b/app/models/delete_queue_job.rb index e3f1eb9dac..3e0b540199 100644 --- a/app/models/delete_queue_job.rb +++ b/app/models/delete_queue_job.rb @@ -88,6 +88,7 @@ def perform delete_user_annotations(study:, study_file: object) delete_parsed_data(object.id, study.id, ClusterGroup, CellMetadatum, Gene, DataArray) delete_fragment_files(study:, study_file: object) + delete_differential_expression_results(study:, study_file: object) # reset default options/counts study.reload study.cell_count = study.all_cells_array.size diff --git a/app/models/ingest_job.rb b/app/models/ingest_job.rb index 57766df5f2..bd1cd2789c 100644 --- a/app/models/ingest_job.rb +++ b/app/models/ingest_job.rb @@ -1010,7 +1010,7 @@ def report_anndata_summary # discard the job that corresponds with this ingest process still_processing = remaining_jobs.reject do |job| ingest_job = DelayedJobAccessor.dump_job_handler(job).object - ingest_job.params_object.associated_file == fragment + ingest_job.params_object.is_a?(AnnDataIngestParameters) && ingest_job.params_object.associated_file == fragment end.any? # only continue if there are no more jobs and a summary has not been sent yet From 71015e444d8b2862128f24797c56922b93854285 Mon Sep 17 00:00:00 2001 From: bistline Date: Thu, 29 Aug 2024 11:17:12 -0400 Subject: [PATCH 2/2] Add AnnData to when clause --- app/models/delete_queue_job.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/delete_queue_job.rb b/app/models/delete_queue_job.rb index 3e0b540199..05116c9a00 100644 --- a/app/models/delete_queue_job.rb +++ b/app/models/delete_queue_job.rb @@ -226,7 +226,7 @@ def delete_differential_expression_results(study:, study_file:) when 'Cluster' cluster = ClusterGroup.find_by(study:, study_file: study_file) results = DifferentialExpressionResult.where(study:, cluster_group: cluster) - when 'Expression Matrix', 'MM Coordinate Matrix' + when 'Expression Matrix', 'MM Coordinate Matrix', 'AnnData' results = DifferentialExpressionResult.where(study:, matrix_file_id: study_file.id) when 'Differential Expression' results = DifferentialExpressionResult.where(study_file: object)