You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rather than the callback-style we have now, it would be nice to write something like:
let processor = NeedletailFile::new("test.fasta");
assert_eq!(processor.file_type, NeedletailTypes::FASTA);
assert_eq!(processor.compression_type, NeedletailCompressionTypes::None);
while let record = processor.next()? {
...
}
The major issues with this are keeping the state of the iterator and the underlying buffer synced up (Rust's streaming iterator problem; this is also why we can't use for record in ...) and more importantly, the polymorphic nature of record (is it a FASTA? FASTQ? maybe we can do something clever with Into here to allow the processor to spit out a SeqRecord?). I've never been a huge fan of the callbacks and with the big v0.2.0 rewrite I think we're closer to having a decent solution here, but there's still a bit of type-fu necessary to make it work.
The text was updated successfully, but these errors were encountered:
@bovee It'd also be nice to have a function for evaluating a NeedletailFile as a stream of bytes and records (or maybe just the former and a method for conversion). Then you could trivially do a few nice things like compute rolling md5/sha256 checksums, etc. Thoughts?
Yeah, that's a really good idea. It's a bit more complicated, but we should split the compression stuff off into it's own transparent Read + Seek -> Read handler and then you could write a "middleware" to do rolling checksums on either the input or output from that.
Rather than the callback-style we have now, it would be nice to write something like:
The major issues with this are keeping the state of the iterator and the underlying buffer synced up (Rust's streaming iterator problem; this is also why we can't use
for record in ...
) and more importantly, the polymorphic nature of record (is it a FASTA? FASTQ? maybe we can do something clever withInto
here to allow the processor to spit out a SeqRecord?). I've never been a huge fan of the callbacks and with the big v0.2.0 rewrite I think we're closer to having a decent solution here, but there's still a bit of type-fu necessary to make it work.The text was updated successfully, but these errors were encountered: