Open
Description
A common convention is to wrap lines at 60 characters in a FASTA file.
Would it be possible to add an option to wrap the sequences when writing out to a file?
For example:
/// Write a Fasta record with given id, optional description and sequence.
pub fn write(&mut self, id: &str, desc: Option<&str>, seq: TextSlice<'_>) -> io::Result<()> {
self.writer.write_all(b">")?;
self.writer.write_all(id.as_bytes())?;
if let Some(desc) = desc {
self.writer.write_all(b" ")?;
self.writer.write_all(desc.as_bytes())?;
}
self.writer.write_all(b"\n")?;
for chunk in seq.chunks(wrap) {
self.writer.write_all(chunk)?;
self.writer.write_all(b"\n")?;
}
self.writer.write_all(b"\n")?;
Ok(())
}
Metadata
Metadata
Assignees
Labels
No labels