acc: Auto Cross Covariance (ACC) for Generating Scales-Based...

Description Usage Arguments Value Note Author(s) References See Also Examples

View source: R/misc-06-acc.R

Description

This function calculates the auto covariance and auto cross covariance for generating scale-based descriptors of the same length.

Usage

1
acc(mat, lag)

Arguments

mat

A p * n matrix. Each row represents one scale (total p scales), each column represents one amino acid position (total n amino acids).

lag

The lag parameter. Must be less than the amino acids.

Value

A length lag * p^2 named vector, the element names are constructed by: the scales index (crossed scales index) and lag index.

Note

Please see the references for details about auto cross covariance.

Author(s)

Nan Xiao <https://nanx.me>

References

Wold, S., Jonsson, J., Sj\"orstr\"om, M., Sandberg, M., & R\"annar, S. (1993). DNA and peptide sequences and chemical processes multivariately modelled by principal component analysis and partial least-squares projections to latent structures. Analytica chimica acta, 277(2), 239–253.

Sj\"ostr\"om, M., R\"annar, S., & Wieslander, A. (1995). Polypeptide sequence property relationships in Escherichia coli based on auto cross covariances. Chemometrics and intelligent laboratory systems, 29(2), 295–305.

See Also

See extractScales for scales-based descriptors. For more details, see extractDescScales and extractProtFP.

Examples

1
2
3
4
5
p = 8    # p is the scales number
n = 200  # n is the amino acid number
lag = 7  # the lag paramter
mat = matrix(rnorm(p * n), nrow = p, ncol = n)
acc(mat, lag)

Example output

    scl1.lag1     scl2.lag1     scl3.lag1     scl4.lag1     scl5.lag1 
 1.559349e-02  7.901299e-02  9.432965e-02  7.078011e-02  1.803872e-01 
    scl6.lag1     scl7.lag1     scl8.lag1     scl1.lag2     scl2.lag2 
-3.312658e-02  9.180606e-02  1.120168e-01  8.760813e-02 -6.367908e-02 
    scl3.lag2     scl4.lag2     scl5.lag2     scl6.lag2     scl7.lag2 
 1.869673e-01  3.698841e-02  3.546674e-02  2.780030e-02 -8.445763e-02 
    scl8.lag2     scl1.lag3     scl2.lag3     scl3.lag3     scl4.lag3 
 8.045985e-02 -9.592370e-02 -3.813060e-02 -1.100889e-01  7.732996e-02 
    scl5.lag3     scl6.lag3     scl7.lag3     scl8.lag3     scl1.lag4 
 5.334848e-02  1.054354e-01  6.794573e-02 -4.720362e-02  6.527993e-02 
    scl2.lag4     scl3.lag4     scl4.lag4     scl5.lag4     scl6.lag4 
 6.794073e-02 -1.936031e-02  1.059284e-01  6.238135e-02  4.380868e-02 
    scl7.lag4     scl8.lag4     scl1.lag5     scl2.lag5     scl3.lag5 
-9.068825e-03  9.856916e-02 -1.026072e-01  8.313387e-02 -2.040635e-01 
    scl4.lag5     scl5.lag5     scl6.lag5     scl7.lag5     scl8.lag5 
-3.499401e-02  6.371903e-03 -2.898572e-02 -5.287266e-02 -2.077499e-02 
    scl1.lag6     scl2.lag6     scl3.lag6     scl4.lag6     scl5.lag6 
 1.287721e-02  6.120098e-02  3.335343e-02 -3.628802e-02 -9.322444e-03 
    scl6.lag6     scl7.lag6     scl8.lag6     scl1.lag7     scl2.lag7 
-1.294026e-02 -5.203442e-02  1.039518e-01 -3.695796e-02 -1.027434e-01 
    scl3.lag7     scl4.lag7     scl5.lag7     scl6.lag7     scl7.lag7 
 1.541207e-02  3.218949e-02 -1.206757e-02  1.197961e-01 -1.644974e-02 
    scl8.lag7   scl1.2.lag1   scl1.3.lag1   scl1.4.lag1   scl1.5.lag1 
 3.227419e-02  1.294315e-01 -6.895443e-03 -1.475999e-01  1.114469e-01 
  scl1.6.lag1   scl1.7.lag1   scl1.8.lag1   scl2.3.lag1   scl2.4.lag1 
-1.171759e-01 -5.332021e-02 -3.453305e-02  3.954447e-02  1.757149e-02 
  scl2.5.lag1   scl2.6.lag1   scl2.7.lag1   scl2.8.lag1   scl3.4.lag1 
 1.182873e-01 -8.030409e-02 -6.136544e-02 -1.109435e-02  1.581300e-02 
  scl3.5.lag1   scl3.6.lag1   scl3.7.lag1   scl3.8.lag1   scl4.5.lag1 
