fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        if let Some(header) = self.header() {
            writeln!(f, "{}", header)?;
        }

        for reference_sequence in self.reference_sequences.values() {
            writeln!(f, "{}", reference_sequence)?;
        }

        for read_group in self.read_groups.values() {
            writeln!(f, "{}", read_group)?;
        }

        for program in self.programs.values() {
            writeln!(f, "{}", program)?;
        }

        for comment in &self.comments {
            writeln!(f, "{}\t{}", record::Kind::Comment, comment)?;
        }

        Ok(())
    }
/// Formats the SAM header as a raw SAM header.
///
/// # Examples
///
/// ```
/// use noodles_sam::{self as sam, header::{self, ReferenceSequence}};
///
/// let header = sam::Header::builder()
///     .set_header(header::header::Header::new(header::header::Version::new(1, 6)))
///     .add_reference_sequence(ReferenceSequence::new("sq0".parse()?, 8)?)
///     .add_reference_sequence(ReferenceSequence::new("sq1".parse()?, 13)?)
///     .build();
///
/// let expected = "\
/// @HD\tVN:1.6
/// @SQ\tSN:sq0\tLN:8
/// @SQ\tSN:sq1\tLN:13
/// ";
///
/// assert_eq!(header.to_string(), expected);
/// # Ok::<(), Box<dyn std::error::Error>>(())
/// ```
Formats the SAM header as a raw SAM header.
Formats the SAM header as a raw SAM header .
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        if let Some(header) = self.header() {
            writeln!(f, "{}", header)?;
        }
        for reference_sequence in self.reference_sequences.values() {
            writeln!(f, "{}", reference_sequence)?;
        }
        for read_group in self.read_groups.values() {
            writeln!(f, "{}", read_group)?;
        }
        for program in self.programs.values() {
            writeln!(f, "{}", program)?;
        }
        for comment in &self.comments {
            writeln!(f, "{}\t{}", record::Kind::Comment, comment)?;
        }
        Ok(())
    }
fn fmt ( & self , f : & mut fmt :: Formatter < ' _ > ) -> fmt :: Result { if let Some ( header ) = self . header ( ) { writeln ! ( f " " header ) ? ; } for reference_sequence in self . reference_sequences . values ( ) { writeln ! ( f " " reference_sequence ) ? ; } for read_group in self . read_groups . values ( ) { writeln ! ( f " " read_group ) ? ; } for program in self . programs . values ( ) { writeln ! ( f " " program ) ? ; } for comment in & self . comments { writeln ! ( f " \t " record Kind Comment comment ) ? ; } Ok ( ( ) ) }
Formats the SAM header as a raw SAM header.
Formats the SAM header as a raw SAM header .
&self
f
&mut fmt::Formatter<'_>
&self
f
&mut fmt::Formatter<'_>
examples
```
use noodles_sam::{self as sam, header::{self, ReferenceSequence}}.

let header = sam::Header::builder()
.set_header(header::header::Header::new(header::header::Version::new(1, 6)))
.add_reference_sequence(ReferenceSequence::new("sq0".parse()?, 8)?)
.add_reference_sequence(ReferenceSequence::new("sq1".parse()?, 13)?)
.build().



assert_eq!(header.to_string(), expected).
` ` ` use noodles_sam :: { self as sam header :: { self ReferenceSequence }} . let header = sam :: Header :: builder () . set_header ( header :: header :: Header :: new ( header :: header :: Version :: new ( 1 6 ))) . add_reference_sequence ( ReferenceSequence :: new ( " sq0 " . parse () ? 8 ) ? ) . add_reference_sequence ( ReferenceSequence :: new ( " sq1 " . parse () ? 13 ) ? ) . build () . assert_eq! ( header . to_string () expected ) .
ok::<(), box<dyn std::error::error>>(())
None