Skip to content

Commit

Permalink
added pre-qc-failed status filter
Browse files Browse the repository at this point in the history
  • Loading branch information
KateSakharova committed Dec 17, 2024
1 parent fc4fbd3 commit 4dea336
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion analyses/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ class AnalysisStates(str, Enum):
ANALYSIS_COMPLETED = "analysis_completed"
ANALYSIS_BLOCKED = "analysis_blocked"
ANALYSIS_FAILED = "analysis_failed"
ANALYSIS_QC_FAILED = "analysis_qc_failed"
ANALYSIS_PRE_QC_FAILED = "analysis_pre_qc_failed"
ANALYSIS_POST_SANITY_CHECK_FAILED = "analysis_post_sanity_check_failed"

@classmethod
Expand All @@ -514,6 +514,7 @@ def default_status(cls):
cls.ANALYSIS_COMPLETED: False,
cls.ANALYSIS_BLOCKED: False,
cls.ANALYSIS_FAILED: False,
cls.ANALYSIS_PRE_QC_FAILED: False,
}

status = models.JSONField(
Expand Down
3 changes: 2 additions & 1 deletion workflows/flows/analysis_amplicon_study.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def get_analyses_to_attempt(
**{
f"status__{analyses.models.Analysis.AnalysisStates.ANALYSIS_COMPLETED}": False,
f"status__{analyses.models.Analysis.AnalysisStates.ANALYSIS_BLOCKED}": False,
f"status__{analyses.models.Analysis.AnalysisStates.ANALYSIS_PRE_QC_FAILED}": False,
}
)
.filter(experiment_type=for_experiment_type)
Expand Down Expand Up @@ -546,7 +547,7 @@ def set_post_analysis_states(amplicon_current_outdir: Path, amplicon_analyses: L
if analysis.run.first_accession in qc_failed_runs:
task_mark_analysis_status(
analysis,
status=analyses.models.Analysis.AnalysisStates.ANALYSIS_FAILED,
status=analyses.models.Analysis.AnalysisStates.ANALYSIS_PRE_QC_FAILED,
reason=qc_failed_runs[analysis.run.first_accession],
)
elif analysis.run.first_accession in qc_completed_runs:
Expand Down
1 change: 1 addition & 0 deletions workflows/flows/assemble_study.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ def get_assemblies_to_attempt(study: analyses.models.Study) -> List[Union[str, i
**{
f"status__{analyses.models.Assembly.AssemblyStates.ASSEMBLY_COMPLETED}": False,
f"status__{analyses.models.Assembly.AssemblyStates.ASSEMBLY_BLOCKED}": False,
f"status__{analyses.models.Assembly.AssemblyStates.PRE_ASSEMBLY_QC_FAILED}": False,
}
).values_list("id", flat=True)
return assemblies_worth_trying
Expand Down
2 changes: 1 addition & 1 deletion workflows/tests/test_analysis_amplicon_study_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ async def test_prefect_analyse_amplicon_flow(
# check failed runs
assert (
await analyses.models.Analysis.objects.filter(
status__analysis_failed=True
status__analysis_pre_qc_failed=True
).acount()
== 1
)
Expand Down

0 comments on commit 4dea336

Please sign in to comment.