% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/pcm-01-extractScales.R
\name{extractScales}
\alias{extractScales}
\title{Scales-Based Descriptors derived by Principal Components Analysis}
\usage{
extractScales(x, propmat, pc, lag, scale = TRUE, silent = TRUE)
}
\arguments{
\item{x}{A character vector, as the input protein sequence.}

\item{propmat}{A matrix containing the properties for the amino acids.
Each row represent one amino acid type, each column represents
one property. Note that the one-letter row names must be provided
for we need them to seek the properties for each AA type.}

\item{pc}{Integer. Use the first pc principal components as the scales.
Must be no greater than the number of AA properties provided.}

\item{lag}{The lag parameter. Must be less than the amino acids.}

\item{scale}{Logical. Should we auto-scale the property matrix
(\code{propmat}) before PCA? Default is \code{TRUE}.}

\item{silent}{Logical. Whether we print the standard deviation,
proportion of variance and the cumulative proportion of
the selected principal components or not. Default is \code{TRUE}.}
}
\value{
A length \code{lag * p^2} named vector,
\code{p} is the number of scales (principal components) selected.
}
\description{
This function calculates scales-based descriptors
derived by Principal Components Analysis (PCA).
Users can provide customized amino acid property matrices.
This function implements the core computation procedure needed for
the scales-based descriptors derived by AA-Properties (AAindex)
and scales-based descriptors derived by 20+ classes of 2D and 3D
molecular descriptors (Topological, WHIM, VHSE, etc.) in the protr package.
}
\examples{
x <- readFASTA(system.file("protseq/P00750.fasta", package = "protr"))[[1]]
data(AAindex)
AAidxmat <- t(na.omit(as.matrix(AAindex[, 7:26])))
scales <- extractScales(x, propmat = AAidxmat, pc = 5, lag = 7, silent = FALSE)
}
\seealso{
See \code{\link{extractDescScales}} scales descriptors based on
20+ classes of molecular descriptors, and \code{\link{extractProtFP}}
for amino acid property based scales descriptors (protein fingerprint).
}
\author{
Nan Xiao <\url{https://nanx.me}>
}
