| Example Program Motif Finder Examples for how to start a motif search using SeqAn's Motif Finder. File "find_motif.cpp"
1 | #define SEQAN_DEBUG
2 | #define SEQAN_TEST
3 |
4 | #include "seqan/find_motif.h"
5 |
6 | using namespace seqan;
7 |
8 | int main()
9 | {
10 | SEQAN_TREPORT("TEST BEGIN")
11 |
12 | srand((unsigned) time(NULL));
13 |
Motif search on a small set of nucleotide sequences.
14 | unsigned int t = 3; //number of input sequences
15 | unsigned int n = 6; //length of sequence
16 | unsigned int l = 4; //length of motif
17 | unsigned int d = 1; //number of substitutions
18 | bool is_exact = true; //size of Hamming distance
19 | unsigned int h = 0; //size of the neighborhood considering at first
20 |
21 | String<DnaString> dataset;
22 | appendValue(dataset,DnaString("ACAGCA"));
23 | appendValue(dataset,DnaString("AGGCAG"));
24 | appendValue(dataset,DnaString("TCAGTC"));
25 |
Application of ePatternBranching (h=0)
26 | MotifFinder<Dna, EPatternBranching> finder_epb1(t,l,d,is_exact,h);
27 | findMotif(finder_epb1,dataset,OMOPS());
28 | displayResult(finder_epb1);
29 |
Application of ePatternBranching (h=0)
30 | MotifFinder<Dna, EPatternBranching> finder_epb2(t,l,d,is_exact,h);
31 | findMotif(finder_epb2,dataset,OOPS());
32 | displayResult(finder_epb2);
33 |
Application of PMS1-ZOOPS
34 | MotifFinder<Dna, PMS1> finder_pms1(l,d,is_exact);
35 | findMotif(finder_pms1,dataset,ZOOPS());
36 | displayResult(finder_pms1);
37 |
Application of PMSP-TCM
38 | MotifFinder<Dna, PMSP> finder_pmsp(l,d,is_exact);
39 | findMotif(finder_pmsp,dataset,TCM());
40 | displayResult(finder_pmsp);
41 |
Application of PROJECTION-OOPS
42 | unsigned int m = t*(n-l+1);
43 | MotifFinder<Dna, Projection> finder_proj(t,l,m,d,is_exact);
44 | findMotif(finder_proj, dataset, OOPS());
45 | displayResult(finder_proj);
46 |
Application of PROJECTION-OMOPS
47 | MotifFinder<Dna, Projection> finder_proj_omops(t,l,m,d,is_exact);
48 | findMotif(finder_proj_omops, dataset, OMOPS());
49 | displayResult(finder_proj_omops);
50 |
Application of PROJECTION-ZOOPS
51 | MotifFinder<Dna, Projection> finder_proj_zoops(t,l,m,d,is_exact);
52 | findMotif(finder_proj_zoops, dataset, ZOOPS());
53 | displayResult(finder_proj_zoops);
54 |
Application of PROJECTION-TCM
55 | MotifFinder<Dna, Projection> finder_proj_tcm(t,l,m,d,is_exact);
56 | findMotif(finder_proj_tcm, dataset, TCM());
57 | displayResult(finder_proj_tcm);
58 |
59 | SEQAN_TREPORT("TEST END")
60 | return 0;
61 | }
Output projects/tests/find_motif/test_find_motif.cpp(10): TEST BEGIN [0]: AGCC [0]: AGCC [0]: AAGC [1]: ACAG [2]: AGAC [3]: AGCC [4]: AGGA [5]: AGTA [6]: CAGA [7]: CAGG [8]: CCAG [9]: CGCA [10]: CGGC [11]: GCAG [12]: TCAG [13]: TGCA [0]: AAGC [1]: AAGT [2]: AATC [3]: ACAG [4]: ACGC [5]: ACTC [6]: AGAC [7]: AGCA [8]: AGCC [9]: AGGA [10]: AGGC [11]: AGGG [12]: AGGT [13]: AGTA [14]: AGTC [15]: AGTG [16]: AGTT [17]: ATGC [18]: ATTC [19]: CAAT [20]: CACT [21]: CAGA [22]: CAGC [23]: CAGG [24]: CATT [25]: CCAG [26]: CCGT [27]: CGCA [28]: CGGC [29]: CGGT [30]: CGTC [31]: CTGT [32]: GAAG [33]: GACA [34]: GAGT [35]: GCAA [36]: GCAC [37]: GCAG [38]: GCAT [39]: GCCA [40]: GCCG [41]: GCGG [42]: GCTG [43]: GGAA [44]: GGAG [45]: GGCC [46]: GGCG [47]: GGCT [48]: GGGA [49]: GGGC [50]: GGTA [51]: GGTC [52]: GTAG [53]: GTCA [54]: TAAG [55]: TAGT [56]: TCAA [57]: TCAC [58]: TCAG [59]: TCAT [60]: TCCG [61]: TCGG [62]: TCTG [63]: TGAG [64]: TGCA [65]: TGGC [66]: TGTC [67]: TTAG AGCC AGCC TCAG TCAG projects/tests/find_motif/test_find_motif.cpp(82): TEST END See findMotif, MotifFinder SeqAn - Sequence Analysis Library - www.seqan.de