-
Notifications
You must be signed in to change notification settings - Fork 3
feat: allow parsing single ended RA files #247
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this approach works -- just need to cache the flag rather than recompute it on every read.
src/read_pair_iter.rs
Outdated
@@ -352,6 +382,7 @@ impl ReadPairIter { | |||
if self.buffer.remaining_mut() < 512 { | |||
self.buffer = BytesMut::with_capacity(BUF_SIZE) | |||
} | |||
let is_single_ended = self.is_single_ended()?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is inside the "inner loop" of FASTQ processing, so you can't be re-running the fairly heavy-weight is_single_ended
function here -- it's too slow because it's opening files and parsing reads.
I thinkis_single_ended should be a pre-computed flag that is set when you construct the ReadPairIter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. This had made the iterations 100x slower on testing (DETECT_CHEMISTRY
that usually takes <5 min had run overnight for something like 8hours when I was testing).
src/read_pair_iter.rs
Outdated
@@ -322,6 +322,36 @@ impl ReadPairIter { | |||
}) | |||
} | |||
|
|||
pub fn is_single_ended(&self) -> Result<bool, FastqError> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should return the value of a flag stored in the struct. THere should probably be a non-public method that computes this once at the time you create the ReadPairIter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
No description provided.