Package: proteinko
proteinkoEncode protein sequence as a distribution of its physicochemical properties.IntroductionMethodsInstallationUsageExample 1Example 2Release Notesrelease 5.0IntroductionProtein is as sequence of amino acid residues connected by peptide bonds. Each
amino acid residue is characterized by a unique combination of its physical and chemical
properties.proteinkotakes advantage of this to represent protein sequence as
a spatial distribution of the physicochemical properties of its amino acid
residues, capturing the complementing or cancelling effect of neighbouring amino acid
residues.proteinkoenables numerical representation of a protein sequence
while preserving the information of its underlying physicochemical properties. This
allows the investigation of relationships and interactions between proteins as well as
potential discovery of underlying physicochemical properties which facilitate those interactions.Methodsproteinkoimplements a fairly simple algorithm. The protein sequence is mapped to a
vectorVrepresenting a distribution of a certain physicochemical property of the entire protein.
Each amino acid residueAiis modeled independently as a Gaussian curveGiand
scaled by the corresponding value from the encoding scheme.Giis mapped to
the slice ofVwhich is centered at a position correspondig to the position ofAiin the sequence and
which spansLneighbouring slices on each side.
The overlap allows to sum the complementing or cancelling effects
that the neighbouring amino acid residues may exert on the local physicochemical
property of the protein. The extent of overlap is determined by two factors:
overlap distance (L) and sigma factor. Overlap distance determines how many
neighbouring slicesGispans on each side. Sigma determines the shape of the Gaussian curve
of each of the amino acid residues (seeexample). Both of these parametersproteinkoaccepts as
function arguments allowing users to modify the shape of final distribution as needed.InstalationpipinstallproteinkoUsageproteinkoimplements two functions:model_distributionandencode_sequence.
Both functions haveencoding_schemeparameter which accepts a python dictionary with
amino acid one-letter codes as keys.Example 1:fromproteinkoimportmodel_distribution,encode_sequenceimportmatplotlib.pyplotaspltfrompyaaiscimportAaindexsequence='MEEPQSDPSVEPPLSQETFSDLWKLLPENNVLSPLPSQAMDDLMLSPDDIEQWFTEDPGP'encoding_scheme=Aaindex().get('ARGP820101',dbkey='aaindex1').index_datadist_1=model_distribution(sequence,encoding_scheme,overlap_distance=2,sigma=0.4)dist_2=model_distribution(sequence,encoding_scheme,overlap_distance=3,sigma=0.8)encoded=encode_sequence(sequence,encoding_scheme)fig,ax=plt.subplots(3,1,sharey=True,figsize=(12,5))ax[0].plot(dist_1)ax[0].grid()ax[0].set_xticklabels([])ax[0].set_title('Modeled distribution, overlap_distance=2, sigma=0.4')ax[1].plot(dist_2)ax[1].grid()ax[1].set_xticklabels([])ax[1].set_title('Modeled distribution, overlap_distance=3, sigma=0.8')ax[1].set_ylabel('Hydrophobicity index - ARGP820101')ax[2].bar(range(len(encoded)),encoded)ax[2].grid()ax[2].set_xticks(range(len(sequence)))ax[2].set_xticklabels([xforxinsequence])ax[2].set_title('Sequence')plt.show()Example 2fromproteinkoimportmodel_distributionimportmatplotlib.pyplotaspltfrompyaaiscimportAaindexsequence='MEEPQSDPSVE'encoding_scheme=Aaindex().get('ARGP820101',dbkey='aaindex1').index_datadist=model_distribution(sequence,encoding_scheme,overlap_distance=2,sigma=0.4)sampled_dist=model_distribution(sequence,encoding_scheme,overlap_distance=2,sigma=0.4,sampling_points=16)fig,ax=plt.subplots(2,1,figsize=(6,4))ax[0].plot(dist)ax[0].grid()ax[0].set_xticklabels([])ax[0].set_title('Modeled distribution')ax[0].set_ylabel('Hydrophobicity index')ax[1].bar(range(16),sampled_dist)ax[1].grid()ax[1].set_xticklabels([])ax[1].set_title('Sampled distribution')ax[1].set_ylabel('Hydrophobicity index')plt.show()Release Notesrelease 5.0Algorithm changes:Number of overlaping neigbouring amino acid residues has been added as function argument
and default value set tooverlap_distance=2.Defaultsigmavalue has been changed from0.8to0.4.Normalization and standardization of modeled distribution are deprecated.
No pre or post processing is applied.Scaling factor has been decreased from100to40, reducing the number of computations
and increasing the performance of algorithm.Major code changes:Proteinkoclass has been removed and algorithm is implemented undermodel_distributionfunction.New functionencode_sequencehas been introduced which simply encodes sequence
with values provided in the encoding table.Encoding tables are now passed as python dictionaries instead ofpandasdataframe.Use ofpandasandscipypackages has been replaced with python functions making
the code more lightweight and increasing the performance of algorithm.Minor code changes:vlenparameter has been renamed tosampling_pointsbecause it is the number
of points to sample from final distribution.schemaparameter has been renamed toencoding_scheme.