Bio::T...SVMLoc(3pm)
π 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:
CytoplasmicCytoplasmicMembranePeriplasmicOuterMembraneSecretedMitochondrialNuclearUnknown
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
1while 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 arelinear,polynomial,radial, andsigmoid.Optimizeβ if true, the module will attempt to search for the best values of thegammaandCparameters 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 optimalgammavalue. (Default1)GammaEndβ allows specification of the end value when searching for the optimalgammavalue. (Default100)GammaIncβ allows specification of the size of the increment when searching for the optimalgammavalue. (Default1)CStartβ allows specification of the start value when searching for the optimalCvalue. (Default1)CEndβ allows specification of the end value when searching for the optimalCvalue. (Default50)CIncβ allows specification of the size of the increment when searching for the optimalCvalue. (Default1)
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
- ubuntu jammy: psortb 3.0.6+dfsg-2build2 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms