5 CXGN::Cview::MapFactory::CviewAndCmap - a class to access maps in both cview and cmap databases.
9 For the interface to be implemented, see L<CXGN::Cview::MapFactory>, and for an example, see L<CXGN::Cview::MapFactory::SGN>.
13 Lukas Mueller <lam87@cornell.edu>
19 package CXGN
::Cview
::MapFactory
::CviewAndCmap
;
21 use base qw
| CXGN
::DB
::Object
|;
23 use CXGN
::Cview
::Map
::SGN
::Genetic
;
24 use CXGN
::Cview
::Map
::SGN
::User
;
25 use CXGN
::Cview
::Map
::SGN
::Fish
;
26 use CXGN
::Cview
::Map
::SGN
::Sequence
;
27 use CXGN
::Cview
::Map
::SGN
::IL
;
28 use CXGN
::Cview
::Map
::SGN
::Physical
;
29 use CXGN
::Cview
::Map
::SGN
::ProjectStats
;
30 use CXGN
::Cview
::Map
::SGN
::AGP
;
31 use CXGN
::Cview
::Map
::SGN
::Contig
;
32 use CXGN
::Cview
::Map
::GMOD
::Cmap
;
38 Returns: a CXGN::Cview::MapFactory object
48 my $self = $class->SUPER::new
($dbh);
50 $self->{cview
} = CXGN
::Cview
::MapFactory
::SGN
->new($dbh);
53 $self->{cmap
} = CXGN
::Cview
::MapFactory
::Cmap
->new($dbh);
59 =head2 function create()
61 Description: creates a map based on the hashref given, which
62 should either contain the key map_id or map_version_id
63 and an appropriate identifier. The function returns undef
64 if a map of the given id cannot be found/created.
74 if (exists($args->{map_version_id
})) {
75 $id=$args->{map_version_id
};
78 elsif (exists($args->{map_id
})) {
82 die "Need a map_id or map_version_id key in hashref\n";
88 $map = $self->{cmap
}->create($args);
91 $map = $self->{cview
}->create($args);
100 =head2 function get_all_maps()
102 Synopsis: my @maps = $map_factory->get_all_maps();
104 Returns: a list of all maps currently defined, as
105 CXGN::Cview::Map objects (and subclasses)
106 Side effects: Queries the database for certain maps
116 @maps = ($self->{cview
}->get_all_maps(), $self->{cmap
}->get_all_maps());
121 sub get_system_maps
{
123 return $self->get_all_maps();
129 @maps = $self->{cview
}->get_user_maps();