| Function indexRequire On-demand creation of a specific Fibre. indexRequire(index, fibreTag) Include Headers seqan/index.h Parameters
index | The Index object holding the fibre. Types: Index
fibreTag | A tag that identifies the Fibre. Types: ESA Index Fibres, FM Index Fibres, QGram Index Fibres, WOTD Index Fibres
Remarks If the fibre already exists (indexSupplied is true) then indexRequire does nothing. If the fibre doesn't exist then indexCreate is called to create it. Return Values A bool which is true on a successful creation. Member of Index Examples The following code shows how the BWT of an text can be computed. File "index_textAt_indexText_saAt_indexRequire.cpp"
1 | #include <seqan/index.h>
2 |
3 | using namespace seqan;
4 |
5 | int main ()
6 | {
7 | Index<String<char> > index("MISSISSIPPI");
8 |
9 | // Because indices are build on demand we force the index creation here.
10 | indexRequire(index, FibreSA());
11 |
12 | std::cout << "BWT\tSuffices" << std::endl;
13 |
14 | for (unsigned i = 0; i < length(indexSA(index)); ++i)
15 | {
16 | unsigned textPos = (saAt(i, index) == 0) ? length(index) - 1 : saAt(i, index) - 1;
17 | std::cout << textAt(textPos, index) << "\t" << suffix(indexText(index), textPos) << std::endl;
18 | }
19 | return 0;
20 | }
BWT Suffices P PI S SIPPI S SISSIPPI M MISSISSIPPI I I P PPI I IPPI S SSIPPI S SSISSIPPI I ISSIPPI I ISSISSIPPI SeqAn - Sequence Analysis Library - www.seqan.de

Page built @2014/10/13 16:12:58