Parent Directory
|
Revision Log
Revision 1.11 - (view) (download) (as text)
1 : | parrello | 1.1 | #!/usr/bin/perl -w |
2 : | |||
3 : | =head1 Load Sprout Tables | ||
4 : | |||
5 : | parrello | 1.3 | Create the load files for a group of Sprout tables. The parameters are the names of |
6 : | the table groups whose data is to be created. The legal table group names are given below. | ||
7 : | parrello | 1.1 | |
8 : | =over 4 | ||
9 : | |||
10 : | =item Genome | ||
11 : | |||
12 : | Loads B<Genome>, B<HasContig>, B<Contig>, B<IsMadeUpOf>, and B<Sequence>. | ||
13 : | |||
14 : | =item Coupling | ||
15 : | |||
16 : | Loads B<Coupling>, B<IsEvidencedBy>, B<PCH>, B<ParticipatesInCoupling>, | ||
17 : | B<UsesAsEvidence>. | ||
18 : | |||
19 : | =item Feature | ||
20 : | |||
21 : | Loads B<Feature>, B<FeatureAlias>, B<FeatureTranslation>, B<FeatureUpstream>, | ||
22 : | parrello | 1.2 | B<IsLocatedIn>, B<FeatureLink>. |
23 : | parrello | 1.1 | |
24 : | =item Subsystem | ||
25 : | |||
26 : | parrello | 1.2 | Loads B<Subsystem>, B<Role>, B<SSCell>, B<ContainsFeature>, B<IsGenomeOf>, |
27 : | parrello | 1.8 | B<IsRoleOf>, B<OccursInSubsystem>, B<ParticipatesIn>, B<HasSSCell>, |
28 : | parrello | 1.11 | B<Catalyzes>, B<ConsistsOfRoles>, B<RoleSubset>, B<HasRoleSubset>, |
29 : | parrello | 1.8 | B<ConsistsOfGenomes>, B<GenomeSubset>, B<HasGenomeSubset> |
30 : | parrello | 1.1 | |
31 : | parrello | 1.2 | =item Annotation |
32 : | |||
33 : | Loads B<SproutUser>, B<UserAccess>, B<Annotation>, B<IsTargetOfAnnotation>, | ||
34 : | B<MadeAnnotation>. | ||
35 : | |||
36 : | =item Diagram | ||
37 : | |||
38 : | Loads B<Diagram>, B<RoleOccursIn>. | ||
39 : | |||
40 : | =item Property | ||
41 : | |||
42 : | Loads B<Property>, B<HasProperty>. | ||
43 : | |||
44 : | =item BBH | ||
45 : | |||
46 : | Loads B<IsBidirectionalBestHitOf>. | ||
47 : | |||
48 : | parrello | 1.3 | =item Group |
49 : | |||
50 : | Loads B<GenomeGroups>. | ||
51 : | |||
52 : | =item Source | ||
53 : | |||
54 : | Loads B<Source>, B<ComesFrom>, B<SourceURL>. | ||
55 : | |||
56 : | parrello | 1.4 | =item External |
57 : | |||
58 : | Loads B<ExternalAliasOrg>, B<ExternalAliasFunc>. | ||
59 : | |||
60 : | parrello | 1.8 | =item Reaction |
61 : | |||
62 : | Loads B<ReactionURL>, B<Compound>, B<CompoundName>, | ||
63 : | parrello | 1.11 | B<CompoundCAS>, B<IsAComponentOf>, B<Reaction>. |
64 : | parrello | 1.8 | |
65 : | parrello | 1.3 | =item * |
66 : | |||
67 : | Loads all of the above tables. | ||
68 : | |||
69 : | parrello | 1.1 | =back |
70 : | |||
71 : | parrello | 1.7 | The command-line options are given below. |
72 : | parrello | 1.1 | |
73 : | =over 4 | ||
74 : | |||
75 : | =item geneFile | ||
76 : | |||
77 : | The name of the file containing the genomes and their associated access codes. The | ||
78 : | file should have one line per genome, each line consisting of the genome ID followed | ||
79 : | by the access code, separated by a tab. If no file is specified, all complete genomes | ||
80 : | will be processed and the access code will be 1. | ||
81 : | |||
82 : | =item subsysFile | ||
83 : | |||
84 : | The name of the file containing the trusted subsystems. The file should have one line | ||
85 : | per trusted subsystem. If no file is specified, all subsystems will be trusted. | ||
86 : | |||
87 : | =item trace | ||
88 : | |||
89 : | Desired tracing level. The default is 3. | ||
90 : | |||
91 : | parrello | 1.7 | =item limitedFeatures |
92 : | |||
93 : | Only generate the B<Feature> and B<IsLocatedIn> tables when processing the feature group. | ||
94 : | |||
95 : | parrello | 1.10 | =item dbLoad |
96 : | |||
97 : | If TRUE, the database tables will be loaded automatically from the load files created. | ||
98 : | |||
99 : | parrello | 1.1 | =back |
100 : | |||
101 : | =cut | ||
102 : | |||
103 : | use strict; | ||
104 : | use Tracer; | ||
105 : | use DocUtils; | ||
106 : | use Cwd; | ||
107 : | use FIG; | ||
108 : | use SFXlate; | ||
109 : | use File::Copy; | ||
110 : | use File::Path; | ||
111 : | use SproutLoad; | ||
112 : | use Stats; | ||
113 : | parrello | 1.9 | use SFXlate; |
114 : | parrello | 1.1 | |
115 : | # Get the command-line parameters and options. | ||
116 : | my ($options, @parameters) = Tracer::ParseCommand({ geneFile => "", subsysFile => "", | ||
117 : | parrello | 1.10 | trace => 3, limitedFeatures => 0, |
118 : | dbLoad => 0 }, @ARGV); | ||
119 : | parrello | 1.1 | # Set up tracing. |
120 : | parrello | 1.4 | TSetup("$options->{trace} SproutLoad ERDBLoad ERDB Stats Tracer Load", "+>$FIG_Config::temp/trace.log"); |
121 : | parrello | 1.9 | # Create the sprout loader object. Note that the Sprout object does not |
122 : | parrello | 1.10 | # open the database unless the "dbLoad" option is turned on. |
123 : | parrello | 1.1 | my $fig = FIG->new(); |
124 : | parrello | 1.10 | my $sprout = SFXlate->new_sprout_only(undef, undef, undef, ! $options->{dbLoad}); |
125 : | parrello | 1.7 | my $spl = SproutLoad->new($sprout, $fig, $options->{geneFile}, $options->{subsysFile}, $options); |
126 : | parrello | 1.1 | # Process the parameters. |
127 : | for my $group (@parameters) { | ||
128 : | Trace("Processing load group $group.") if T(2); | ||
129 : | my $stats; | ||
130 : | parrello | 1.3 | if ($group eq 'Genome' || $group eq '*') { |
131 : | parrello | 1.1 | $spl->LoadGenomeData(); |
132 : | parrello | 1.3 | } |
133 : | if ($group eq 'Feature' || $group eq '*') { | ||
134 : | parrello | 1.1 | $spl->LoadFeatureData(); |
135 : | parrello | 1.3 | } |
136 : | if ($group eq 'Coupling' || $group eq '*') { | ||
137 : | parrello | 1.1 | $spl->LoadCouplingData(); |
138 : | parrello | 1.3 | } |
139 : | if ($group eq 'Subsystem' || $group eq '*') { | ||
140 : | parrello | 1.1 | $spl->LoadSubsystemData(); |
141 : | parrello | 1.3 | } |
142 : | if ($group eq 'Property' || $group eq '*') { | ||
143 : | parrello | 1.1 | $spl->LoadPropertyData(); |
144 : | parrello | 1.3 | } |
145 : | if ($group eq 'Diagram' || $group eq '*') { | ||
146 : | parrello | 1.2 | $spl->LoadDiagramData(); |
147 : | parrello | 1.3 | } |
148 : | if ($group eq 'Annotation' || $group eq '*') { | ||
149 : | parrello | 1.2 | $spl->LoadAnnotationData(); |
150 : | parrello | 1.3 | } |
151 : | if ($group eq 'BBH' || $group eq '*') { | ||
152 : | parrello | 1.2 | $spl->LoadBBHData(); |
153 : | parrello | 1.1 | } |
154 : | parrello | 1.4 | if ($group eq 'Group' || $group eq '*') { |
155 : | parrello | 1.3 | $spl->LoadGroupData(); |
156 : | } | ||
157 : | if ($group eq 'Source' || $group eq '*') { | ||
158 : | $spl->LoadSourceData(); | ||
159 : | } | ||
160 : | parrello | 1.4 | if ($group eq 'External' || $group eq '*') { |
161 : | $spl->LoadExternalData(); | ||
162 : | } | ||
163 : | parrello | 1.8 | if ($group eq 'Reaction' || $group eq '*') { |
164 : | $spl->LoadReactionData(); | ||
165 : | } | ||
166 : | parrello | 1.3 | |
167 : | parrello | 1.1 | } |
168 : | Trace("Load complete.") if T(2); | ||
169 : | |||
170 : | 1; |
MCS Webmaster | ViewVC Help |
Powered by ViewVC 1.0.3 |