Skip to content

Commit b107ddb

Browse files
committed
Rename Piped to InThread, and add decode_in_thread
1 parent 7a5279c commit b107ddb

9 files changed

Lines changed: 127 additions & 98 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ is roughly based on [Keep a Changelog], and this project tries to adheres to
1717
connected components. Phase labels are now ordered deterministically by
1818
cluster size (descending), lowest variant position, then lowest minority
1919
allele byte value.
20+
- Renamed `GzipReaderPiped` to `GzipReaderInThread` and altered API for it
21+
- Renamed `ReadFileZipPipe` to `ReadFileZipInThread`
22+
- `use_file_or_zip_threaded` has been removed in favor of a separate `decode_in_thread` method
2023

2124
## Fixed
2225

‎crates/irma-core-cli/processes/integrated/preprocess/mod.rs‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use clap::{Args, ValueHint};
1010
use foldhash::fast::SeedableRandomState;
1111
use irma_records::{
1212
fastq::ReadTransforms,
13-
io::{InputOptions, IterWithContext, OutputOptions, ReadFileZipPipe, RecordReaders, WriterWithContext},
13+
io::{InputOptions, IterWithContext, OutputOptions, ReadFileZipInThread, RecordReaders, WriterWithContext},
1414
{
1515
hashing::get_hasher,
1616
paired::{ReadSide, ZipPairedReadsError, ZipPairedReadsExt},
@@ -111,7 +111,7 @@ pub fn preprocess_process(args: PreprocessArgs) -> Result<(), std::io::Error> {
111111
/// context.
112112
struct Reader {
113113
path: PathBuf,
114-
iter: IterWithContext<FastQReader<ReadFileZipPipe>>,
114+
iter: IterWithContext<FastQReader<ReadFileZipInThread>>,
115115
}
116116

117117
struct ParsedPreprocessIoArgs {
@@ -152,7 +152,8 @@ fn parse_preprocess_args(args: PreprocessArgs) -> std::io::Result<ParsedPreproce
152152
} = args;
153153

154154
let readers = InputOptions::new_from_paths(&fastq_input, fastq_input2.as_ref())
155-
.use_file_or_zip_threaded()
155+
.use_file_or_zip()
156+
.decode_in_thread()
156157
.parse_fastq()
157158
.open()?;
158159

‎crates/irma-core-cli/processes/standalone/aligner/arg_parsing.rs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ pub fn parse_aligner_args(args: AlignerArgs) -> std::io::Result<ParsedAlignerArg
109109
}
110110

111111
let query_reader = InputOptions::new_from_path(&args.query_file)
112-
.use_file_or_zip_threaded()
112+
.use_file_or_zip()
113+
.decode_in_thread()
113114
.parse_fastx()
114115
.open()?;
115116

‎crates/irma-core-cli/processes/standalone/aligner/mod.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use crate::aligner::{
33
writers::{AlignmentWriter, write_header},
44
};
55
use clap::{Args, builder::RangedI64ValueParser};
6-
use irma_records::io::{FastX, FastXReader, IterWithContext, OutputOptions, ReadFileZipPipe};
6+
use irma_records::io::{FastX, FastXReader, IterWithContext, OutputOptions, ReadFileZipInThread};
77
use std::{cmp::Ordering, io::Write, path::PathBuf, sync::atomic::AtomicU64};
88
use zoe::{
99
alignment::{Alignment, LocalProfiles, MaybeAligned, SharedProfiles, sw::max_score_for_int_type},
@@ -20,7 +20,7 @@ mod arg_parsing;
2020
mod writers;
2121

2222
/// A type alias for the query reader used by `aligner`.
23-
type QueryReader = IterWithContext<FastXReader<ReadFileZipPipe>>;
23+
type QueryReader = IterWithContext<FastXReader<ReadFileZipInThread>>;
2424

2525
/// A type alias for the writer being used for the SAM file, which depends on
2626
/// whether `dev_no_rayon` is set.

‎crates/irma-core-cli/processes/standalone/sampler.rs‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use clap::Args;
44
use irma_records::{
55
io::{
6-
DispatchFastX, FastXReader, InputOptions, IterWithContext, OutputOptions, ReadFileZipPipe, RecordReaders,
6+
DispatchFastX, FastXReader, InputOptions, IterWithContext, OutputOptions, ReadFileZipInThread, RecordReaders,
77
RecordWriters, SequenceWriter, WriteFileZipStdout, WriteRecord, WriteRecordCompatibleItem, WriteRecords,
88
check_distinct_files, is_gz,
99
},
@@ -365,7 +365,7 @@ fn get_paired_seq_count(io_args: &IOArgs) -> std::io::Result<Option<usize>> {
365365
/// context.
366366
struct Reader {
367367
path: PathBuf,
368-
iter: IterWithContext<FastXReader<ReadFileZipPipe>>,
368+
iter: IterWithContext<FastXReader<ReadFileZipInThread>>,
369369
}
370370

371371
/// The IO arguments used by sampler, including up to two readers and writers.
@@ -398,7 +398,8 @@ fn parse_sampler_args(args: SamplerArgs) -> Result<(IOArgs, Xoshiro256StarStar,
398398
)?;
399399

400400
let readers = InputOptions::new_from_paths(&args.input_file, args.input_file2.as_ref())
401-
.use_file_or_zip_threaded()
401+
.use_file_or_zip()
402+
.decode_in_thread()
402403
.parse_fastx()
403404
.open()?;
404405

‎crates/irma-core-cli/processes/standalone/trimmer.rs‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use clap::Args;
88
use core::fmt;
99
use irma_records::{
1010
io::{
11-
InputOptions, IterWithContext, OutputOptions, PairedWriters, ReadFileZipPipe, RecordWriters, WriteFileZipStdout,
11+
InputOptions, IterWithContext, OutputOptions, PairedWriters, ReadFileZipInThread, RecordWriters, WriteFileZipStdout,
1212
WriteRecord, check_distinct_files,
1313
},
1414
paired::{DeinterleavedPairedReadsExt, ZipPairedReadsExt, ZipReadsError},
@@ -311,7 +311,7 @@ impl fmt::Display for PairedIoStrategy {
311311

312312
/// Parsed arguments for the `trimmer` subprocess
313313
struct ParsedTrimmerArgs {
314-
io_args: PairedIoArgs<IterWithContext<FastQReader<ReadFileZipPipe>>, WriteFileZipStdout>,
314+
io_args: PairedIoArgs<IterWithContext<FastQReader<ReadFileZipInThread>>, WriteFileZipStdout>,
315315
strategy: PairedIoStrategy,
316316
trimming_args: ParsedTrimmerOptions,
317317
primer_file: Option<PathBuf>,
@@ -351,7 +351,8 @@ fn parse_trimmer_args(args: TrimmerArgs) -> std::io::Result<ParsedTrimmerArgs> {
351351
check_distinct_files(&fastq_input, fastq_input2.as_ref(), output.as_ref(), output2.as_ref())?;
352352

353353
let readers = InputOptions::new_from_paths(&fastq_input, fastq_input2.as_ref())
354-
.use_file_or_zip_threaded()
354+
.use_file_or_zip()
355+
.decode_in_thread()
355356
.parse_fastq()
356357
.open()?;
357358

‎crates/irma-core-cli/processes/standalone/xleave.rs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ pub fn xleave_process(args: XleaveArgs) -> Result<(), std::io::Error> {
3434
)?;
3535

3636
let readers = InputOptions::new_from_paths(&args.input_file1, args.input_file2.as_ref())
37-
.use_file_or_zip_threaded()
37+
.use_file_or_zip()
38+
.decode_in_thread()
3839
.parse_fastx()
3940
.open()?;
4041

0 commit comments

Comments
 (0)