4 use CXGN
::Page
::FormattingHelpers qw
| info_section_html
|;
5 my $p = CXGN
::Page
->new();
7 $p->header("PerlCyc.pm", "PerlCyc.pm");
9 print info_section_html
(title
=>"Description", contents
=> <<HTML );
12 PerlCyc is a Perl interface for <a href="http://bioinformatics.ai.sri.com/ptools/">Pathway Tools software</a>. It allows internal Pathay Tools Lisp functions to be accessed through Perl. <br /><br />
14 For a description of what the individual functions do, please
15 refer to the Pathway Tools documentation at http://bioinformat-
16 ics.ai.sri.com/ptools .
18 In general, the Lisp function name has to be converted to something
19 compatible with Perl: Dashes have to be replaced by underlines, and
20 question marks with underline p (_p).
22 Note that the optional parameters of all functions
23 are not supported in perlcyc, except for all_pathways() which can
24 use the optional arguments :all T to get the base pathways only (no
29 print info_section_html
(title
=>"Installation", contents
=> <<HTML );
31 Installation is standard as for any Perl module. If you downloaded the
32 compressed tar file, uncompress and untar the file with the following
35 gzip < perlcyc.tar.gz | tar xvf -
37 This will create a directory called perlcyc in your current directory.
38 To install the program, type
43 The program should now be available in all your Perl programs. "make
44 install" may require root access or access through sudo. For the latter
49 You will be prompted for your password.
53 print info_section_html
(title
=>"Limitations", contents
=><<HTML);
55 Perlcyc does not implement the GFP objects in Perl, rather it just
56 sends snippets of code to Pathway-Tools through a socket connection.
57 Only one such connection can be openend at any given time. Because the
58 objects are not implemented in Perl, only object references are supported.
62 print info_section_html
(title
=>"Supported functions", contents
=><<HTML);
69 Parameters: The knowledge base name. Required!
71 GFP functions: More information on these functions can be found at:
72 http://www.ai.sri.com/~gfp/spec/paper/node63.html
76 get_class_all_instances
77 instance_all_instance_of_p
88 get_instance_direct_types
89 get_instance_all_types
95 Pathway-tools functions: More information on these functions can be
96 found at: http://bioinformatics.ai.sri.com/ptools/ptools-fns.html
103 substrates_of_reaction
105 reaction_reactants_and_products
111 substrates_of_pathway
112 transcription_factor_p
116 components_of_protein
127 transcription_units_of_protein
128 regulator_proteins_of_transcription_unit
134 transcription_unit_of_gene
135 transcription_unit_promoter
136 transcription_unit_genes
137 transcription_unit_binding_sites
138 transcription_unit_transcription_factors
139 transcription_unit_terminators
140 all_transported_chemicals
141 reactions_of_compound
149 pwys-of-organism-in-meta
150 enzymes-of-organism-in-meta
151 lower-taxa-or-species-p org-frame
154 added 5/2008 per Suzanne\'s request:
156 genes-regulating-gene
157 genes-regulated-by-gene
158 terminators-affecting-gene
159 transcription-unit-mrna-binding-sites
160 transcription-unit-activators
161 transcription-unit-inhibitors
168 get_frames_matching_value (why not?)
188 print info_section_html
(title
=>"Requirements", contents
=> <<HTML );
190 To use the Perl module, you also need the socket_server.lisp program.
191 In Pathway Tools version 8.0 or later, the server program can be
192 started with the command line option "-api". On earlier versions, the
193 server daemon needs to be loaded manually, as follows: start Pathway-
194 Tools with the -lisp option, at the prompt, type: (load
195 "/path/to/socket_server.lisp"), then start the socket_server by typing
196 (start_external_access_daemon :verbose? t). The server is now ready to
197 accept connections and queries.
201 print info_section_html
(title
=>"Download", contents
=> <<HTML );
203 Download [<a href="ftp://ftp.sgn.cornell.edu/programs/perlcyc/">FTP</a>]
207 print info_section_html
(title
=>"Documentation", contents
=> <<HTML );
210 perlcyc is a Perl interface for Pathway Tools software.
214 "my \$cyc = perlcyc -> new("ARA");" "my \@pathways = \$cyc -> all_path-
218 Version 1.21 (May 2008).
225 [Lukas Mueller] initial version
228 [Danny Yoo] Added better list parsing
233 1.0 August 28, 2002 [Lukas Mueller]
234 Added pod documentation and eliminated some bugs.
237 [Thomas Yan] Fixed some minor bugs.
239 1.2 December 7, 2006 [Lukas Mueller]
240 Added three functions: create-frame, create-class, and cre-
243 1.21 May 7, 2008 [Lukas Mueller]
244 Added three functions that are new in PT v. 12:
245 pwys-of-organism-in-meta
246 enzymes-of-organism-in-meta
247 lower-taxa-or-species-p org-frame
252 genes-regulating-gene
253 genes-regulated-by-gene
254 terminators-affecting-gene
255 transcription-unit-mrna-binding-sites
256 transcription-unit-activators
257 transcription-unit-inhibitors
268 print info_section_html
(title
=>"Examples", contents
=> <<HTML );
270 Change product type for all genes that are in a pathway to "Enzyme"
275 my \$cyc = perlcyc -> new ("ARA");
276 my \@pathways = \$cyc -> all_pathways();
278 foreach my $p (\@pathways) {
279 my \@genes = \$cyc -> genes_of_pathway(\$p);
280 foreach my \$g (\@genes) {
281 \$cyc -> put_slot_value (\$g, "Product-Types", "Enzyme");
285 Load a file containing two columns with accession and a comment into
286 the comment field of the corresponding accession:
296 open (F, "<\$file") || die "Can't open file\\n";
298 print STDERR "Connecting to AraCyc...\\n";
299 my \$cyc = perlcyc -> new("ARA");
301 print STDERR "Getting Gene Information...\\n";
302 my \@genes = \$cyc -> get_class_all_instances("|Genes|");
306 print STDERR "Getting common names...\\n";
307 foreach my \$g (\@genes) {
308 my \$cname = \$cyc -> get_slot_value(\$g, "common-name");
309 \$genes{\$cname}=\$g;
312 print STDERR "Processing file...\\n";
314 my (\$locus, \$location, \@rest) = split /\\t/;
316 if (exists \$genes{\$locus}) {
317 my \$product = \$cyc -> get_slot_value(\$genes{\$locus}, "product");
319 \$cyc -> add_slot_value(\$product, "comment", "\"\\nTargetP location: \$location\\n\"");
320 #print STDERR "Added to description of frame \$product\n";
328 print STDERR "Done. Added \$added descriptions. Total lines in file: \$recs. \\n";
330 Add a locus link to the TAIR locus page for each gene in the database
336 my \$genesprocessed=0;
338 print "Connecting to AraCyc...\\n";
339 my \$cyc = perlcyc -> new ("ARA");
341 print "Getting Gene Information...\\n";
342 my \@genes = \$cyc -> get_class_all_instances ("|Genes|");
344 print "Adding TAIR links...\\n";
345 foreach my \$g (\@genes) {
347 my \$common_name = \$cyc -> get_slot_value(\$g, "common-name");
348 if (\$common_name && (\$common_name ne "NIL")) {
349 \$cyc -> put_slot_value (\$g, "dblinks", "(TAIR \"\$common_name\")");
352 if ((!\$genesprocessed ==0) && (\$genesprocessed % 1000 == 0)) { print "\$genesprocessed ";}
355 print "Done. Processed \$genesprocessed genes and added \$added links. Thanks!\\n";
361 print info_section_html
(title
=>"Troubleshooting", contents
=> <<HTML );
363 If your program terminates with the following error message: "connect:
364 No such file or directory at perlcyc.pm line 166." then the
365 lisp_server.lisp module in Pathway Tools is not running. Refer to
366 http://aracyc.stanford.edu for more information on how to run the
369 Please send bug reports and comments to LAM87\@cornell.edu
373 print info_section_html
(title
=>"License", contents
=> <<HTML );
376 According to the MIT License:<br />
377 http://www.open-source.org/licenses/mit-license.php
379 Copyright (c) 2002-2008 by Lukas Mueller, TAIR, BTI
381 Permission is hereby granted, free of charge, to any person obtaining a
382 copy of this software and associated documentation files (the "Soft-
383 ware"), to deal in the Software without restriction, including without
384 limitation the rights to use, copy, modify, merge, publish, distribute,
385 sublicense, and/or sell copies of the Software, and to permit persons
386 to whom the Software is furnished to do so, subject to the following
389 The above copyright notice and this permission notice shall be included
390 in all copies or substantial portions of the Software.
392 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
393 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MER-
394 CHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
395 NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
396 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
397 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFT-
398 WARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
402 Many thanks to Suzanne Paley, Danny Yoo and Thomas Yan.