FU Logo
  • Startseite
  • Kontakt
  • Impressum
  • Home
  • Listenauswahl
  • Anleitungen

[Seqan-dev] questions about FindPattern

<-- thread -->
<-- date -->
  • From: Konstantin Okonechnikov <k.okonechnikov@gmail.com>
  • To: seqan-dev@lists.fu-berlin.de
  • Date: Tue, 12 Feb 2013 12:29:10 +0100
  • Reply-to: k.okonechnikov@gmail.com, SeqAn Development <seqan-dev@lists.fu-berlin.de>
  • Subject: [Seqan-dev] questions about FindPattern

Hi!

Here is a simple code extract:

vector<SearchResult> StringUtils::findDnaPattern(const CharString&
query, const CharString &source, int minScore)
{
    using namespace seqan;
    vector<SearchResult> results;

    // Question:Why do we have to copy to be able perform search!?
    CharString sourceCopy(source);
    CharString queryCopy(query);

    Finder<CharString> directFinder(sourceCopy);
    Pattern<CharString, DPSearch<SimpleScore> > pattern(queryCopy,
SimpleScore(0, -2, -1));
    while (seqan::find(directFinder, pattern, minScore)) {
        while (seqan::findBegin(directFinder, pattern, getScore(pattern))) {
            // Question: how do I get the score of the alignment?
            SearchResult r(beginPosition(directFinder),  true);
            results.push_back(r);
        }
    }

    seqan::reverseComplement(queryCopy);
    Pattern<CharString, DPSearch<SimpleScore> > revPattern(queryCopy,
SimpleScore(0, -2, -1));

    Finder<CharString> revFinder(sourceCopy);
    while (seqan::find(revFinder, revPattern, minScore)) {
        while (seqan::findBegin(revFinder, revPattern, getScore(revPattern))) {
            SearchResult r(beginPosition(revFinder),  false);
            results.push_back(r);
        }
    }

    return results;
}

Questions are the following:
1) How is it possible to instance Pattern and Finder objects using
const references? Code doesn't compile if I am not copying the
sequences.
2) How can I get the score of the alignment (while iterating over
pattern results)?
3) Is there an easier way to search for pattern in reverse complement sequence?

Env: Ubuntu 12.04, gcc 4.7, seqan rev 13572

Thanks in advance,
   Konstantin



<-- thread -->
<-- date -->
  • seqan-dev - February 2013 - Archives indexes sorted by:
    [ thread ] [ subject ] [ author ] [ date ]
  • Complete archive of the seqan-dev mailing list
  • More info on this list...

Hilfe

  • FAQ
  • Dienstbeschreibung
  • ZEDAT Beratung
  • postmaster@lists.fu-berlin.de

Service-Navigation

  • Startseite
  • Listenauswahl

Einrichtung Mailingliste

  • ZEDAT-Portal
  • Mailinglisten Portal