FigSubsystemTable of Contents
FIG Subsystem ObjectIntroductionPublic MethodsCuratorDistributableExtensibleGenomeCountIDNamenewNmpdrFlagRestoreBackupRevisionListSetCuratorSetDistributableSetExtensibleSetNmpdrFlagSetVersionVersionInternal Methods_GetMyFile_MyPath_PutMyFile_TestMyFileFIG Subsystem ObjectIntroductionThe FIG subsystem object represents a single subsystem. Rather than load all th
necessary data into memory at once, it is loaded as needed and cached. To conver
the Subsystem Editor to a different data store technology, simply replace thi
package with another. For that reason, this package should be as lightweight a
possible.The FIG object should not be used anywhere in the subsystem editor. All acces
to FIG must be through this object.This object uses the following fields. If the field does not exist, then it has not ye
been read into memory.NameName of the subsystem (with spaces)SubsysIdThe ID of the subsystem. This is generally the name with the colons and spaces converted t
underscores.CuratorName of the curator who owns the subsystem. The master: qualifier will be ruthlessl
deleted if found.NmpdrTRUE if this is an NMPDR subsystem, else FALSE.DistributableTRUE if this is a distributable subsystem, else FALSE.ExtensibleTRUE if this subsystem can be updated by incoming genomes, else FALSE.VersionThe version number of the subsystem. This is actually a count of the number of time
the subsystem has been updated.Public Methodsnewmy $lso = LazySubsystem->new($name, $data, %options);Construct a new LazySubsystem object for a specified subsystem.nameName of the subsystem to open.$figA FIG object used to get access to the data store.optionsA hash of options. Currently no options are supported.Namemy $name = $lso->Name();Display name of this subsystem. This is a read-only property.IDmy $id = $lso->ID();ID of the subsystem. In FIG, the ID is a variation of the name. This is a read-only property.Curatormy $curator = $lso->Curator();The curator is the owner of the subsystem. In order to edit a subsystem, the use
must either be the curator or have the admin privilege.SetCurator$lso->SetCurator($newValue);Store a new value for the Curator property.NmpdrFlagmy $nmpdrFlag = $lso->NmpdrFlag();The NMPDR flag is TRUE if this is an NMPDR subsystem, else FALSE.SetNmpdrFlag$lso->SetNmpdrFlag($newValue);Store a new value for the NmpdrFlag property.Distributablemy $distFlag = $lso->Distributable();A subsystem is distributable if it can be freely distributed to outside users.SetDistributable$lso->SetDistributable($newValue);Store a new value for the Distributable property.Extensiblemy $extFlag = $lso->Extensible();If a subsystem is extensible, then it can be updated automatically when new genomes ar
added to the system. The update is performed by the RAST server.SetExtensible$lso->SetExtensible($newValue);Store a new value for the Extensible property.Versionmy $versionStamp = $lso->Version();The version number is a simple integer that indicates how many major changes have been made to the subsystem.SetVersion$lso->SetVersion($newValue);Store a new value for the Version property.GenomeCountmy $count = $lso->GenomeCount();The number of genomes in the subsystem. This is a read-only field.RevisionListmy %revisionTable = $lso->RevisionList();Return a table of available subsystem revisions. The key will be the revision ID; the valu
will be the displayable revision date. To create an HTML menu from this, use$cgi->popup_menu(-name => 'reset_to_ssa',-values => [keys %revisionTable],-labels => \%revisionTable);Though other options are possible.NOTE: This replaces the FIG reset_to method, from which much of the code is copied. Th
reset_to method not only returned the table of revisions, it also formatted it int
an HTML table. That violates the spirit of this object's role, which is to be lightweigh
and let the application code do the work.RestoreBackup$lso->RestoreBackup($revisionKey);Restore a backup copy of a subsystem. The supplied parameter is the timestamp use
to identify the revision. The timestamp is used as the suffix on the backup files.ID of the revision to restore.Internal MethodsInternal methods are used only inside this package. They do not have to be implemente
when replacing this module._MyPathmy $path = $lso->_MyPath();Return the path to this subsystem's directory in the FIG data store._GetMyFilemy $fileText = $lso->_GetMyFile($fileName);ormy @fileLines = $loc->_GetMyFile($fileName);Read a subsystem file into memory.fileNameName of the file, sans the path information specific to this subsystem. Thus, to rea
the file VERSION all you need to specify for this parameter is 'VERSION'.RETURNIn scalar mode, returns the full text of the file. In list mode returns the individua
lines of the file without any line terminators._TestMyFilemy $existFlag = $lso->_TestMyFile($fileName);Return TRUE if the specified subsystem file exists for this subsystem, else FALSEfileNameName of the file, sans the path information specific to this subsystem. Thus, to test fo
the file VERSION all you need to specify for this parameter is 'VERSION'.RETURNReturns TRUE if the file exists, else FALSE._PutMyFile$lso->_PutMyFile($fileName, $fileData);Write a subsystem file to disk.fileNameName of the file, sans the path information specific to this subsystem. Thus, to writ
the file VERSION all you need to specify for this parameter is 'VERSION'.fileDataThe data to write. This can be a string that is written unmodified, or a list of string
that will be joined with new-line characters.