A toolkit for working with phylogenetic data.
v0.24.0
PhylipWriter Class Reference

#include <genesis/sequence/formats/phylip_writer.hpp>

Detailed Description

Definition at line 52 of file phylip_writer.hpp.

Public Member Functions

 PhylipWriter ()=default
 
 PhylipWriter (PhylipWriter const &)=default
 
 PhylipWriter (PhylipWriter &&)=default
 
 ~PhylipWriter ()=default
 
PhylipWriterlabel_length (size_t value)
 Set the length of the label in front of the sequences. More...
 
size_t label_length () const
 Return the currently set label length. More...
 
PhylipWriterline_length (size_t value)
 Set the line length, which determines after how many chars (Sequence sites) lines breaks are inserted when writing the Phylip file. More...
 
size_t line_length () const
 Get the current line length. More...
 
PhylipWriteroperator= (PhylipWriter const &)=default
 
PhylipWriteroperator= (PhylipWriter &&)=default
 
void write (SequenceSet const &sequence_set, std::shared_ptr< utils::BaseOutputTarget > target) const
 Write a SequenceSet to an output target, using the Phylip format. More...
 

Constructor & Destructor Documentation

◆ PhylipWriter() [1/3]

PhylipWriter ( )
default

◆ ~PhylipWriter()

~PhylipWriter ( )
default

◆ PhylipWriter() [2/3]

PhylipWriter ( PhylipWriter const &  )
default

◆ PhylipWriter() [3/3]

PhylipWriter ( PhylipWriter &&  )
default

Member Function Documentation

◆ label_length() [1/2]

PhylipWriter & label_length ( size_t  value)

Set the length of the label in front of the sequences.

Phylip has the weird property that labels are written in front of sequences and do not need to have a delimiter, but instead are simply the first n characters of the string. This value determines after how many chars the label ends and the actual sequence begins.

If set to 0 (default), a relaxed version of Phylip is used, where the sequence begin is automatically detected. Labels can then be of arbitrary lengths, as long as they do not contain white spaces. After the label, a space is appended.

If set to a value greater than 0, the label will be cut off after that many chars. For shorter labels, the remaining number is filled with spaces. The functions returns the PhylipWriter object to allow fluent interfaces.

Definition at line 120 of file phylip_writer.cpp.

◆ label_length() [2/2]

size_t label_length ( ) const

Return the currently set label length.

See the setter label_length( size_t ) for details.

Definition at line 126 of file phylip_writer.cpp.

◆ line_length() [1/2]

PhylipWriter & line_length ( size_t  value)

Set the line length, which determines after how many chars (Sequence sites) lines breaks are inserted when writing the Phylip file.

Default is 80. If set to 0, no breaks are inserted. The functions returns the PhylipWriter object to allow fluent interfaces.

Definition at line 131 of file phylip_writer.cpp.

◆ line_length() [2/2]

size_t line_length ( ) const

Get the current line length.

See the setter line_length( size_t ) for details.

Definition at line 137 of file phylip_writer.cpp.

◆ operator=() [1/2]

PhylipWriter& operator= ( PhylipWriter const &  )
default

◆ operator=() [2/2]

PhylipWriter& operator= ( PhylipWriter &&  )
default

◆ write()

void write ( SequenceSet const &  sequence_set,
std::shared_ptr< utils::BaseOutputTarget target 
) const

Write a SequenceSet to an output target, using the Phylip format.

See the output target convenience functions utils::to_file(), utils::to_stream(), and utils::to_string() for examples of how to obtain a suitable output target.

Definition at line 61 of file phylip_writer.cpp.


The documentation for this class was generated from the following files: