Skip to content

Commit

Permalink
exception logging
Browse files Browse the repository at this point in the history
mr-eyes committed Oct 27, 2024
1 parent d2b38f0 commit 0372a6b
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/snipe/api/multisig_reference_QC.py
Original file line number Diff line number Diff line change
@@ -623,7 +623,8 @@ def sort_chromosomes(chrom_dict):
# calculate the CV for the whole sample
if autosomal_chr_to_mean_abundance:
mean_abundances = np.array(list(autosomal_chr_to_mean_abundance.values()), dtype=np.float64)
cv = np.std(mean_abundances) / np.mean(mean_abundances) if np.mean(mean_abundances) > 0 and not np.isnan(np.mean(mean_abundances)) else 0.0
mean = np.mean(mean_abundances)
cv = np.std(mean_abundances) / mean if mean > 0 and not np.isnan(mean) else 0.0
chrs_stats.update({"Autosomal k-mer mean abundance CV": cv})
self.logger.debug("Calculated Autosomal CV: %f", cv)
else:
3 changes: 2 additions & 1 deletion src/snipe/cli/cli_ops.py
Original file line number Diff line number Diff line change
@@ -1118,6 +1118,7 @@ def detect_delimiter(file_path):
result = future.result()
results.append(result)
except Exception as e:
logger.exception(f"Processing of experiment '{exp_name}' failed with an exception.")
results.append({
'exp_name': exp_name,
'merged_signatures': [os.path.basename(p) for p in experiment_mapping[exp_name]],
@@ -1178,7 +1179,7 @@ def detect_delimiter(file_path):
for r in results:
total_skipped += len(r.get('skipped_signatures', []))

click.echo(f"\nGuided Merge Summary:")
click.echo("\nGuided Merge Summary:")
click.echo(f"\t- Total experiments processed: {total_experiments}")
click.echo(f"\t- Successful experiments: {successful_experiments}")
click.echo(f"\t- Failed experiments: {failed_experiments}")

0 comments on commit 0372a6b

Please sign in to comment.