-1.132514e-01 -2.479869e-02  3.331165e-02 -4.890801e-02  6.689011e-02 
  scl4.6.lag1   scl4.7.lag1   scl4.8.lag1   scl5.6.lag1   scl5.7.lag1 
-1.385773e-01 -7.457750e-02 -1.063309e-01 -4.657543e-02  8.576450e-03 
  scl5.8.lag1   scl6.7.lag1   scl6.8.lag1   scl7.8.lag1   scl2.1.lag1 
-1.242281e-01 -3.580201e-02  7.230243e-02 -1.135440e-01 -2.926515e-02 
  scl3.1.lag1   scl4.1.lag1   scl5.1.lag1   scl6.1.lag1   scl7.1.lag1 
 1.211825e-01 -1.435218e-01  1.150189e-01  9.298239e-02 -7.326076e-02 
  scl8.1.lag1   scl3.2.lag1   scl4.2.lag1   scl5.2.lag1   scl6.2.lag1 
 4.726077e-02  8.597149e-02 -6.578699e-02  2.675838e-02 -6.150067e-02 
  scl7.2.lag1   scl8.2.lag1   scl4.3.lag1   scl5.3.lag1   scl6.3.lag1 
 1.055867e-06  8.271792e-02  8.721275e-03 -4.524036e-02  2.997718e-02 
  scl7.3.lag1   scl8.3.lag1   scl5.4.lag1   scl6.4.lag1   scl7.4.lag1 
 8.668547e-02 -1.136690e-01  5.832888e-02  5.910575e-02  9.892478e-02 
  scl8.4.lag1   scl6.5.lag1   scl7.5.lag1   scl8.5.lag1   scl7.6.lag1 
 4.278194e-02 -1.730525e-02 -2.082670e-02 -3.587126e-04 -1.283499e-01 
  scl8.6.lag1   scl8.7.lag1   scl1.2.lag2   scl1.3.lag2   scl1.4.lag2 
 4.840394e-02  1.097668e-01  4.632157e-02 -6.583519e-02 -1.244321e-01 
  scl1.5.lag2   scl1.6.lag2   scl1.7.lag2   scl1.8.lag2   scl2.3.lag2 
 8.565315e-02  5.106533e-02  4.471907e-02  4.046147e-02  6.384542e-02 
  scl2.4.lag2   scl2.5.lag2   scl2.6.lag2   scl2.7.lag2   scl2.8.lag2 
 1.785712e-02  8.003983e-03  3.116500e-02 -2.755329e-02  2.364417e-02 
  scl3.4.lag2   scl3.5.lag2   scl3.6.lag2   scl3.7.lag2   scl3.8.lag2 
 8.840552e-02 -5.037933e-02 -2.944977e-02  1.585299e-02 -1.055640e-01 
  scl4.5.lag2   scl4.6.lag2   scl4.7.lag2   scl4.8.lag2   scl5.6.lag2 
 3.079590e-02  1.151737e-01 -8.008639e-02 -8.232419e-02 -4.517976e-02 
  scl5.7.lag2   scl5.8.lag2   scl6.7.lag2   scl6.8.lag2   scl7.8.lag2 
 6.993194e-03  2.818151e-02 -5.866028e-02  7.415333e-02 -1.439575e-01 
  scl2.1.lag2   scl3.1.lag2   scl4.1.lag2   scl5.1.lag2   scl6.1.lag2 
 3.295520e-02 -1.068787e-01 -1.759202e-03 -3.575398e-02  3.337075e-02 
  scl7.1.lag2   scl8.1.lag2   scl3.2.lag2   scl4.2.lag2   scl5.2.lag2 
-4.474040e-02  2.210264e-02 -1.535765e-03  5.725409e-02 -3.909296e-02 
  scl6.2.lag2   scl7.2.lag2   scl8.2.lag2   scl4.3.lag2   scl5.3.lag2 
-9.448281e-02  1.593313e-02  1.299509e-02  3.198853e-02 -5.257437e-02 
  scl6.3.lag2   scl7.3.lag2   scl8.3.lag2   scl5.4.lag2   scl6.4.lag2 
 3.920306e-02  1.198066e-02  1.081668e-02  3.594858e-02 -1.002077e-01 
  scl7.4.lag2   scl8.4.lag2   scl6.5.lag2   scl7.5.lag2   scl8.5.lag2 
 2.060432e-02 -3.071622e-02  2.443255e-02 -6.091673e-02  4.579443e-02 
  scl7.6.lag2   scl8.6.lag2   scl8.7.lag2   scl1.2.lag3   scl1.3.lag3 
