1 /* @source wossdata application
2 **
3 ** Finds programs by EDAM data
4 **
5 ** @author Copyright (C) Gary Williams (gwilliam@hgmp.mrc.ac.uk)
6 ** @author Copyright (C) Peter Rice (pmr@ebi.ac.uk)
7 ** @@
8 **
9 ** This program is free software; you can redistribute it and/or
10 ** modify it under the terms of the GNU General Public License
11 ** as published by the Free Software Foundation; either version 2
12 ** of the License, or (at your option) any later version.
13 **
14 ** This program is distributed in the hope that it will be useful,
15 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 ** GNU General Public License for more details.
18 **
19 ** You should have received a copy of the GNU General Public License
20 ** along with this program; if not, write to the Free Software
21 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
22 ******************************************************************************/
23 
24 #include "emboss.h"
25 
26 
27 
28 
29 /* @prog wossdata ************************************************************
30 **
31 ** Finds programs by EDAM data
32 **
33 ******************************************************************************/
34 
main(int argc,char ** argv,char ** env)35 int main(int argc, char **argv, char **env)
36 {
37 
38     AjPList newlist = NULL;
39     AjPList glist;    /* list of groups pointing to lists of programs */
40     AjPList alpha;    /* alphabetical list of all programs */
41     AjPFile outfile = NULL;
42     AjPStr search   = NULL;
43     AjBool showkey;
44     AjBool html;
45     AjBool groups;
46     AjBool alphabetic;
47     AjBool emboss;
48     AjBool embassy;
49     AjBool explode;
50     AjBool colon;
51     AjBool gui;
52     AjPStr showembassy;
53     AjBool sensitive = ajFalse;
54     AjBool subclasses = ajTrue;
55     AjBool obsolete = ajFalse;
56 
57     embInit("wossdata", argc, argv);
58 
59     search     = ajAcdGetString("identifier");
60     outfile    = ajAcdGetOutfile("outfile");
61     html       = ajAcdGetToggle("html");
62     showkey    = ajAcdGetBoolean("showkeywords");
63     groups     = ajAcdGetBoolean("groups");
64     alphabetic = ajAcdGetBoolean("alphabetic");
65     emboss     = ajAcdGetBoolean("emboss");
66     embassy    = ajAcdGetBoolean("embassy");
67     showembassy = ajAcdGetString("showembassy");
68     explode    = ajAcdGetBoolean("explode");
69     colon      = ajAcdGetBoolean("colon");
70     gui        = ajAcdGetBoolean("gui");
71     sensitive = ajAcdGetBoolean("sensitive");
72     subclasses = ajAcdGetBoolean("subclasses");
73     obsolete = ajAcdGetBoolean("obsolete");
74 
75 
76     glist = ajListNew();
77     alpha = ajListNew();
78 
79     /* get the groups and program information */
80     embGrpGetProgGroups(glist, alpha, env, emboss, embassy, showembassy,
81 			explode, colon, gui);
82 
83 
84     /* is a search string specified */
85     newlist = ajListNew();
86     if(alphabetic)
87         embGrpSearchProgsEdam(newlist, alpha, search, "data",
88                               sensitive, subclasses, obsolete);
89     else
90         embGrpSearchProgsEdam(newlist, glist, search, "data",
91                               sensitive, subclasses, obsolete);
92 
93 
94     embGrpOutputGroupsList(outfile, newlist, !groups, html,
95                            showkey, showembassy);
96 
97     ajFileClose(&outfile);
98 
99     embGrpGroupsListDel(&newlist);
100     embGrpGroupsListDel(&glist);
101     embGrpGroupsListDel(&alpha);
102 
103     ajFileClose(&outfile);
104     ajStrDel(&search);
105     ajStrDel(&showembassy);
106 
107     embExit();
108 
109     return 0;
110 }
111 
112