Use flowcell model information to estimate how long it will take to run the flowcell.
[htsworkflow.git] / htsworkflow / frontend / experiments / experiments.py
index 9493765dcb02cf31528c295be5dd5bd5389165cf..fef68ed130526e33400302db57de772d82b81ade 100644 (file)
@@ -308,16 +308,11 @@ def estimateFlowcellDuration(flowcell):
     Attempt to estimate how long it will take to run a flowcell
 
     """
-    # (3600 seconds * 1.5 hours per cycle )
-    sequencing_seconds_per_cycle= 3600 * 1.5
-    # 800 is a rough guess
-    pipeline_seconds_per_cycle = 800
-
     cycles = flowcell.read_length
     if flowcell.paired_end:
         cycles *= 2
-    sequencing_time = timedelta(0, cycles * sequencing_seconds_per_cycle)
-    analysis_time = timedelta(0, cycles * pipeline_seconds_per_cycle)
+    sequencing_time = timedelta(0, cycles * flowcell.flowcell_model.per_cycle_time)
+    analysis_time = timedelta(0, flowcell.flowcell_model.fixed_time)
     estimate_mid = sequencing_time + analysis_time
 
     return estimate_mid