BioMart::Configuration AttributeTree
SummaryIncluded librariesPackage variablesSynopsisDescriptionGeneral documentationMethods
Toolbar
WebCvsRaw content
Summary
BioMart::Configuration::AttributeTree
Package variables
No package variables defined.
Inherit
BioMart::Root
Synopsis
Holds a List of BioMart::AttributeGroup objects.
Description
Object to further define the Attributes available to the User Interface by
a Dataset. Holds a list of one or more BioMart::AttributeGroup objects.
Methods
_new
No description
Code
addAttributeGroupDescriptionCode
descriptionDescriptionCode
displayNameDescriptionCode
getAllAttributeGroupsDescriptionCode
getAttributeByNameDescriptionCode
getAttributeByNameKeyDescriptionCode
getAttributeGroupByNameDescriptionCode
getFilterByNameDescriptionCode
hideDisplayDescriptionCode
maxSelectDescriptionCode
nameDescriptionCode
outFormatsDescriptionCode
Methods description
addAttributeGroupcode    nextTop
  Usage      : $at->addAttributeGroup($ag);
Description: adds an AttributeGroup to this AttributeTree. The
order of addition of each AttributeGroup is maintained.
Returntype : na
Exceptions : none
Caller : caller
descriptioncodeprevnextTop
  Usage      : Arg [1] - (optional) string $description
Description: get/set for description
Returntype : string
Exceptions : none
Caller : general
displayNamecodeprevnextTop
  Usage      : Arg [1] - (optional) string $display_name
Description: get/set for display name
Returntype : string
Exceptions : none
Caller : general
getAllAttributeGroupscodeprevnextTop
  Usage        :  my $groups = $at->getAllAttributeGroups; 
foreach my $group (@{$groups}) { ... }
Description : Returns a list_ref of all AttributeGroups held in
this AttributeTree.
Returntype : list_ref of BioMart::AttributeGroup objects
Exceptions : none
Caller : caller
getAttributeByNamecodeprevnextTop
  Usage        :  my $att = $at->getAttributeByName($name);
Description : Get a specific BioMart::Attribute object named by $name.
May return undef if no object is contained within
this AttributeTree with the given name.
Returntype : BioMart::Attribute or undef if none found with given name
Exceptions : none
Caller : caller
getAttributeByNameKeycodeprevnextTop
  Usage        :  my $att = $at->getAttributeByNameKey($name,$key);
Description : Get a specific BioMart::Attribute object named
by $name, $key.
May return undef if no object is contained within
this AttributeTree with the given name and key.
Returntype : BioMart::Attribute or undef if none found with given name
Exceptions : none
Caller : caller
getAttributeGroupByNamecodeprevnextTop
  Usage      : my $ag = $at->getAttributeGroupByName($name);
Description: Returns a BioMart::AttributeGroup object from this
BioMart::AttributeTree object, named by the given name.
If no object exists in this tree named by the given name,
this method returns undef.
Returntype : BioMart::AttributeGroup or undef if none found with given name.
Exceptions : none
Caller : caller
getFilterByNamecodeprevnextTop
  Usage        :  my $filt = $filt->getFilterByName($name);
Description : Get a specific BioMart::Filter object named by $name.
May return undef if no object is contained within
this AttributerTree with the given name.
Returntype : BioMart::Filter or undef if none found with given name
Exceptions : none
Caller : caller
hideDisplaycodeprevnextTop
  Usage      : Arg [1] - (optional) string $hideDisplay
Description: get/set for hideDisplay toggle
Returntype : string
Exceptions : none
Caller : general
maxSelectcodeprevnextTop
  Usage      : Arg [1] - stores maximum number of groups
Description: get/set for maxSelect
Returntype : number
Exceptions : none
Caller : general
namecodeprevnextTop
  Usage      : my $name = $att->name(); $att->name($newname);
Description: sets/gets the name of the AttributeTree
Returntype : string name
Exceptions : none
Caller : caller
outFormatscodeprevnextTop
  Usage      : Arg [1] - (optional) string $outFormats
