Skip to content

Commit

Permalink
chore(call): log allele determining time for slow loci
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlougheed committed Feb 13, 2024
1 parent c68314d commit fc0b38c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion strkit/call/call_locus.py
Original file line number Diff line number Diff line change
Expand Up @@ -1153,6 +1153,8 @@ def call_locus(
have_rare_realigns = True
break

allele_start_time = datetime.now()

if params.use_hp:
top_ps = phase_sets.most_common(1)
if (haplotagged_reads_count >= min_hp_read_coverage and len(haplotags) == n_alleles and top_ps and
Expand Down Expand Up @@ -1261,6 +1263,8 @@ def call_locus(
debug_str=locus_log_str,
) or {} # Still false-y

allele_time = (datetime.now() - allele_start_time).total_seconds()

# Extract data from call_data --------------------------------------------------------------------------------------

call = call_data.get("call")
Expand Down Expand Up @@ -1358,7 +1362,8 @@ def call_locus(
if call_time > CALL_WARN_TIME:
logger_.warning(
f"{locus_log_str} - locus total call time exceeded {CALL_WARN_TIME}s; {n_reads_in_dict} reads took "
f"{call_time}s ({motif_size=}, {motif=}, {call=}, {assign_method=} | {assign_time=}s)")
f"{call_time}s ({motif_size=}, {motif=}, {call=}, {assign_method=} | {allele_time=:.4f}s, "
f"{assign_time=:.4f}s)")

# Compile the call into a dictionary with all information to return ------------------------------------------------

Expand Down

0 comments on commit fc0b38c

Please sign in to comment.