Parent Directory
|
Revision Log
Revision 1.7 - (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.1 | B<IsRoleOf>, B<OccursInSubsystem>, B<ParticipatesIn>, B<HasSSCell>. |
28 : | |||
29 : | parrello | 1.2 | =item Annotation |
30 : | |||
31 : | Loads B<SproutUser>, B<UserAccess>, B<Annotation>, B<IsTargetOfAnnotation>, | ||
32 : | B<MadeAnnotation>. | ||
33 : | |||
34 : | =item Diagram | ||
35 : | |||
36 : | Loads B<Diagram>, B<RoleOccursIn>. | ||
37 : | |||
38 : | =item Property | ||
39 : | |||
40 : | Loads B<Property>, B<HasProperty>. | ||
41 : | |||
42 : | =item BBH | ||
43 : | |||
44 : | Loads B<IsBidirectionalBestHitOf>. | ||
45 : | |||
46 : | parrello | 1.3 | =item Group |
47 : | |||
48 : | Loads B<GenomeGroups>. | ||
49 : | |||
50 : | =item Source | ||
51 : | |||
52 : | Loads B<Source>, B<ComesFrom>, B<SourceURL>. | ||
53 : | |||
54 : | parrello | 1.4 | =item External |
55 : | |||
56 : | Loads B<ExternalAliasOrg>, B<ExternalAliasFunc>. | ||
57 : | |||
58 : | parrello | 1.3 | =item * |
59 : | |||
60 : | Loads all of the above tables. | ||
61 : | |||
62 : | parrello | 1.1 | =back |
63 : | |||
64 : | parrello | 1.7 | The command-line options are given below. |
65 : | parrello | 1.1 | |
66 : | =over 4 | ||
67 : | |||
68 : | =item geneFile | ||
69 : | |||
70 : | The name of the file containing the genomes and their associated access codes. The | ||
71 : | file should have one line per genome, each line consisting of the genome ID followed | ||
72 : | by the access code, separated by a tab. If no file is specified, all complete genomes | ||
73 : | will be processed and the access code will be 1. | ||
74 : | |||
75 : | =item subsysFile | ||
76 : | |||
77 : | The name of the file containing the trusted subsystems. The file should have one line | ||
78 : | per trusted subsystem. If no file is specified, all subsystems will be trusted. | ||
79 : | |||
80 : | =item trace | ||
81 : | |||
82 : | Desired tracing level. The default is 3. | ||
83 : | |||
84 : | parrello | 1.7 | =item limitedFeatures |
85 : | |||
86 : | Only generate the B<Feature> and B<IsLocatedIn> tables when processing the feature group. | ||
87 : | |||
88 : | parrello | 1.1 | =back |
89 : | |||
90 : | =cut | ||
91 : | |||
92 : | use strict; | ||
93 : | use Tracer; | ||
94 : | use DocUtils; | ||
95 : | use Cwd; | ||
96 : | use FIG; | ||
97 : | use SFXlate; | ||
98 : | use File::Copy; | ||
99 : | use File::Path; | ||
100 : | use SproutLoad; | ||
101 : | use Stats; | ||
102 : | |||
103 : | # Get the command-line parameters and options. | ||
104 : | my ($options, @parameters) = Tracer::ParseCommand({ geneFile => "", subsysFile => "", | ||
105 : | parrello | 1.7 | trace => 3, limitedFeatures => 0 }, |
106 : | parrello | 1.1 | @ARGV); |
107 : | # Set up tracing. | ||
108 : | parrello | 1.4 | TSetup("$options->{trace} SproutLoad ERDBLoad ERDB Stats Tracer Load", "+>$FIG_Config::temp/trace.log"); |
109 : | parrello | 1.1 | # Create the sprout loader object. |
110 : | my $fig = FIG->new(); | ||
111 : | parrello | 1.6 | my $sprout = Sprout->new($FIG_Config::sproutDB, { noDBOpen => 1 }); |
112 : | parrello | 1.7 | my $spl = SproutLoad->new($sprout, $fig, $options->{geneFile}, $options->{subsysFile}, $options); |
113 : | parrello | 1.1 | # Process the parameters. |
114 : | for my $group (@parameters) { | ||
115 : | Trace("Processing load group $group.") if T(2); | ||
116 : | my $stats; | ||
117 : | parrello | 1.3 | if ($group eq 'Genome' || $group eq '*') { |
118 : | parrello | 1.1 | $spl->LoadGenomeData(); |
119 : | parrello | 1.3 | } |
120 : | if ($group eq 'Feature' || $group eq '*') { | ||
121 : | parrello | 1.1 | $spl->LoadFeatureData(); |
122 : | parrello | 1.3 | } |
123 : | if ($group eq 'Coupling' || $group eq '*') { | ||
124 : | parrello | 1.1 | $spl->LoadCouplingData(); |
125 : | parrello | 1.3 | } |
126 : | if ($group eq 'Subsystem' || $group eq '*') { | ||
127 : | parrello | 1.1 | $spl->LoadSubsystemData(); |
128 : | parrello | 1.3 | } |
129 : | if ($group eq 'Property' || $group eq '*') { | ||
130 : | parrello | 1.1 | $spl->LoadPropertyData(); |
131 : | parrello | 1.3 | } |
132 : | if ($group eq 'Diagram' || $group eq '*') { | ||
133 : | parrello | 1.2 | $spl->LoadDiagramData(); |
134 : | parrello | 1.3 | } |
135 : | if ($group eq 'Annotation' || $group eq '*') { | ||
136 : | parrello | 1.2 | $spl->LoadAnnotationData(); |
137 : | parrello | 1.3 | } |
138 : | if ($group eq 'BBH' || $group eq '*') { | ||
139 : | parrello | 1.2 | $spl->LoadBBHData(); |
140 : | parrello | 1.1 | } |
141 : | parrello | 1.4 | if ($group eq 'Group' || $group eq '*') { |
142 : | parrello | 1.3 | $spl->LoadGroupData(); |
143 : | } | ||
144 : | if ($group eq 'Source' || $group eq '*') { | ||
145 : | $spl->LoadSourceData(); | ||
146 : | } | ||
147 : | parrello | 1.4 | if ($group eq 'External' || $group eq '*') { |
148 : | $spl->LoadExternalData(); | ||
149 : | } | ||
150 : | parrello | 1.3 | |
151 : | parrello | 1.1 | } |
152 : | Trace("Load complete.") if T(2); | ||
153 : | |||
154 : | 1; |
MCS Webmaster | ViewVC Help |
Powered by ViewVC 1.0.3 |