1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
|
#include <seqan/basic.h>
#include <seqan/sequence.h>
using namespace seqan2;
//![assignment2]
template <typename TString, typename TPattern>
void findPatternInReference(String<int> & hits,
TString const & reference,
TPattern const & pattern)
{
(void) hits;
(void) reference;
(void) pattern;
// [A] Check whether pattern fits into the sequence.
// [B] Iterate over all positions at which the pattern might occur.
// [C] Evaluate all positions of the pattern until you find a mismatch or you have found a hit.
// [D] Report begin position at which pattern matches the sequence.
}
//![assignment2]
//![assignment3]
template <typename TJournalEntriesIterator, typename TPattern>
void _findInOriginalNode(String<int> & hitTarget,
TJournalEntriesIterator & entriesIt,
TPattern const & pattern,
String<int> const & refHits)
{
(void) hitTarget;
(void) entriesIt;
(void) pattern;
(void) refHits;
// [A] Check if hits exist in the reference.
// [B] Find upper bound to current physical position in sorted refHits using std::upper_bound.
// [C] Make sure we do not miss hits that begin at physical position of current node.
// [D] Store all hits that are found in the region of the reference which is covered by this node.
// [E] Store the correct virtual position and check next hit.
}
//![assignment3]
//![assignment4]
template <typename TJournalEntriesIterator, typename TJournal, typename TPattern>
void _searchAtBorder(String<int> & hitTarget,
TJournalEntriesIterator & entriesIt,
TJournal const & journal,
TPattern const & pattern)
{
(void) hitTarget;
(void) entriesIt;
(void) journal;
(void) pattern;
// [A] Determine first position of the at which pattern crosses the border of current node.
// [B] Determine last position before pattern exits the current node or reaches the end of the sequence.
// [C] Move step by step over search region.
// [D] Scan pattern in current window and report possible hits.
}
//![assignment4]
int main()
{
return 0;
}
|