Go to the documentation of this file. 1 #ifndef BIFROST_COLOREDCDBG_HPP
2 #define BIFROST_COLOREDCDBG_HPP
6 #include <unordered_map>
7 #include <unordered_set>
10 #include "DataManager.hpp"
59 template<
typename Unitig_data_t>
62 typedef Unitig_data_t U;
150 template<
typename Unitig_data_t =
void>
154 "Type Unitig_data_t of data associated with vertices of class ColoredCDBG<Unitig_data_t> must "
155 " be void (no data) or a class extending class CCDBG_Data_t");
157 typedef Unitig_data_t U;
167 ColoredCDBG(
int kmer_length = DEFAULT_K,
int minimizer_length = -1);
253 bool write(
const string& prefix_output_fn,
const size_t nb_threads = 1,
const bool write_index_file =
true,
const bool compress_output =
false,
const bool verbose =
false)
const;
265 bool read(
const string& input_graph_fn,
const string& input_colors_fn,
const size_t nb_threads = 1,
const bool verbose =
false);
276 bool read(
const string& input_graph_fn,
const string& input_index_fn,
const string& input_colors_fn,
const size_t nb_threads = 1,
const bool verbose =
false);
318 bool merge(
const vector<ColoredCDBG>& v,
const size_t nb_threads = 1,
const bool verbose =
false);
332 bool merge(vector<ColoredCDBG>&& v,
const size_t nb_threads = 1,
const bool verbose =
false);
351 bool search(
const vector<string>& query_filenames,
const string& out_filename_prefix,
352 const double ratio_kmers,
const bool inexact_search,
const size_t nb_threads,
353 const bool verbose =
false)
const;
357 void checkColors(
const vector<string>& filename_seq_in)
const;
358 bool loadColors(
const string& input_graph_fn,
const string& input_colors_fn,
const size_t nb_threads,
const bool verbose);
360 void initUnitigColors(
const CCDBG_Build_opt& opt,
const size_t max_nb_hash = 31);
361 void buildUnitigColors(
const size_t nb_threads);
364 void resizeDataUC(
const size_t sz,
const size_t nb_threads = 1,
const size_t max_nb_hash = 31);
369 #include "ColoredCDBG.tcc"
string filename_colors_in
String containing the name of a Bifrost color file to read in ColoredCDBG<U>::read().
Definition: ColoredCDBG.hpp:32
ColoredCDBG(const ColoredCDBG &o)
Copy constructor (copy a colored cdBG).
ColoredCDBG(ColoredCDBG &&o)
Move constructor (move a colored cdBG).
ColoredCDBG & operator=(const ColoredCDBG &o)
Copy assignment operator (copy a colored cdBG).
If data are to be associated with the unitigs of the colored and compacted de Bruijn graph,...
Definition: ColoredCDBG.hpp:60
ColoredCDBG & operator=(ColoredCDBG &&o)
Move assignment operator (move a colored cdBG).
This structure inherits from CDBG_Build_opt and introduces only a few new members which are color-rel...
Definition: ColoredCDBG.hpp:30
bool merge(const vector< ColoredCDBG > &v, const size_t nb_threads=1, const bool verbose=false)
Merge multiple colored and compacted de Bruijn graphs.
bool buildColors(const CCDBG_Build_opt &opt)
Map the colors to the unitigs.
bool read(const string &input_graph_fn, const string &input_index_fn, const string &input_colors_fn, const size_t nb_threads=1, const bool verbose=false)
Read a colored and compacted de Bruijn graph from disk using an index file.
void concat(const UnitigColorMap< U > &um_dest, const UnitigColorMap< U > &um_src)
Join data of two unitigs which are going to be concatenated.
Definition: ColoredCDBG.hpp:88
Contain all the information for the mapping of a k-mer or a sequence to a unitig of a Compacted de Br...
Definition: UnitigMap.hpp:92
Interface for the Compacted de Bruijn graph API.
bool write(const string &prefix_output_fn, const size_t nb_threads=1, const bool write_index_file=true, const bool compress_output=false, const bool verbose=false) const
Write a colored and compacted de Bruijn graph to disk.
void extract(const UnitigColors *uc_dest, const UnitigColorMap< U > &um_src, const bool last_extraction)
Extract data corresponding to a sub-unitig of a unitig A.
Definition: ColoredCDBG.hpp:117
bool buildGraph(const CCDBG_Build_opt &opt)
Build the Colored and compacted de Bruijn graph (only the unitigs).
Represent the k-mer color sets of a unitig.
Definition: ColorSet.hpp:21
vector< string > getColorNames() const
Get the names of all colors.
bool outputColors
Boolean indicating if the graph should be colored or not.
Definition: ColoredCDBG.hpp:34
bool merge(const ColoredCDBG &o, const size_t nb_threads=1, const bool verbose=false)
Merge a colored and compacted de Bruijn graph.
void merge(const UnitigColorMap< U > &um_dest, const const_UnitigColorMap< U > &um_src)
Merge the data of a sub-unitig B to the data of a sub-unitig A.
Definition: ColoredCDBG.hpp:100
string serialize(const const_UnitigColorMap< U > &um_src) const
Serialize the data to a GFA-formatted string.
Definition: ColoredCDBG.hpp:126
bool merge(ColoredCDBG &&o, const size_t nb_threads=1, const bool verbose=false)
Merge and clear a colored and compacted de Bruijn graph.
void clear()
Clear the graph: remove unitigs, user data and colors + reset its parameters.
bool operator!=(const ColoredCDBG &o) const
Inequality operator.
bool read(const string &input_graph_fn, const string &input_colors_fn, const size_t nb_threads=1, const bool verbose=false)
Read a colored and compacted de Bruijn graph from disk.
void clear(const UnitigColorMap< U > &um_dest)
Clear the data associated with a unitig.
Definition: ColoredCDBG.hpp:72
Most members of this structure are parameters for CompactedDBG<U, G>::build(), except for:
Definition: CompactedDBG.hpp:128
bool operator==(const ColoredCDBG &o) const
Equality operator.
G * getData()
Return a pointer to the graph data.
Definition: CompactedDBG.hpp:620
size_t getNbColors() const
Get the number of colors in the graph.
Definition: ColoredCDBG.hpp:349
Interface to access the colors and the data associated with a unitig of a ColoredCDBG.
Definition: DataAccessor.hpp:21
ColoredCDBG(int kmer_length=31, int minimizer_length=-1)
Constructor (set up an empty colored cdBG).
string getColorName(const size_t color_id) const
Get the name of a color.
Definition: ColorSet.hpp:16
ColoredCDBG & operator+=(const ColoredCDBG &o)
Addition assignment operator (merge a colored cdBG).
bool merge(vector< ColoredCDBG > &&v, const size_t nb_threads=1, const bool verbose=false)
Merge and clear multiple colored and compacted de Bruijn graphs.
Represent a Compacted de Bruijn graph.
Definition: CompactedDBG.hpp:313
Represent a Colored and Compacted de Bruijn graph.
Definition: ColoredCDBG.hpp:151