00001 #include "dnpsearchalgo.h"
00002 #include <qinputdialog.h>
00003 #include <limits>
00004
00005 using namespace std;
00006
00007 void DnpSearchAlgo::start()
00008 {
00009 bool ok;
00010 int res = QInputDialog::getInteger(
00011 "Search DNP ID", "Enter ID:", 0, 0, numeric_limits<int>::max(), 1,
00012 &ok, 0 );
00013
00014 if ( ok ) {
00015
00016 for( size_t i = 0; i < getMAl()->get_num_seq(); i++ ) {
00017 bool found(false);
00018 for( size_t j = 0; j < getMAl()->get_len(i); j++ ) {
00019 if ( getMAl()->is_DNP( i, j ) && getMAl()->get_DNP_ID(i, j) == res ) {
00020 found = true;
00021 break;
00022 }
00023 }
00024 if ( !found )
00025 getMAl()->select_read(i, false);
00026 }
00027
00028 } else {
00029
00030 return;
00031 }
00032
00033 }