-1.051603e-01  2.820091e-02 -1.218702e-01  2.378283e-02 -8.548008e-02 
  scl1.4.lag3   scl1.5.lag3   scl1.6.lag3   scl1.7.lag3   scl1.8.lag3 
-8.247185e-02  8.238262e-02 -2.455855e-02 -9.321522e-03  5.672919e-02 
  scl2.3.lag3   scl2.4.lag3   scl2.5.lag3   scl2.6.lag3   scl2.7.lag3 
-7.932750e-02  1.050259e-01 -9.877095e-02 -3.325536e-02  1.277965e-02 
  scl2.8.lag3   scl3.4.lag3   scl3.5.lag3   scl3.6.lag3   scl3.7.lag3 
-5.228105e-02  8.878162e-02 -3.028465e-02 -9.039223e-02  4.170943e-02 
  scl3.8.lag3   scl4.5.lag3   scl4.6.lag3   scl4.7.lag3   scl4.8.lag3 
-6.789667e-02 -9.192267e-03 -5.054005e-02 -3.180009e-04 -7.328717e-02 
  scl5.6.lag3   scl5.7.lag3   scl5.8.lag3   scl6.7.lag3   scl6.8.lag3 
 1.657046e-01  1.172018e-01  1.814542e-01  8.770980e-02  9.214144e-02 
  scl7.8.lag3   scl2.1.lag3   scl3.1.lag3   scl4.1.lag3   scl5.1.lag3 
-6.008602e-02 -6.537410e-02  7.310850e-02 -6.424922e-02  6.552383e-02 
  scl6.1.lag3   scl7.1.lag3   scl8.1.lag3   scl3.2.lag3   scl4.2.lag3 
-8.911908e-04 -4.095966e-02 -2.330140e-02  4.842771e-02 -1.450321e-01 
  scl5.2.lag3   scl6.2.lag3   scl7.2.lag3   scl8.2.lag3   scl4.3.lag3 
 1.327828e-01  7.221906e-02  1.077304e-02 -5.913468e-02 -6.539904e-02 
  scl5.3.lag3   scl6.3.lag3   scl7.3.lag3   scl8.3.lag3   scl5.4.lag3 
 4.045868e-02 -8.065906e-03  3.079978e-03  4.503779e-02  6.926173e-02 
  scl6.4.lag3   scl7.4.lag3   scl8.4.lag3   scl6.5.lag3   scl7.5.lag3 
 1.416282e-02  9.560617e-02 -2.474453e-02 -8.077909e-02 -3.787965e-03 
  scl8.5.lag3   scl7.6.lag3   scl8.6.lag3   scl8.7.lag3   scl1.2.lag4 
 8.683996e-02  1.138321e-01  2.912520e-03  3.680134e-03 -3.000589e-02 
  scl1.3.lag4   scl1.4.lag4   scl1.5.lag4   scl1.6.lag4   scl1.7.lag4 
-9.731446e-02  4.368611e-02 -1.563782e-01 -1.000416e-01  6.762650e-02 
  scl1.8.lag4   scl2.3.lag4   scl2.4.lag4   scl2.5.lag4   scl2.6.lag4 
-1.438051e-02 -6.594412e-02  5.750107e-02  1.942781e-02 -9.274863e-02 
  scl2.7.lag4   scl2.8.lag4   scl3.4.lag4   scl3.5.lag4   scl3.6.lag4 
-8.031627e-03  8.906074e-02 -6.255334e-02  6.191451e-02 -3.643570e-02 
  scl3.7.lag4   scl3.8.lag4   scl4.5.lag4   scl4.6.lag4   scl4.7.lag4 
-8.807082e-02 -2.228942e-02  9.054597e-03 -2.969955e-03 -2.297651e-03 
  scl4.8.lag4   scl5.6.lag4   scl5.7.lag4   scl5.8.lag4   scl6.7.lag4 
 2.323210e-02  3.121835e-02  3.132970e-02  9.580093e-02  8.473313e-02 
  scl6.8.lag4   scl7.8.lag4   scl2.1.lag4   scl3.1.lag4   scl4.1.lag4 
 6.728623e-02 -4.130166e-02 -7.608419e-02 -9.267007e-02  2.126307e-01 
  scl5.1.lag4   scl6.1.lag4   scl7.1.lag4   scl8.1.lag4   scl3.2.lag4 
