2 perlcyc - A Perl interface for Pathway Tools software for UNIX-based
6 perlcyc is a Perl interface for Pathway Tools software. Pathway Tools
7 software needs to run a special socket server program for this module to
12 "my $cyc = perlcyc -> new("ARA");" "my @pathways = $cyc ->
15 PATHWAY TOOLS REQUIREMENTS
16 To use the Perl module, you also need the socket_server.lisp program. In
17 Pathway Tools version 8.0 or later, the server program can be started
18 with the command line option "-api". On earlier versions, the server
19 daemon needs to be loaded manually, as follows: start Pathway-Tools with
20 the -lisp option, at the prompt, type: (load
21 "/path/to/socket_server.lisp"), then start the socket_server by typing
22 (start_external_access_daemon :verbose? t). The server is now ready to
23 accept connections and queries.
26 perlcyc.pm is a Perl module for accessing internal Pathway-Tools
27 functions. For the description of what the individual functions do,
28 please refer to the Pathway Tools documentation at
29 http://bioinformatics.ai.sri.com/ptools .
31 In general, the Lisp function name has to be converted to something
32 compatible with Perl: Dashes have to be replaced by underlines, and
33 question marks with underline p (_p).
35 Note that the optional parameters of all functions are not supported in
36 perlcyc, except for all_pathways() which can use the optional arguments
37 :all T to get the base pathways only (no super-pathways).
40 Perlcyc does not run on Windows, because perlcyc creates a file system
41 socket that is not supported in Windows. It should run in Solaris,
42 Linux, MacOSX and other UNIX-like operating systems.
44 Perlcyc does not implement the GFP objects in Perl; it just sends
45 snippets of code to Pathway-Tools through the file socket connection.
46 Because of this, only one such connection can be openend at any given
49 Given that the objects are not implemented in Perl, only object
50 references are supported.
56 Parameters: The knowledge base name. Required!
59 More information on these functions can be found at:
60 http://www.ai.sri.com/~gfp/spec/paper/node63.html
64 get_class_all_instances
65 instance_all_instance_of_p
76 get_instance_direct_types
77 get_instance_all_types
83 Pathway-tools functions:
84 More information on these functions can be found at:
85 http://bioinformatics.ai.sri.com/ptools/ptools-fns.html
92 substrates_of_reaction
94 reaction_reactants_and_products
100 substrates_of_pathway
101 transcription_factor_p
105 components_of_protein
116 transcription_units_of_protein
117 regulator_proteins_of_transcription_unit
123 transcription_unit_of_gene
124 transcription_unit_promoter
125 transcription_unit_genes
126 transcription_unit_binding_sites
127 transcription_unit_transcription_factors
128 transcription_unit_terminators
129 all_transported_chemicals
130 reactions_of_compound
138 pwys-of-organism-in-meta
139 enzymes-of-organism-in-meta
140 lower-taxa-or-species-p org-frame
143 added 5/2008 per Suzanne's request:
144 genes-regulating-gene
145 genes-regulated-by-gene
146 terminators-affecting-gene
147 transcription-unit-mrna-binding-sites
148 transcription-unit-activators
149 transcription-unit-inhibitors
157 get_frames_matching_value (why not?)
174 Change product type for all genes that are in a pathway to 'Enzyme'
178 my $cyc = perlcyc -> new ("ARA");
179 my @pathways = $cyc -> all_pathways();
181 foreach my $p (@pathways) {
182 my @genes = $cyc -> genes_of_pathway($p);
183 foreach my $g (@genes) {
184 $cyc -> put_slot_value ($g, "Product-Types", "Enzyme");
188 Load a file containing two columns with accession and a comment into the
189 comment field of the corresponding accession:
199 open (F, "<$file") || die "Can't open file\n";
201 print STDERR "Connecting to AraCyc...\n";
202 my $cyc = perlcyc -> new("ARA");
204 print STDERR "Getting Gene Information...\n";
205 my @genes = $cyc -> get_class_all_instances("|Genes|");
209 print STDERR "Getting common names...\n";
210 foreach my $g (@genes) {
211 my $cname = $cyc -> get_slot_value($g, "common-name");
215 print STDERR "Processing file...\n";
217 my ($locus, $location, @rest) = split /\t/;
219 if (exists $genes{$locus}) {
220 my $product = $cyc -> get_slot_value($genes{$locus}, "product");
222 $cyc -> add_slot_value($product, "comment", "\"\nTargetP location: $location\n\"");
223 #print STDERR "Added to description of frame $product\n";
231 print STDERR "Done. Added $added descriptions. Total lines in file: $recs. \n";
233 Add a locus link to the TAIR locus page for each gene in the database
239 my $genesprocessed=0;
241 print "Connecting to AraCyc...\n";
242 my $cyc = perlcyc -> new ("ARA");
244 print "Getting Gene Information...\n";
245 my @genes = $cyc -> get_class_all_instances ("|Genes|");
247 print "Adding TAIR links...\n";
248 foreach my $g (@genes) {
250 my $common_name = $cyc -> get_slot_value($g, "common-name");
251 if ($common_name && ($common_name ne "NIL")) {
252 $cyc -> put_slot_value ($g, "dblinks", "(TAIR \"$common_name\")");
255 if ((!$genesprocessed ==0) && ($genesprocessed % 1000 == 0)) { print "$genesprocessed ";}
258 print "Done. Processed $genesprocessed genes and added $added links. Thanks!\n";
262 If your program terminates with the following error message: "connect:
263 No such file or directory at perlcyc.pm line 166." then the
264 lisp_server.lisp module in Pathway Tools is not running. Refer to
265 http://aracyc.stanford.edu for more information on how to run the server
268 Please send bug reports and comments to lam87@cornell.edu
271 According to the MIT License,
272 http://www.opensource.org/licenses/mit-license.php
274 Copyright (c) 2002 by Lukas Mueller, The Arabidopsis Information
275 Resource (TAIR) and the Carnegie Institution of Washington.
277 Permission is hereby granted, free of charge, to any person obtaining a
278 copy of this software and associated documentation files (the
279 "Software"), to deal in the Software without restriction, including
280 without limitation the rights to use, copy, modify, merge, publish,
281 distribute, sublicense, and/or sell copies of the Software, and to
282 permit persons to whom the Software is furnished to do so, subject to
283 the following conditions:
285 The above copyright notice and this permission notice shall be included
286 in all copies or substantial portions of the Software.
288 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
289 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
290 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
291 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
292 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
293 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
294 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
297 Lukas Mueller <lam87@cornell.edu>
300 Many thanks to Suzanne Paley, Danny Yoo and Thomas Yan.