Closed esteinig closed 4 years ago
No need. When the next release of rust-bio comes out you can directly write a record without needing to parse out the components as I implemented fmt::Display
for fastq
recently. An example of using this
https://github.com/rust-bio/rust-bio/blob/ed797d7e2b4621d146c48c03a09d6ccd56e25311/src/io/fastq.rs#L486-L497
I saw your contribution and the test - it looks neat! For some reason I went for the bio::io::fastq::Writer
and record.write_record
but would like to compare speed.
By the way there was a huge difference using f32
floats for the quality computation instead of f64
which about halved the runtime :astonished:
You can try it out now, I think it's pretty fast using the binary with cargo build --release
Closing for now, will reopen on next release of rust-bio
to compare speed of fmt::Display
I think you're correct in using the fastq::Writer
API. Using the Display
trait with the write!
macro directly is effectively doing the same thing. Using the API makes it much cleaner and likely more flexible to future changes.
Implement proper record writer instead of
println!