Description: get/set for outFormats toggle
Returntype : string
Exceptions : none
Caller : general
Methods code
_newdescriptionprevnextTop
sub _new {
  my ($self, @param) = @_;
  $self->SUPER::_new(@param);

  $self->addParams(TITLES, @param);
  $self->attr('attGs', []);
}
addAttributeGroupdescriptionprevnextTop
sub addAttributeGroup {
  my ($self, $attGroup) = @_;

  my $attGs = $self->get('attGs');
  push @{$attGs}, $attGroup;
}
descriptiondescriptionprevnextTop
sub description {
  # stores description
my ($self, $value) = @_; if ($value){ $self->setParam(DESCRIPTION, $value); } return $self->getParam(DESCRIPTION);
}
displayNamedescriptionprevnextTop
sub displayName {
  # stores display name
my ($self, $value) = @_; if ($value){ $self->setParam(DISPLAYNAME, $value); } return $self->getParam(DISPLAYNAME);
}
getAllAttributeGroupsdescriptionprevnextTop
sub getAllAttributeGroups {
  my $self = shift;

  return $self->get('attGs');
}
getAttributeByNamedescriptionprevnextTop
sub getAttributeByName {
  my ($self, $name) = @_;

  my $retAtt;

  my $attGs = $self->get('attGs');
  GROUP: foreach my $attG (@{$attGs}) {
    my $attColls = $attG->getAllCollections;

    foreach my $attCol (@{$attColls}) {
      my $atts = $attCol->getAllAttributes;

      foreach my $att (@{$atts}) {
	next if (!defined($att));
        if ($att->name eq $name) {
          $retAtt = $att;
          last GROUP;
		}
	  }
	}
  }

  return $retAtt;
}
getAttributeByNameKeydescriptionprevnextTop
sub getAttributeByNameKey {
  my ($self, $name, $key) = @_;
  my $retAtt;

  my $attGs = $self->get('attGs');
  GROUP: foreach my $attG (@{$attGs}) {
    my $attColls = $attG->getAllCollections;

    foreach my $attCol (@{$attColls}) {
      my $atts = $attCol->getAllAttributes;

      foreach my $att (@{$atts}) {
	next if (!defined($att));
        if ($att->name eq $name) {
	  if ($att->key){ 
	      $retAtt = $att if ($att->key eq $key);
	  }
	  else{
	      $retAtt = $att;
	  }
          last GROUP;
		}
	  }
	}
  }
  return $retAtt;
}



1;
}
getAttributeGroupByNamedescriptionprevnextTop
sub getAttributeGroupByName {
  my ($self, $name) = @_;

  my $retGroup;

  my $attGs = $self->get('attGs');

  foreach my $attG (@{$attGs}) {
    if ($attG->name() eq $name) {
      $retGroup = $attG;
      last;
	}
  }

  return $retGroup;
}
getFilterByNamedescriptionprevnextTop
sub getFilterByName {
  my ($self, $name) = @_;

  my $retFilt;

  my $attGs = $self->get('attGs');
  GROUP: foreach my $attG (@{$attGs}) {
    my $attColls = $attG->getAllCollections;

    foreach my $attCol (@{$attColls}) {
      my $filts = $attCol->getAllAttributes;# attributeFilters are just added
# as attributes on start-up
foreach my $filt (@{$filts}) { if ($filt->name eq $name) { $retFilt = $filt; last GROUP; } } } } return $retFilt;
}
hideDisplaydescriptionprevnextTop
sub hideDisplay {
  # stores display name
my ($self, $value) = @_; if ($value){ $self->setParam(HIDEDISPLAY, $value); } return $self->getParam(HIDEDISPLAY);
}
maxSelectdescriptionprevnextTop
sub maxSelect {
  
  my ($self, $value) = @_;
  if ($value){
    $self->setParam(MAXSELECT, $value);
  }
  return $self->getParam(MAXSELECT);
}
namedescriptionprevnextTop
sub name {
  my ($self, $newName) = @_;

  if ($newName) {
    $self->setParam(NAMEKEY, $newName);
  }
  return $self->getParam(NAMEKEY);
}
outFormatsdescriptionprevnextTop
sub outFormats {
  # stores display name
my ($self, $value) = @_; if ($value){ $self->setParam(OUTFORMATS, $value); } return $self->getParam(OUTFORMATS);
}
General documentation
AUTHOR - Arek Kasprzyk, Syed Haider, Richard Holland, Darin London, Damian SmedleyTop
CONTACTTop
This module is part of the BioMart project http://www.biomart.org
Questions can be posted to the mart-dev mailing list: mart-dev@ebi.ac.uk