4 CXGN::List::Transform - transform lists from one type to another
8 my $tf = CXGN::List::Transform->new();
9 if (my $transform_name = $tf->can_transform("accessions", "accession_ids")) {
10 my $tf_list = @$tf->tranform($schema, $transform_name, $list_ref);
15 package CXGN
::List
::Transform
;
19 use Module
::Pluggable
require => 1;
23 Usage: my $tf_name = $tf->can_transform("accessions", "accession_ids");
24 Desc: ask if to types can be transformed. Returns the name of the
25 transform, to be used with the transform() function
38 foreach my $p ($self->plugins()) {
39 if ($p->can_transform($type1, $type2)) {
48 Usage: $tf->transform($schema, $transform_name, $list_ref);
50 Args: $schema (Bio::Chado::Schema)
51 $transform_name (obtain from can_transform())
52 $list_ref of elements to transform
53 Returns: a hashref with two keys, transform and missing, both
54 of which are arrayrefs of strings.
63 my $transform_name = shift;
68 foreach my $p ($self->plugins()) {
69 if ($transform_name eq $p->name()) {
70 $data = $p->transform($schema, $list, $self);