-2.326023e-02 -1.200310e-02  3.221337e-02 -2.906750e-02 -1.462085e-01 
  scl4.2.lag4   scl5.2.lag4   scl6.2.lag4   scl7.2.lag4   scl8.2.lag4 
 4.007412e-02 -8.869751e-02 -3.040289e-02 -1.251936e-01 -2.688557e-02 
  scl4.3.lag4   scl5.3.lag4   scl6.3.lag4   scl7.3.lag4   scl8.3.lag4 
 3.876447e-02 -4.082321e-03  3.431206e-02  3.290199e-02 -1.959118e-02 
  scl5.4.lag4   scl6.4.lag4   scl7.4.lag4   scl8.4.lag4   scl6.5.lag4 
 7.217121e-02 -6.559071e-02 -4.789914e-02  3.561000e-02  5.755981e-02 
  scl7.5.lag4   scl8.5.lag4   scl7.6.lag4   scl8.6.lag4   scl8.7.lag4 
 2.069341e-02  4.684482e-02  2.448034e-02  1.279589e-01 -1.051031e-02 
  scl1.2.lag5   scl1.3.lag5   scl1.4.lag5   scl1.5.lag5   scl1.6.lag5 
-1.267148e-01  3.459695e-02 -6.860189e-02  5.573114e-02  2.669746e-02 
  scl1.7.lag5   scl1.8.lag5   scl2.3.lag5   scl2.4.lag5   scl2.5.lag5 
 7.109506e-02  1.588972e-02 -5.879924e-02 -6.391312e-02  1.299020e-01 
  scl2.6.lag5   scl2.7.lag5   scl2.8.lag5   scl3.4.lag5   scl3.5.lag5 
 1.975541e-03  3.992934e-03  5.113766e-02  6.429646e-03 -1.219654e-01 
  scl3.6.lag5   scl3.7.lag5   scl3.8.lag5   scl4.5.lag5   scl4.6.lag5 
-2.272934e-02  1.642599e-02 -1.275224e-01  7.674678e-02  1.160522e-02 
  scl4.7.lag5   scl4.8.lag5   scl5.6.lag5   scl5.7.lag5   scl5.8.lag5 
-1.419435e-01 -1.430350e-02  6.122505e-02 -8.522213e-02  1.111118e-01 
  scl6.7.lag5   scl6.8.lag5   scl7.8.lag5   scl2.1.lag5   scl3.1.lag5 
 2.715428e-02 -3.240284e-02 -2.538988e-02  4.859332e-02  6.742317e-02 
  scl4.1.lag5   scl5.1.lag5   scl6.1.lag5   scl7.1.lag5   scl8.1.lag5 
 2.177325e-02  2.168774e-02  5.747453e-02  5.987855e-02 -1.701954e-02 
  scl3.2.lag5   scl4.2.lag5   scl5.2.lag5   scl6.2.lag5   scl7.2.lag5 
-6.787747e-02  1.609086e-01  7.794121e-03  1.172798e-01  5.684744e-02 
  scl8.2.lag5   scl4.3.lag5   scl5.3.lag5   scl6.3.lag5   scl7.3.lag5 
 6.484027e-02 -3.572719e-02  3.172769e-02  4.787919e-02 -5.081410e-02 
  scl8.3.lag5   scl5.4.lag5   scl6.4.lag5   scl7.4.lag5   scl8.4.lag5 
 1.599801e-02  2.006058e-02  5.776753e-02 -6.485350e-02  5.102945e-02 
  scl6.5.lag5   scl7.5.lag5   scl8.5.lag5   scl7.6.lag5   scl8.6.lag5 
-1.771328e-02 -1.146050e-01  6.354820e-02 -6.942243e-02 -4.405495e-02 
  scl8.7.lag5   scl1.2.lag6   scl1.3.lag6   scl1.4.lag6   scl1.5.lag6 
 2.829349e-02 -4.600548e-02 -6.882643e-02  8.565279e-03  9.475378e-02 
  scl1.6.lag6   scl1.7.lag6   scl1.8.lag6   scl2.3.lag6   scl2.4.lag6 
 5.294319e-02  1.378280e-01  2.550368e-02  2.245629e-03  4.051222e-02 
  scl2.5.lag6   scl2.6.lag6   scl2.7.lag6   scl2.8.lag6   scl3.4.lag6 
-5.517131e-02  1.514092e-01 -9.444076e-04 -7.073150e-02 -8.727860e-02 
  scl3.5.lag6   scl3.6.lag6   scl3.7.lag6   scl3.8.lag6   scl4.5.lag6 
