From dfa4d955dddfccf0b958baa3e7edd2563c9cff28 Mon Sep 17 00:00:00 2001 From: wdecoster Date: Thu, 4 Jul 2024 21:54:05 +0200 Subject: [PATCH] change warning when no (phased) reads found --- Cargo.toml | 2 +- src/parse_bam.rs | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 80d873a..ca4de92 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "STRdust" -version = "0.8.5" +version = "0.8.6" edition = "2021" diff --git a/src/parse_bam.rs b/src/parse_bam.rs index ee46999..f558dac 100644 --- a/src/parse_bam.rs +++ b/src/parse_bam.rs @@ -1,3 +1,4 @@ +use log::warn; use rust_htslib::bam; use rust_htslib::bam::ext::BamRecordExtensions; use rust_htslib::bam::record::Aux; @@ -78,9 +79,9 @@ pub fn get_overlapping_reads( if seqs.is_empty() { // error/warning message depends on whether we are looking for phased reads or not if unphased { - eprintln!("Cannot genotype {repeat}: no reads found"); + warn!("Cannot genotype {repeat}: no reads found"); } else { - eprintln!("Cannot genotype {repeat}: no phased reads found"); + warn!("Cannot genotype {repeat}: no phased reads found. Use --unphased to genotype unphased reads."); } None } else {