A library for working with phylogenetic and population genetic data.
v0.32.0
dict.hpp
Go to the documentation of this file.
1 #ifndef GENESIS_SEQUENCE_FUNCTIONS_DICT_H_
2 #define GENESIS_SEQUENCE_FUNCTIONS_DICT_H_
3 
4 /*
5  Genesis - A toolkit for working with phylogenetic data.
6  Copyright (C) 2014-2024 Lucas Czech
7 
8  This program is free software: you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation, either version 3 of the License, or
11  (at your option) any later version.
12 
13  This program is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with this program. If not, see <http://www.gnu.org/licenses/>.
20 
21  Contact:
22  Lucas Czech <lucas.czech@sund.ku.dk>
23  University of Copenhagen, Globe Institute, Section for GeoGenetics
24  Oster Voldgade 5-7, 1350 Copenhagen K, Denmark
25 */
26 
38 
39 #include <string>
40 #include <vector>
41 
42 namespace genesis {
43 namespace sequence {
44 
45 // =================================================================================================
46 // Sequence Dict
47 // =================================================================================================
48 
61 SequenceDict read_sequence_dict( std::shared_ptr<utils::BaseInputSource> source );
62 
73 SequenceDict read_sequence_fai( std::shared_ptr<utils::BaseInputSource> source );
74 
83 SequenceDict sequence_set_to_dict( SequenceSet const& set );
84 
94 SequenceDict reference_genome_to_dict( ReferenceGenome const& rg );
95 
96 // =================================================================================================
97 // Reference
98 // =================================================================================================
99 
115 {
119  kStrict,
120 
126 
132 
138 };
139 
155  SequenceDict const& lhs,
156  SequenceDict const& rhs,
158 );
159 
170 bool verify( SequenceDict const& dict, SequenceSet const& set, bool match_first_word = false );
171 
172 } // namespace sequence
173 } // namespace genesis
174 
175 #endif // include guard
genesis::sequence::ReferenceComparisonMode::kSharedOnly
@ kSharedOnly
Either reference set can contain sequences that are not in the other. Only the shared ones are used f...
genesis::sequence::ReferenceComparisonMode::kLeftSuperset
@ kLeftSuperset
The left hand reference set is allowed to contain sequences that are not in the right hand side....
genesis::sequence::verify
bool verify(SequenceDict const &dict, SequenceSet const &set, bool match_first_word)
Verify that a SequenceDict fits a SequenceSet.
Definition: dict.cpp:280
genesis::sequence::sequence_set_to_dict
SequenceDict sequence_set_to_dict(SequenceSet const &set)
Get the sequence dict/index information of a given set of Sequences.
Definition: dict.cpp:193
sequence_set.hpp
genesis::sequence::reference_genome_to_dict
SequenceDict reference_genome_to_dict(ReferenceGenome const &rg)
Get the sequence dict/index information of a given set of Sequences that are stored in a ReferenceGen...
Definition: dict.cpp:198
input_source.hpp
sequence_dict.hpp
genesis::sequence::compatible_references
bool compatible_references(SequenceDict const &lhs, SequenceDict const &rhs, ReferenceComparisonMode mode)
Verify that a SequenceDict fits a SequenceSet.
Definition: dict.cpp:207
reference_genome.hpp
genesis
Container namespace for all symbols of genesis in order to keep them separate when used as a library.
Definition: placement/formats/edge_color.cpp:42
genesis::sequence::ReferenceComparisonMode
ReferenceComparisonMode
Chose how to deal with sub-/super-sets when comparing references.
Definition: dict.hpp:114
genesis::sequence::ReferenceComparisonMode::kStrict
@ kStrict
Both compared reference sets have to contain the exact same sequence names.
genesis::sequence::read_sequence_dict
SequenceDict read_sequence_dict(std::shared_ptr< utils::BaseInputSource > source)
Read a .dict sequence dictionary file, describing, e.g., reference genome sequence properties.
Definition: dict.cpp:51
genesis::sequence::read_sequence_fai
SequenceDict read_sequence_fai(std::shared_ptr< utils::BaseInputSource > source)
Read a .fai sequence index file, describing, e.g., reference genome sequence properties.
Definition: dict.cpp:131
genesis::sequence::ReferenceComparisonMode::kRightSuperset
@ kRightSuperset
The right hand reference set is allowed to contain sequences that are not in the lefthand side....