[Bio] / Sprout / AlignmentSaplingLoader.pm Repository:
ViewVC logotype

Annotation of /Sprout/AlignmentSaplingLoader.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (view) (download) (as text)

1 : parrello 1.1 #!/usr/bin/perl -w
2 :    
3 :     #
4 :     # Copyright (c) 2003-2006 University of Chicago and Fellowship
5 :     # for Interpretations of Genomes. All Rights Reserved.
6 :     #
7 :     # This file is part of the SEED Toolkit.
8 :     #
9 :     # The SEED Toolkit is free software. You can redistribute
10 :     # it and/or modify it under the terms of the SEED Toolkit
11 :     # Public License.
12 :     #
13 :     # You should have received a copy of the SEED Toolkit Public License
14 :     # along with this program; if not write to the University of Chicago
15 :     # at info@ci.uchicago.edu or the Fellowship for Interpretation of
16 :     # Genomes at veronika@thefig.info or download a copy from
17 :     # http://www.theseed.org/LICENSE.TXT.
18 :     #
19 :    
20 :     package AlignmentSaplingLoader;
21 :    
22 :     use strict;
23 :     use Tracer;
24 :     use ERDB;
25 :     use FFs;
26 :     use FF;
27 :     use SeedUtils;
28 :     use LoaderUtils;
29 :     use base 'BaseSaplingLoader';
30 :    
31 :     =head1 Sapling Alignment Load Group Class
32 :    
33 :     =head2 Introduction
34 :    
35 :     The Alignment Load Group includes all of the major alignment and tree tables.
36 :    
37 :     =head3 new
38 :    
39 :     my $sl = AlignmentSaplingLoader->new($erdb, $options);
40 :    
41 :     Construct a new AlignmentSaplingLoader object.
42 :    
43 :     =over 4
44 :    
45 :     =item erdb
46 :    
47 :     L<Sapling> object for the database being loaded.
48 :    
49 :     =item options
50 :    
51 :     Reference to a hash of command-line options.
52 :    
53 :     =back
54 :    
55 :     =cut
56 :    
57 :     sub new {
58 :     # Get the parameters.
59 :     my ($class, $erdb, $options) = @_;
60 :     # Create the table list.
61 : parrello 1.4 my @tables = sort qw(AlignmentTree Aligns ProjectsOnto);
62 : parrello 1.1 # Create the BaseSaplingLoader object.
63 :     my $retVal = BaseSaplingLoader::new($class, $erdb, $options, @tables);
64 :     # Return it.
65 :     return $retVal;
66 :     }
67 :    
68 :     =head2 Public Methods
69 :    
70 :     =head3 Generate
71 :    
72 :     $sl->Generate();
73 :    
74 :     Generate the data for the alignment and tree files.
75 :    
76 :     =cut
77 :    
78 :     sub Generate {
79 :     # Get the parameters.
80 :     my ($self) = @_;
81 :     # Get the database object.
82 :     my $erdb = $self->db();
83 :     # Get the source object.
84 :     my $fig = $self->source();
85 : parrello 1.3 # The loading is done in the global section.
86 :     if ($self->global()) {
87 :     # The alignment dump files are in the coupling directory.
88 : parrello 1.5 my $couplingDir = $erdb->LoadDirectory() . '/FamilyData';
89 : parrello 1.3 $self->LoadFromFile(AlignmentTree => "$couplingDir/AlignmentTree.dtx",
90 :     qw(id alignment-method tree-method alignment-parameters
91 :     alignment-properties tree-parameters tree-properties));
92 :     $self->LoadFromFile(Aligns => "$couplingDir/Aligns.dtx",
93 :     qw(from-link to-link begin end len sequence-id properties));
94 : parrello 1.4 $self->LoadFromFile(ProjectsOnto => "$couplingDir/ProjectsOnto.dtx",
95 : parrello 1.6 qw(from-link to-link gene-context percent-identity score));
96 : parrello 1.3 }
97 : parrello 1.1 }
98 :    
99 :    
100 :     1;

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3