Bio::T...SVMLoc(3pm)

πŸ“¦
version 3.0.6 Β· 4 versions
, in ubuntu jammy

πŸ’– Bio::T...SVMLoc β€” the perl manual, but make it bestie πŸ’–

okay so this is the manual page for Bio::Tools::SVMLoc, part of the User Contributed Perl Documentation, and honestly? it's giving protein whisperer. it's the Perl implementation of the SVM based protein subcellular localization method. yes bestie, we're predicting where a protein lives inside the cell. we are literally doing biology in Perl. slay. 🧬✨


✨ NAME ✨

Bio::Tools::SVMLoc β€” a Perl implementation of the SVM based protein subcellular localization method. no cap, that's the whole vibe. 🫢


🌸 SYNOPSIS 🌸

here's the whole thing in action, copy-paste energy, character for character:

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');

like, load a model, classify a seq, train a new one, save it, load it again. the whole little lifecycle. iconic behavior. πŸ‘‘


πŸ¦‹ DESCRIPTION πŸ¦‹

Bio::Tools::SVMloc is an implementation of the SVMLoc protein subcellular localization method, which predicts localizations based on amino acid composition. so it looks at which amino acids are in there and goes "hmm, this one's giving cytoplasmic" πŸ’…

the method was originally outlined in the paper "Support Vector Machine Approach for Protein Subcellular Localization Prediction" by Sujun Hua and Zhirong Sun. we are standing on the shoulders of legends fr fr.


πŸŽ€ CONSTRUCTOR πŸŽ€

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

the SVMLoc constructor accepts the name of an existing model file. that's it. that's the whole job. hand it a model file and it's ready to go. πŸ’–


πŸ’… METHODS πŸ’…

classify 🌈

$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
  • Unknown

eight options, all of them valid, no wrong answers here bestie. πŸ“

train 🧚

$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. yes, you're building your own model. main character energy.

  • the first parameter is 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.
heads up bestie: the resulting model is unlikely to provide optimal results without some degree of fine tuning to the underlying Support Vector Machine. 😭 so tune it.

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. save your work, bestie, please.
  • 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)

save πŸ’Ύ

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

saves the currently loaded model to the specified file. returns true on success, false on failure. simple as that. ✨

load πŸ“‚

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

loads an existing model from file. returns true on success, false on failure. yes, also simple. 🫢


πŸ‘‘ 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. go read it, iykyk. πŸ“š


🌟 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. the way that whole lab showed up and delivered. obsessed. πŸ’–


and that's the page, bestie!! this one shipped as perl v5.34.0, dated 2022-02-06, and it lives in the Bio::T...SVMLoc(3pm) man page. go predict some localizations, you've got this. πŸ¦‹βœ¨πŸ’…

πŸ“¦ where this page comes from