Skip to content

Commit 707d0ca

Browse files
authored
feat: Update rust-bio (#202)
* Update to rust_bio 0.39 * update rust-bio
1 parent 3fdcb3f commit 707d0ca

File tree

9 files changed

+14
-12
lines changed

9 files changed

+14
-12
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ readme = "README.md"
1010

1111
[dependencies]
1212
approx = "0.4"
13-
bio = "0.32"
13+
bio = "0.39"
1414
clap = { version = "2.31", features = ["yaml", "color", "suggestions"]}
1515
indicatif = "0.11"
1616
itertools = "0.9"

src/bam/anonymize_reads.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use std::ops::Range;
99
use std::path::Path;
1010
use uuid::Uuid;
1111

12-
pub fn anonymize_reads<P: AsRef<Path>>(
12+
pub fn anonymize_reads<P: AsRef<Path> + std::fmt::Debug>(
1313
bam: P,
1414
input_ref: P,
1515
output_bam: P,

src/bam/plot/plot_bam.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use std::io::Write;
99
use std::path::Path;
1010
use tera::{Context, Tera};
1111

12-
pub(crate) fn plot_bam<P: AsRef<Path>>(
12+
pub(crate) fn plot_bam<P: AsRef<Path> + std::fmt::Debug>(
1313
bam_paths: &[P],
1414
fasta_path: P,
1515
region: &Region,

src/bcf/report/table_report/alignment_reader.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ fn make_alignment(record: &bam::Record) -> Alignment {
142142
}
143143
}
144144

145-
pub fn make_nucleobases<P: AsRef<Path>>(
145+
pub fn make_nucleobases<P: AsRef<Path> + std::fmt::Debug>(
146146
fasta_path: P,
147147
region: &Region,
148148
snippets: Vec<Alignment>,

src/bcf/report/table_report/create_report_table.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ pub(crate) fn read_tag_entries(
502502
Ok(())
503503
}
504504

505-
pub(crate) fn create_report_data<P: AsRef<Path>>(
505+
pub(crate) fn create_report_data<P: AsRef<Path> + std::fmt::Debug>(
506506
fasta_path: P,
507507
variant: Option<Variant>,
508508
bam_path: P,

src/bcf/report/table_report/fasta_reader.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use serde::Serialize;
77
use std::collections::HashMap;
88
use std::path::Path;
99

10-
pub fn read_fasta<P: AsRef<Path>>(
10+
pub fn read_fasta<P: AsRef<Path> + std::fmt::Debug>(
1111
path: P,
1212
region: &Region,
1313
compensate_0_basing: bool,

src/bcf/report/table_report/static_reader.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ fn calc_rows(
142142
(reads_wr, matches_wr)
143143
}
144144

145-
pub fn get_static_reads<P: AsRef<Path>>(
145+
pub fn get_static_reads<P: AsRef<Path> + std::fmt::Debug>(
146146
path: P,
147147
fasta_path: P,
148148
region: &Region,

src/fastq/collapse_reads_to_fragments/mod.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ use std::path::Path;
9494
/// The type of the readers (writers) depends on the file ending.
9595
/// If the input file names end with '.gz' a gzipped reader (writer) is used.
9696
#[allow(clippy::too_many_arguments)]
97-
pub fn call_consensus_reads_from_paths<P: AsRef<Path>>(
97+
pub fn call_consensus_reads_from_paths<P: AsRef<Path> + std::fmt::Debug>(
9898
fq1: P,
9999
fq2: P,
100100
fq1_out: P,
@@ -121,7 +121,9 @@ pub fn call_consensus_reads_from_paths<P: AsRef<Path>>(
121121
fq2_out.as_ref().display()
122122
);
123123

124-
fn reader<P: AsRef<Path>>(path: P) -> Result<fastq::Reader<Box<dyn std::io::Read>>> {
124+
fn reader<P: AsRef<Path>>(
125+
path: P,
126+
) -> Result<fastq::Reader<BufReader<Box<dyn std::io::Read>>>> {
125127
let r: Box<dyn Read> = if path.as_ref().ends_with(".gz") {
126128
Box::new(
127129
fs::File::open(&path)

src/fastq/collapse_reads_to_fragments/pipeline.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ pub struct NonOverlappingConsensus {
111111
likelihood: LogProb,
112112
}
113113

114-
pub trait CallConsensusReads<'a, R: io::Read + 'a, W: io::Write + 'a> {
114+
pub trait CallConsensusReads<'a, R: io::Read + io::BufRead + 'a, W: io::Write + 'a> {
115115
/// Cluster reads from fastq readers according to their sequence
116116
/// and UMI, then compute a consensus sequence.
117117
///
@@ -312,7 +312,7 @@ pub struct CallNonOverlappingConsensusRead<'a, R: io::Read, W: io::Write> {
312312
verbose_read_names: bool,
313313
}
314314

315-
impl<'a, R: io::Read, W: io::Write> CallConsensusReads<'a, R, W>
315+
impl<'a, R: io::Read + io::BufRead, W: io::Write> CallConsensusReads<'a, R, W>
316316
for CallNonOverlappingConsensusRead<'a, R, W>
317317
{
318318
fn write_records(
@@ -480,7 +480,7 @@ impl<'a, R: io::Read, W: io::Write> CallOverlappingConsensusRead<'a, R, W> {
480480
}
481481
}
482482

483-
impl<'a, R: io::Read, W: io::Write> CallConsensusReads<'a, R, W>
483+
impl<'a, R: io::Read + io::BufRead, W: io::Write> CallConsensusReads<'a, R, W>
484484
for CallOverlappingConsensusRead<'a, R, W>
485485
{
486486
fn write_records(

0 commit comments

Comments
 (0)