-8.571258e-02  1.708957e-02  4.956185e-02 -4.118394e-02  2.315556e-01 
  scl4.6.lag6   scl4.7.lag6   scl4.8.lag6   scl5.6.lag6   scl5.7.lag6 
 6.802027e-02 -1.459553e-02  7.737615e-03 -1.001826e-02  2.091279e-02 
  scl5.8.lag6   scl6.7.lag6   scl6.8.lag6   scl7.8.lag6   scl2.1.lag6 
-3.236865e-02 -6.711015e-02  1.192613e-02  2.472331e-02  6.777846e-02 
  scl3.1.lag6   scl4.1.lag6   scl5.1.lag6   scl6.1.lag6   scl7.1.lag6 
-2.398790e-02  1.048393e-01  9.461454e-02 -2.033534e-03  1.077043e-01 
  scl8.1.lag6   scl3.2.lag6   scl4.2.lag6   scl5.2.lag6   scl6.2.lag6 
-6.522614e-02 -1.208085e-01  7.239259e-02 -1.650682e-02 -3.147162e-02 
  scl7.2.lag6   scl8.2.lag6   scl4.3.lag6   scl5.3.lag6   scl6.3.lag6 
 7.706113e-02  6.820695e-02 -9.739766e-02 -7.890872e-02 -1.426543e-02 
  scl7.3.lag6   scl8.3.lag6   scl5.4.lag6   scl6.4.lag6   scl7.4.lag6 
-5.722470e-02  1.923885e-02  1.315457e-01  1.106026e-01  5.122178e-02 
  scl8.4.lag6   scl6.5.lag6   scl7.5.lag6   scl8.5.lag6   scl7.6.lag6 
 9.867545e-02 -9.641438e-02  1.884726e-02 -6.718868e-03 -1.957001e-02 
  scl8.6.lag6   scl8.7.lag6   scl1.2.lag7   scl1.3.lag7   scl1.4.lag7 
-2.115275e-02 -3.778983e-02 -4.885251e-02  5.692282e-03  1.030243e-01 
  scl1.5.lag7   scl1.6.lag7   scl1.7.lag7   scl1.8.lag7   scl2.3.lag7 
 7.633842e-02  3.572655e-02  1.554322e-01 -1.873557e-01  2.278357e-03 
  scl2.4.lag7   scl2.5.lag7   scl2.6.lag7   scl2.7.lag7   scl2.8.lag7 
 1.068900e-01  2.321209e-02 -1.336828e-03 -5.886400e-02 -8.998996e-02 
  scl3.4.lag7   scl3.5.lag7   scl3.6.lag7   scl3.7.lag7   scl3.8.lag7 
-7.579453e-02 -1.188657e-02 -3.969874e-02  4.868405e-02 -8.764684e-02 
  scl4.5.lag7   scl4.6.lag7   scl4.7.lag7   scl4.8.lag7   scl5.6.lag7 
 7.121363e-02 -1.315683e-01  1.268638e-01  4.589499e-02 -1.682654e-02 
  scl5.7.lag7   scl5.8.lag7   scl6.7.lag7   scl6.8.lag7   scl7.8.lag7 
 6.307443e-02 -1.514884e-01  5.148815e-02  4.506070e-02 -6.932665e-02 
  scl2.1.lag7   scl3.1.lag7   scl4.1.lag7   scl5.1.lag7   scl6.1.lag7 
-2.543033e-02  1.433199e-01  9.727379e-02 -6.754793e-02 -6.269466e-02 
  scl7.1.lag7   scl8.1.lag7   scl3.2.lag7   scl4.2.lag7   scl5.2.lag7 
 1.146291e-01 -8.071088e-03  1.181236e-01  2.698652e-02 -1.055932e-01 
  scl6.2.lag7   scl7.2.lag7   scl8.2.lag7   scl4.3.lag7   scl5.3.lag7 
 2.356088e-02 -5.991216e-02 -1.034757e-01  1.346592e-03  4.449664e-02 
  scl6.3.lag7   scl7.3.lag7   scl8.3.lag7   scl5.4.lag7   scl6.4.lag7 
 1.291761e-01  8.281737e-02 -2.057895e-04  9.450374e-02 -4.566989e-03 
  scl7.4.lag7   scl8.4.lag7   scl6.5.lag7   scl7.5.lag7   scl8.5.lag7 
-3.682671e-02  6.989757e-02  2.796475e-02 -3.526539e-03  4.767040e-02 
  scl7.6.lag7   scl8.6.lag7   scl8.7.lag7 
 7.303518e-02 -1.662281e-02  5.990315e-02 

protr documentation built on Nov. 22, 2018, 9:04 a.m.