[Bio] / Sprout / LoadSproutTables.pl Repository:
ViewVC logotype

Annotation of /Sprout/LoadSproutTables.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (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 :     There are two command-line options, given below. Note that in the command line, spaces
65 :     inside parameters should be represented by C<\b>.
66 :    
67 :     =over 4
68 :    
69 :     =item geneFile
70 :    
71 :     The name of the file containing the genomes and their associated access codes. The
72 :     file should have one line per genome, each line consisting of the genome ID followed
73 :     by the access code, separated by a tab. If no file is specified, all complete genomes
74 :     will be processed and the access code will be 1.
75 :    
76 :     =item subsysFile
77 :    
78 :     The name of the file containing the trusted subsystems. The file should have one line
79 :     per trusted subsystem. If no file is specified, all subsystems will be trusted.
80 :    
81 :     =item trace
82 :    
83 :     Desired tracing level. The default is 3.
84 :    
85 :     =back
86 :    
87 :     =cut
88 :    
89 :     use strict;
90 :     use Tracer;
91 :     use DocUtils;
92 :     use Cwd;
93 :     use FIG;
94 :     use SFXlate;
95 :     use File::Copy;
96 :     use File::Path;
97 :     use SproutLoad;
98 :     use Stats;
99 :    
100 :     # Get the command-line parameters and options.
101 :     my ($options, @parameters) = Tracer::ParseCommand({ geneFile => "", subsysFile => "",
102 :     trace => 3 },
103 :     @ARGV);
104 :     # Set up tracing.
105 : parrello 1.4 TSetup("$options->{trace} SproutLoad ERDBLoad ERDB Stats Tracer Load", "+>$FIG_Config::temp/trace.log");
106 : parrello 1.1 # Create the sprout loader object.
107 :     my $fig = FIG->new();
108 : parrello 1.5 my $sprout = Sprout->new($FIG_Config::sproutDB, { noDPOpen => 1 });
109 :     my $spl = SproutLoad->new($sprout, $fig, $options->{geneFile}, $options->{subsysFile});
110 : parrello 1.1 # Process the parameters.
111 :     for my $group (@parameters) {
112 :     Trace("Processing load group $group.") if T(2);
113 :     my $stats;
114 : parrello 1.3 if ($group eq 'Genome' || $group eq '*') {
115 : parrello 1.1 $spl->LoadGenomeData();
116 : parrello 1.3 }
117 :     if ($group eq 'Feature' || $group eq '*') {
118 : parrello 1.1 $spl->LoadFeatureData();
119 : parrello 1.3 }
120 :     if ($group eq 'Coupling' || $group eq '*') {
121 : parrello 1.1 $spl->LoadCouplingData();
122 : parrello 1.3 }
123 :     if ($group eq 'Subsystem' || $group eq '*') {
124 : parrello 1.1 $spl->LoadSubsystemData();
125 : parrello 1.3 }
126 :     if ($group eq 'Property' || $group eq '*') {
127 : parrello 1.1 $spl->LoadPropertyData();
128 : parrello 1.3 }
129 :     if ($group eq 'Diagram' || $group eq '*') {
130 : parrello 1.2 $spl->LoadDiagramData();
131 : parrello 1.3 }
132 :     if ($group eq 'Annotation' || $group eq '*') {
133 : parrello 1.2 $spl->LoadAnnotationData();
134 : parrello 1.3 }
135 :     if ($group eq 'BBH' || $group eq '*') {
136 : parrello 1.2 $spl->LoadBBHData();
137 : parrello 1.1 }
138 : parrello 1.4 if ($group eq 'Group' || $group eq '*') {
139 : parrello 1.3 $spl->LoadGroupData();
140 :     }
141 :     if ($group eq 'Source' || $group eq '*') {
142 :     $spl->LoadSourceData();
143 :     }
144 : parrello 1.4 if ($group eq 'External' || $group eq '*') {
145 :     $spl->LoadExternalData();
146 :     }
147 : parrello 1.3
148 : parrello 1.1 }
149 :     Trace("Load complete.") if T(2);
150 :    
151 :     1;

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3