MCPcopy Create free account
hub / github.com/BirolLab/abyss / buildFMIndexFromBWT

Function buildFMIndexFromBWT

Map/index.cc:121–139  ·  view source on GitHub ↗

Build the FM index from the BWT. */

Source from the content-addressed store, hash-verified

119
120/** Build the FM index from the BWT. */
121static void buildFMIndexFromBWT(FMIndex& fm, const string& path)
122{
123 if (opt::verbose > 0)
124 cerr << "Reading `" << path << "'...\n";
125 std::vector<FMIndex::value_type> bwt;
126 readFile(path.c_str(), bwt);
127 assert(bwt.size() > 1);
128
129 if (opt::alphabet.empty()) {
130 fm.setAlphabet(bwt.begin(), bwt.end());
131 std::cerr << "The alphabet has "
132 << fm.alphabetSize() << " symbols.\n";
133 } else
134 fm.setAlphabet(opt::alphabet);
135
136 fm.encode(bwt.begin(), bwt.end());
137 fm.sampleSA(opt::sampleSA);
138 fm.assignBWT(bwt.begin(), bwt.end());
139}
140
141/** Build an FM index of the specified file. */
142static void buildFMIndex(FMIndex& fm, const string& path)

Callers 1

mainFunction · 0.85

Calls 11

setAlphabetMethod · 0.80
alphabetSizeMethod · 0.80
encodeMethod · 0.80
sampleSAMethod · 0.80
assignBWTMethod · 0.80
readFileFunction · 0.50
c_strMethod · 0.45
sizeMethod · 0.45
emptyMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected