Bio::Tools::SVMLoc(3pm)

NAME
Bio::Tools::SVMLoc - Perl implementation of the SVM based protein subcellular localization method.

SYNOPSIS
  use Bio::Tools::SVMLoc;
  use Bio::SeqIO;

  # Load a previously trained model from a file.
  $svmloc = new Bio::Tools::SVMLoc(-model  => 'svmloc.model');

  # Classify a Bio::Seq object.
  $loc = $svmloc->classify($seq);

  # Train SVMLoc on a new dataset.
  $accuracy = $svmloc->train(\@vectors, $localization,
                             { Kernel  => 'linear',
                               Optimize => 1 });

  # Save the model to a file.
  $svmloc->save('svmloc.model.new');

  # Load a model from a file.
  $svmloc->load('svmloc.model.new');

DESCRIPTION
Bio::Tools::SVMloc is an implementation of the SVMLoc protein subcellular localization method, which predicts localizations based on amino acid composition. The method was originally outlined in "Support Vector Machine Approach for Protein Subcellular Localization Prediction" paper by Sujun Hua and Zhirong Sun.

CONSTRUCTOR
   $svmloc = new Bio::Tools::SVMLoc(-model  => 'svmloc.model');

The SVMLoc constructor accepts the name of an existing model file.

METHODS
   $loc = $sl->classify($seq, \@frequent_patterns);

The classify method accepts a Bio::Seq object and an array reference of the known frequent patterns as arguments and returns a string containing the predicted localization of the protein. The return value will be one of: Cytoplasmic, CytoplasmicMembrane, Periplasmic, OuterMembrane, Secreted, Mitochondrial, Nuclear or Unknown.

  $accuracy = $svmloc->train(\@vectors, $localization,
                             { Kernel  => 'linear',
                               Optimize => 1 });

The train method allows the creation of a new SVM model based on a set of user defined sequences. The first parameter an array reference containing the list of vectors to train the SVM on, those in the positive set will be prefixed by 1 while those in the negative set will be prefixed by -1. The second parameter is a string containing the localization that is being targeted with this SVM.

The resulting model is unlikely to provide optimal results without some degree of fine tuning to the underlying Support Vector Machine. The third (optional) parameter to the train method is a hashref which allows one to pass options directly to the SVM. The set of valid keys are as follows:

  Kernel     - The Support Vector Machine kernel to use, possible values
               are linear, polynomial, radial, and sigmoid.

  Optimize   - If true, the module will attempt to search for the best
               values of the gamma and C parameters passed to the SVM.
               For any new model, this should be run at least once.

               By default, the SVMLoc module will try all values for gamma
               between 1 and 100 (increments of 1) and C between 1 and 50
              (increments of one) until the optimal values of each are
               located.

               Note that this **WILL** take quite some time, but only
               needs to be done once per model.  The model should be
               saved with the save method after training so that all
               optimal parameter values will be retained.

  GammaStart - Allows specification of the start value when searching for
               the optimal gamma value.  (Default 1)

  GammaEnd   - Allows specification of the end value when searching for
               the optimal gamma value.  (Default 100)

  GammaInc   - Allows specification of the size of the increment when
               searching for the optimal gamma value.  (Default 1)

  CStart      - Allows specification of the start value when searching for
               the optimal C value.  (Default 1)

  CEnd        - Allows specification of the end value when searching for
                the optimal C value.  (Default 50)

  CInc        - Allows specification of the size of the increment when
                searching for the optimal C value.  (Default 1)

  $svmloc->save('svmloc.model.new');

Saves the currently loaded model to the specified file. Returns true on success, false on failure.

  $svmloc->load('svmloc.model.new');

Loads an existing model from file. Returns true on success, false on failure.

AUTHOR
Fiona Brinkman, Cory Spencer, Brinkman Lab, Simon Fraser University <psort-mail@sfu.ca>

MAINTAINER
Matthew Laird <lairdm@sfu.ca>

SEE ALSO
Algorithm::SVM and the original SVMLoc paper titled "Support Vector Machine Approach for Protein Subcellular Localization Prediction" by Sujun Hua and Zhirong Sun

ACKNOWLEGEMENTS
Chih-Jen Lin, one of the authors of the libsvm package upon which Algorithm::SVM was based, was invaluable in creating this version of SVMLoc Thanks also to Sujun Hua and Zhirong Sun, the authors of the original SVMLoc. Last but not least, thanks to Fiona Brinkman, Jennifer Gardy and the other members of the Simon Fraser University Brinkman laboratory.