read_charsets

Reads character set definitions from a NEXUS file. The syntax is expected to be like what is used inside mrbayes blocks and inside sets blocks, i.e.:

charset <name> = <start coordinate>(-<end coordinate>)?(\<phase>)? ...;

That is, the definition starts with the charset token, a name and an equals sign. Then, one or more coordinate sets. Each coordinate set has a start coordinate, an optional end coordinate (otherwise it's interpreted as a single site), and an optional phase statement, e.g. for codon positions. Alternatively, instead of coordinates, names of other character sets may be used. The statement ends with a semicolon.

Internally, everything after the charset token is dispatched to Bio::BioVeL::Service::NeXMLMerger::CharSetReader::text::read_charset which implements the actual parsing. Subsequently, the collection of character sets is then dispatched to Bio::BioVeL::Service::NeXMLMerger::CharSetReader::text::resolve_references to resolve any named character sets that were referenced in lieu of coordinate sets. The coordinate sets of the referenced character sets are deepcloned to replace the reference.