-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
301 lines (244 loc) · 9.31 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
NAME
perlcyc - A Perl interface for Pathway Tools software for UNIX-based
systems.
SYNOPSIS
perlcyc is a Perl interface for Pathway Tools software. Pathway Tools
software needs to run a special socket server program for this module to
work (see below).
"use perlcyc;"
"my $cyc = perlcyc -> new("ARA");" "my @pathways = $cyc ->
all_pathways();"
PATHWAY TOOLS REQUIREMENTS
To use the Perl module, you also need the socket_server.lisp program. In
Pathway Tools version 8.0 or later, the server program can be started
with the command line option "-api". On earlier versions, the server
daemon needs to be loaded manually, as follows: start Pathway-Tools with
the -lisp option, at the prompt, type: (load
"/path/to/socket_server.lisp"), then start the socket_server by typing
(start_external_access_daemon :verbose? t). The server is now ready to
accept connections and queries.
DESCRIPTION
perlcyc.pm is a Perl module for accessing internal Pathway-Tools
functions. For the description of what the individual functions do,
please refer to the Pathway Tools documentation at
http://bioinformatics.ai.sri.com/ptools .
In general, the Lisp function name has to be converted to something
compatible with Perl: Dashes have to be replaced by underlines, and
question marks with underline p (_p).
Note that the optional parameters of all functions are not supported in
perlcyc, except for all_pathways() which can use the optional arguments
:all T to get the base pathways only (no super-pathways).
Limitations
Perlcyc does not run on Windows, because perlcyc creates a file system
socket that is not supported in Windows. It should run in Solaris,
Linux, MacOSX and other UNIX-like operating systems.
Perlcyc does not implement the GFP objects in Perl; it just sends
snippets of code to Pathway-Tools through the file socket connection.
Because of this, only one such connection can be openend at any given
time.
Given that the objects are not implemented in Perl, only object
references are supported.
Available functions:
Object functions:
new
Parameters: The knowledge base name. Required!
GFP functions:
More information on these functions can be found at:
http://www.ai.sri.com/~gfp/spec/paper/node63.html
get_slot_values
get_slot_value
get_class_all_instances
instance_all_instance_of_p
member_slot_value_p
fequal
current_kb
put_slot_values
put_slot_value
add_slot_value
replace_slot_value
remove_slot_value
coercible_to_frame_p
class_all_type_of_p
get_instance_direct_types
get_instance_all_types
get_frame_slots
put_instance_types
save_kb
revert_kb
Pathway-tools functions:
More information on these functions can be found at:
http://bioinformatics.ai.sri.com/ptools/ptools-fns.html
select_organism
all_pathways
all_orgs
all_rxns
genes_of_reaction
substrates_of_reaction
enzymes_of_reaction
reaction_reactants_and_products
get_predecessors
get_successors
genes_of_pathway
enzymes_of_pathway
compounds_of_pathway
substrates_of_pathway
transcription_factor_p
all_cofactors
all_modulators
monomers_of_protein
components_of_protein
genes_of_protein
reactions_of_enzyme
enzyme_p
transport_p
containers_of
modified_forms
modified_containers
top_containers
reactions_of_protein
regulon_of_protein
transcription_units_of_protein
regulator_proteins_of_transcription_unit
enzymes_of_gene
all_products_of_gene
reactions_of_gene
pathways_of_gene
chromosome_of_gene
transcription_unit_of_gene
transcription_unit_promoter
transcription_unit_genes
transcription_unit_binding_sites
transcription_unit_transcription_factors
transcription_unit_terminators
all_transported_chemicals
reactions_of_compound
full_enzyme_name
enzyme_activity_name
find_indexed_frame
create-instance
create-class
create-frame
pwys-of-organism-in-meta
enzymes-of-organism-in-meta
lower-taxa-or-species-p org-frame
get-class-all-subs
added 5/2008 per Suzanne's request:
genes-regulating-gene
genes-regulated-by-gene
terminators-affecting-gene
transcription-unit-mrna-binding-sites
transcription-unit-activators
transcription-unit-inhibitors
containing-tus
direct-activators
direct-inhibitors
not supported:
get_frames_matching_value (why not?)
Internal functions:
parselisp
send_query
retrieve_results
wrap_query
call_func
debug
debug_on
debug_off
Deprecated functions
parse_lisp_list
EXAMPLES
Change product type for all genes that are in a pathway to 'Enzyme'
use perlcyc;
my $cyc = perlcyc -> new ("ARA");
my @pathways = $cyc -> all_pathways();
foreach my $p (@pathways) {
my @genes = $cyc -> genes_of_pathway($p);
foreach my $g (@genes) {
$cyc -> put_slot_value ($g, "Product-Types", "Enzyme");
}
}
Load a file containing two columns with accession and a comment into the
comment field of the corresponding accession:
use perlcyc;
use strict;
my $file = shift;
my $added=0;
my $recs =0;
open (F, "<$file") || die "Can't open file\n";
print STDERR "Connecting to AraCyc...\n";
my $cyc = perlcyc -> new("ARA");
print STDERR "Getting Gene Information...\n";
my @genes = $cyc -> get_class_all_instances("|Genes|");
my %genes;
print STDERR "Getting common names...\n";
foreach my $g (@genes) {
my $cname = $cyc -> get_slot_value($g, "common-name");
$genes{$cname}=$g;
}
print STDERR "Processing file...\n";
while (<F>) {
my ($locus, $location, @rest) = split /\t/;
$recs++;
if (exists $genes{$locus}) {
my $product = $cyc -> get_slot_value($genes{$locus}, "product");
if ($product) {
$cyc -> add_slot_value($product, "comment", "\"\nTargetP location: $location\n\"");
#print STDERR "Added to description of frame $product\n";
$added++;
}
}
}
close (F);
print STDERR "Done. Added $added descriptions. Total lines in file: $recs. \n";
Add a locus link to the TAIR locus page for each gene in the database
use strict;
use perlcyc;
my $added =0;
my $genesprocessed=0;
print "Connecting to AraCyc...\n";
my $cyc = perlcyc -> new ("ARA");
print "Getting Gene Information...\n";
my @genes = $cyc -> get_class_all_instances ("|Genes|");
print "Adding TAIR links...\n";
foreach my $g (@genes) {
$genesprocessed++;
my $common_name = $cyc -> get_slot_value($g, "common-name");
if ($common_name && ($common_name ne "NIL")) {
$cyc -> put_slot_value ($g, "dblinks", "(TAIR \"$common_name\")");
$added++;
}
if ((!$genesprocessed ==0) && ($genesprocessed % 1000 == 0)) { print "$genesprocessed ";}
}
print "Done. Processed $genesprocessed genes and added $added links. Thanks!\n";
$cyc -> close();
TROUBLESHOOTING
If your program terminates with the following error message: "connect:
No such file or directory at perlcyc.pm line 166." then the
lisp_server.lisp module in Pathway Tools is not running. Refer to
http://aracyc.stanford.edu for more information on how to run the server
program.
Please send bug reports and comments to [email protected]
LICENSE
According to the MIT License,
http://www.opensource.org/licenses/mit-license.php
Copyright (c) 2002 by Lukas Mueller, The Arabidopsis Information
Resource (TAIR) and the Carnegie Institution of Washington.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
AUTHOR
Lukas Mueller <[email protected]>
ACKNOWLEDGMENTS
Many thanks to Suzanne Paley, Danny Yoo and Thomas Yan.