1 /* @source fuzzpro application
2 **
3 ** Finds fuzzy patterns in proteins
4 ** @author Copyright (C) Alan Bleasby (ableasby@hgmp.mrc.ac.uk)
5 ** @@
6 **
7 ** This program is free software; you can redistribute it and/or
8 ** modify it under the terms of the GNU General Public License
9 ** as published by the Free Software Foundation; either version 2
10 ** of the License, or (at your option) any later version.
11 **
12 ** This program is distributed in the hope that it will be useful,
13 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 ** GNU General Public License for more details.
16 **
17 ** You should have received a copy of the GNU General Public License
18 ** along with this program; if not, write to the Free Software
19 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
20 ******************************************************************************/
21 
22 #include "emboss.h"
23 
24 
25 
26 
27 /* @prog fuzzpro **************************************************************
28 **
29 ** Protein pattern search
30 **
31 ******************************************************************************/
32 
main(int argc,char ** argv)33 int main(int argc, char **argv)
34 {
35     AjPSeqall seqall = NULL;
36     AjPSeq seq = NULL;
37     AjPFeattable tab = NULL;
38     AjPReport report = NULL;
39     AjPStr tmpstr = NULL;
40     AjPPatlistSeq plist = NULL;
41     AjBool writeok = ajTrue;
42     ajuint nseq = 0;
43 
44     embInit("fuzzpro", argc, argv);
45 
46     seqall   = ajAcdGetSeqall("sequence");
47     report   = ajAcdGetReport("outfile");
48     plist    = ajAcdGetPattern("pattern");
49 
50     ajPatlistSeqDoc(plist, &tmpstr);
51     ajReportSetHeaderS(report, tmpstr);
52 
53     writeok=ajTrue;
54     while(writeok && ajSeqallNext(seqall,&seq))
55     {
56         if(!nseq++)
57             tab = ajFeattableNewProt(ajSeqGetNameS(seq));
58         else
59             ajFeattableReset(tab, ajSeqGetNameS(seq));
60 
61         embPatlistSeqSearchAll(tab,seq,plist,ajFalse);
62 	if(ajFeattableGetSize(tab))
63 	    writeok = ajReportWrite(report,tab,seq);
64     }
65     ajReportSetSeqstats(report, seqall);
66 
67     ajPatlistSeqDel(&plist);
68 
69     ajStrDel(&tmpstr);
70 
71     ajReportClose(report);
72     ajReportDel(&report);
73     ajSeqallDel(&seqall);
74     ajSeqDel(&seq);
75     ajFeattableDel(&tab);
76 
77     embExit();
78 
79     return 0;
80 }
81 
82