Skip to content

Commit

Permalink
Turn step into an int
Browse files Browse the repository at this point in the history
  • Loading branch information
apollis44 committed Apr 17, 2024
1 parent 728b286 commit 69318f2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ska_dict.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ where
let mut reader =
parse_fastx_file(filename).unwrap_or_else(|_| panic!("Invalid path/file: {filename}"));

let mut step: f64 = 1.0;
let mut step: usize = 1;

if proportion_reads.is_some() {
let mut nb_reads_total = 0;
Expand All @@ -119,15 +119,15 @@ where
let mut nb_reads = nb_reads_total;
nb_reads = (nb_reads as f64 * proportion_reads.unwrap()) as usize;

step = nb_reads_total as f64 / nb_reads as f64;
step = (nb_reads_total as f64 / nb_reads as f64).round() as usize;
}

let mut reader =
parse_fastx_file(filename).unwrap_or_else(|_| panic!("Invalid path/file: {filename}"));

let mut iter_reads = 0;
while let Some(record) = reader.next() {
if (iter_reads as f64 % step) as usize != 0 {
if iter_reads % step != 0 {
iter_reads += 1;
continue;
} else {
Expand Down

0 comments on commit 69318f2

Please sign in to comment.