View source: R/scaledHydropathy.R
scaledHydropathyLocal | R Documentation |
This is used to calculate the scaled hydropathy of an amino acid sequence using a sliding window. The output is either a data frame or graph showing the calculated scores for each window along the sequence.
scaledHydropathyLocal( sequence, window = 9, plotResults = TRUE, proteinName = NA, ... )
sequence |
amino acid sequence as a single character string, a vector of single characters, or an AAString object. It also supports a single character string that specifies the path to a .fasta or .fa file. |
window |
a positive, odd integer. 9 by default. Sets the size of sliding window, must be an odd number. The window determines the number of residues to be analyzed and averaged for each position along the sequence. |
plotResults |
logical value, TRUE by default.
If |
proteinName |
character string with length = 1. optional setting to replace the name of the plot if hydropathy = TRUE. |
... |
any additional parameters, especially those for plotting. |
see plotResults argument
For users who wish to keep a common aesthetic, the following colors are
used when plotResults = TRUE.
Dynamic line colors:
Close to 0 = "skyblue3" or "#6CA6CD"
Close to 1 = "chocolate1" or "#FF7F24"
Close to midpoint = "grey65" or "#A6A6A6"
Kyte, J., & Doolittle, R. F. (1982). A simple method for displaying the hydropathic character of a protein. Journal of molecular biology, 157(1), 105-132.
KDNorm
for residue values.
Other scaled hydropathy functions:
KDNorm
,
foldIndexR()
,
meanScaledHydropathy()
,
scaledHydropathyGlobal()
#Amino acid sequences can be character strings aaString <- "ACDEFGHIKLMNPQRSTVWY" #Amino acid sequences can also be character vectors aaVector <- c("A", "C", "D", "E", "F", "G", "H", "I", "K", "L", "M", "N", "P", "Q", "R", "S", "T", "V", "W", "Y") #Alternatively, .fasta files can also be used by providing ##The path to the file as a character string. exampleDF <- scaledHydropathyLocal(aaString, plotResults = FALSE) head(exampleDF) exampleDF <- scaledHydropathyLocal(aaVector, plotResults = FALSE) head(exampleDF) #Changing window will alter the number of residues analyzed exampleDF_window3 <- scaledHydropathyLocal(aaString, window = 3, plotResults = FALSE) head(exampleDF_window3) exampleDF_window15 <- scaledHydropathyLocal(aaString, window = 15, plotResults = FALSE) head(exampleDF_window15) #plotResults = TRUE will output a ggplot scaledHydropathyLocal(aaString, plot = TRUE) #since it is a ggplot, you can change or annotate the plot gg <- scaledHydropathyLocal(aaVector, window = 3, plot = TRUE) gg <- gg + ggplot2::ylab("Local Hydropathy") gg <- gg + ggplot2::geom_text(data = exampleDF_window3, ggplot2::aes(label = CenterResidue, y = WindowHydropathy + 0.1)) plot(gg)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.