5 A Java interface for Pathway Tools software. Pathway Tools software
6 needs to run a special socket server program for Javacyc to work.
9 Javacyc is a Java interface for Pathway Tools software.
10 Javacyc cyc = new Javacyc("ARA");
11 ArrayList pathways = cyc.allPathways();
14 Version 0.2 August 1, 2004
18 0.1 June 6, 2003 initial version
19 0.2 August 1, 2004 fixed a socket close bug in the C code
22 The Javacyc class uses native methods in order to access AF_UNIX sockets for
23 interprocess communication. Javacyc can be installed by using the included
26 If you choose not to use the makefile, below is an example of how to
27 compile Javacyc. The example assumes that the path to the Java directory is
28 /usr/java and that the platform is solaris:
29 javac UnixDomainSocket.java
30 javah UnixDomainSocket
31 gcc -c -fPIC -I/usr/java/include -I/usr/java/include/solaris/ UnixDomainSoceket.c
32 gcc -shared -o libunixdomainsocket.so UnixDomainSocket.o
35 IMPORTANT NOTE: In order for Javacyc to work, ensure that the environment
36 variable, LD_LIBRARY_PATH, includes the directory where libunixdomainsocket.so
40 Javacyc is a Java class for accessing internal Pathway Tools functions.
41 For a description of what the individual functions do, please refer to the
42 Pathway Tools documentation at http://bioinformatics.ai.sri.com/ptools .
44 Note that optional parameters of all functions are not supported in Javacyc.
47 Javacyc does not implement GFP objects in Java. It sends snippets of code to
48 Pathway Tools through a socket connection. Only one connection may be opened
49 at any given time. The returned values are of type boolean, String, ArrayList,
50 and ArrayLists that contain ArrayLists for functions that return multiple
51 lists. A list of available functions is given below.
53 GFP functions: (More information on these functions can be found at:
54 http://www.ai.sri.com/~gfp/spec/paper/node63.html )
57 get-class-slot-slotvalue
58 get-class-all-instances
59 instance-all-instance-of-p
69 get-instance-direct-types
70 get-instance-all-types
77 Pathway Tools functions: (More information on these functions can be found at
78 http://bioinformatics.ai.sri.com/ptools/ptools-fns.html)
84 substrates-of-reaction
87 reaction-reactants-and-products
95 all-transcription-factors
100 components-of-protein
111 transcription-units-of-protein
112 regulator-proteins-of-transcription-unit
118 transcription-units-of-gene
119 transcription-unit-promoter
120 transcription-unit-genes
121 transcription-unit-binding-sites
122 transcription-unit-transcription-factors
123 transcription-unit-terminators
124 all-transported-chemicals
125 reactions-of-compounds
131 A program to test Javacyc.
134 import java.util.ArrayList;
137 public class JavacycTest
139 public static void printLists(ArrayList list)
141 for (int i = 0; i < list.size(); i++)
143 Object obj = list.get(i);
144 if (obj instanceof String)
146 String str = (String)obj;
147 System.out.println(str);
149 else if (obj instanceof ArrayList)
151 System.out.println("*begin inner list*");
152 ArrayList aList = (ArrayList)obj;
154 System.out.println("*end inner list*");
158 System.out.println("WARNING THIS SHOULD NOT HAPPEN!");
163 public static void main(String[] args) throws IOException
165 Javacyc cyc = new Javacyc("ARA");
166 BufferedReader in = new BufferedReader(
167 new InputStreamReader(System.in));
169 // test a function that returns a boolean
170 System.out.println("Testing a function that returns a boolean: "
171 + "coercible-to-frame-p");
172 System.out.print("Enter a value for frame: ");
173 String thing = in.readLine();
174 boolean result1 = cyc.coercibleToFrameP(thing);
177 System.out.println("The result: true\n");
181 System.out.println("The result: false\n");
184 // test a function that returns a string
185 System.out.println("Testing a function that returns a string: "
186 + "full-enzyme-name");
187 System.out.print("Enter a value for enzyme: ");
188 String enzyme = in.readLine();
189 String result2 = cyc.fullEnzymeName(enzyme);
190 System.out.println("The result: " + result2 +"\n");
192 // test a function that returns an ArrayList
193 System.out.println("Testing a function that returns an ArrayList: "
194 + "genes-of-pathway 'PWY-581");
195 ArrayList result3 = cyc.genesOfPathway("PWY-581");
196 System.out.println("The returned values: ");
197 for (int i = 0; i < result3.size(); i++)
199 String rxn = (String)result3.get(i);
200 System.out.println(rxn);
203 // test a function that returns multiple lists
204 System.out.println("\nTesting a function that returns multiple"
205 + " lists: reaction-reactants-and-products");
206 System.out.print("Enter a value for reaction: ");
207 String rxn = in.readLine();
208 System.out.print("Enter a value for pathway: ");
209 String pwy = in.readLine();
210 ArrayList result4 = cyc.reactionReactantsAndProducts(rxn, pwy);
211 System.out.println("The returned values: ");
217 Please send bug reports and comments to curator@arabidopsis.org
220 Javacyc, a Java interface for Pathway Tools software
221 Copyright (c) 2003 by Thomas Yan, The Arabidopsis Information Resource (TAIR)
222 and the Carnegie Institution of Washingtion.
224 This library is free software; you can redistribute it and/or
225 modify it under the terms of version 2.1 of the GNU Lesser General
226 Public License as published by the Free Software Foundation.
228 This library is distributed in the hope that it will be useful,
229 but WITHOUT ANY WARRANTY; without even the implied warranty of
230 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
231 Lesser General Public License for more details:
233 http://www.opensource.org/licenses/lgpl-license.html
234 http://www.gnu.org/copyleft/lesser.html
236 To obtain a written copy of the GNU Lesser General Public License,
237 please write to the Free Software Foundation, Inc., 59 Temple Place,
238 Suite 330, Boston, MA 02111-1307 USA
241 Javacyc uses native methods to access AF_UNIX sockets provided by J-BUDS,
242 which was released by Echogent Systems under the GNU Lesser General Public
243 License. See the JBUDS_COPYRIGHT for details.
249 Many thanks to Lukas Mueller and Danny Yoo.