BioMart::Configuration
VirtualSchema
Toolbar
Summary
BioMart::Configuration::VirtualSchema
Package variables
No package variables defined.
Inherit
Synopsis
Represents the virtualSchema defined in the martRegistry XML
Description
All BioMart::Configuration::Location implementing objects are contained
within a BioMart::Configuration::VirtualSchema objects in the
BioMart::Registry. At the very least if no virtualSchema is defined in the
registry configuration a single "default" virtualSchema is generated to
contain all Locations and Dataset. Datasets contained in different
virtualSchemas cannot be used in the same BioMart::Query.
Methods
Methods description
Usage : usage Description: Description Returntype : Exceptions : none Caller : caller |
Usage : my $default = $virtualSchema->default(); $virtualSchemaDefault->default($newname); Description: sets/gets the default flag of the VirtualSchema Returntype : string name Exceptions : none Caller : caller |
Usage : my $displayName = $virtualSchema->displayName(); $virtualSchemaDisplayName->displayName($newdisplayName); Description: sets/gets the displayName of the VirtualSchema Returntype : string displayName Exceptions : none Caller : caller |
Usage : usage Description: [deprecated] to be replaced with getAllMarts Returntype : Exceptions : none Caller : caller |
Usage : getAllMarts(martusers-required, visible as 1-optional) Description: Replaced the old getAllLocations call Returntype : Exceptions : none Caller : caller |
Usage : usage Description: Description Returntype : Exceptions : none Caller : caller |
Usage : my $name = $virtualSchema->name(); $virtualSchemaName->name($newname); Description: sets/gets the name of the VirtualSchema Returntype : string name Exceptions : none Caller : caller |
Usage : usage Description: Description Returntype : Exceptions : none Caller : caller |
Usage : my $visible = $virtualSchema->visible(); $virtualSchema->visible($newname); Description: sets/gets the visible flag of the VirtualSchema Returntype : string name Exceptions : none Caller : caller |
Methods code
sub _new
{ my ($self, @param) = @_;
$self->SUPER::_new(@param);
$self->addParams(TITLES, @param);
$self->attr('default', 0);
$self->attr('locations', []);
$self->attr('visible',1); } |
sub addLocation
{ my ($self, $location) = @_;
my $locations = $self->get('locations');
push @{$locations}, $location; } |
sub default
{ my ($self, $newName) = @_;
if ($newName) {
$self->set('default', $newName);
}
return $self->get('default'); } |
sub displayName
{ my ($self, $newDisplayName) = @_;
if ($newDisplayName) {
$self->setParam(DISPLAYNAME, $newDisplayName);
}
return $self->getParam(DISPLAYNAME); } |
sub getAllLocations
{ my $self = shift;
return $self->get('locations'); } |
sub getAllMarts
{ my ($self, $visible) = @_;
if(!$visible)
{
return $self->get('locations');
}
if ($visible == 1)
{
my $allMarts = $self->get('locations');
my $Marts;
foreach my $mart(@$allMarts)
{
if($visible eq $mart->visible())
{
push @{$Marts}, $mart;
}
}
return $Marts;
} } |
sub getDatasetByName
{ my ($self,$datasetName) = @_;
my $retDataset;
LOC:foreach my $location(@{$self->getAllLocations}){
foreach my $dataset(@{$location->getAllDatasets}){
if ($dataset->name eq $datasetName){
$retDataset = $dataset;
last LOC;
}
}
}
return $retDataset;
}
1; } |
sub getMartByName
{ my ($self, $name) = @_;
my $allMarts = $self->get('locations');
my $Marts;
foreach my $mart(@$allMarts)
{
if($name eq $mart->name())
{
return $mart;
}
}
return undef; } |
sub name
{ my ($self, $newName) = @_;
if ($newName) {
$self->setParam(NAME, $newName);
}
return $self->getParam(NAME); } |
sub removeLocation
{ my ($self,$location) = @_;
my $locations = $self->getAllLocations;
my $i = 0;
foreach my $loc (@$locations){
if ($loc->name eq $location->name){
splice @$locations,$i,1;
last;
}
$i++;
} } |
sub visible
{ my ($self, $newName) = @_;
if (defined($newName)) {
$self->set('visible', $newName);
}
return $self->get('visible'); } |
General documentation
AUTHOR - Damian Smedley | Top |