|
A library for working with phylogenetic and population genetic data.
v0.32.0
|
|
Go to the documentation of this file. 1 #ifndef GENESIS_TAXONOMY_FORMATS_TAXONOMY_READER_H_
2 #define GENESIS_TAXONOMY_FORMATS_TAXONOMY_READER_H_
154 void read( std::shared_ptr<utils::BaseInputSource> source,
Taxonomy& target )
const;
162 Taxonomy read( std::shared_ptr<utils::BaseInputSource> source )
const;
324 int name_field_position_ = 0;
325 int rank_field_position_ = -1;
326 int id_field_position_ = -1;
327 bool expect_strict_order_ =
false;
334 #endif // include guard
void read(std::shared_ptr< utils::BaseInputSource > source, Taxonomy &target) const
Read taxonomy data from an input source, and add the contents to a Taxonomy.
bool expect_strict_order() const
Return whether currently the reader expects a strict order of taxa.
Read Taxonomy file formats.
Internal helper structure that stores the relevant data of one line while reading.
int name_field_position() const
Get the currently set position of the field in each line where the taxon name is located.
~TaxonomyReader()=default
int id_field_position() const
Get the currently set position of the field in each line where the ID is located.
TaxonomyReader & operator=(TaxonomyReader const &)=default
TaxonomyReader()
Default constructor.
int rank_field_position() const
Get the currently set position of the field in each line where the rank name is located.
utils::CsvReader & csv_reader()
Get the CsvReader used for reading a taxonomy file.
Container namespace for all symbols of genesis in order to keep them separate when used as a library.
Store a Taxonomy, i.e., a nested hierarchy of Taxa.
Line parse_line(utils::InputStream &it) const
Read a single line of a taxonomy file and return the contained name and rank.
void parse_document(utils::InputStream &it, Taxonomy &tax) const
Parse all data from an InputStream into a Taxonomy object.
Helper class to parse a string containing a taxonomic path string into a Taxopath object.
TaxopathParser & taxopath_parser()
Get the TaxopathParser used for parsing taxonomic path strings.
Read Comma/Character Separated Values (CSV) data and other delimiter-separated formats.