Description Usage Arguments Value See Also Examples
This is a graphical function used to visualize data along an
amino acid sequence.
The purpose of this function is to show the entire sequence and color
residues based on properties. This may help identify important residues
along a protein. This was designed with the goal of visualizing discrete
values, but has since been expanded to visualize numeric/continuous values.
1 2 3 4 5 6 7 8 9 10 |
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. |
property |
a vector with length equal to sequence length. This is what is visualized on the function. Can be discrete or continuous values. |
nbResidues |
numeric value, 30 by default. The number of residues to display on each row of the plot. It is not recommended to be over 50 or under 10 for standard sequences. Optimal value may vary between sequences of extreme lengths. |
labelType |
character string, "both" by default.
accepted values are |
everyN |
numeric value or vector of numeric values with length = 2.
This is used to show every Nth amino acid and/or residue number.
To show every value, set |
labelLocation |
character string or vector of character strings
with length = 2. When |
rotationAngle |
numeric value or vector of numeric values with length = 2. This value is used to rotate text. Especially useful when printing many residue numbers. |
customColors |
vector of colors as character strings. NA by default. Used to support custom plot colors. If property is a discrete scale, a character vector of colors with length = number of unique discrete observations is required. If property is a continuous scale, a character vector of the colors for c("highColor","lowColor","midColor"). Set NA to skip custom colors. |
A ggplot.
sequenceMapCoordinates
for mapping coordinates
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 | #Get a data frame returned from another function
aaVector <- c("A", "C", "D", "E", "F",
"G", "H", "I", "K", "L",
"M", "N", "P", "Q", "R",
"S", "T", "V", "W", "Y")
## As a continuous property
exampleDF_cont <- chargeCalculationGlobal(sequence = aaVector)
head(exampleDF_cont)
## Or as a discrete property
exampleDF_disc <- structuralTendency(sequence = aaVector)
head(exampleDF_disc)
sequenceMap(sequence = exampleDF_cont$AA,
property = exampleDF_cont$Charge,
nbResidues = 3,
labelType = "both")
sequenceMap(sequence = exampleDF_disc$AA,
property = exampleDF_disc$Tendency,
nbResidues = 3,
labelType = "both")
#Change the layout of labels
sequenceMap(
sequence = exampleDF_disc$AA,
property = exampleDF_disc$Tendency,
nbResidues = 3,
labelType = "AA") #Only AA residue Labels
sequenceMap(
sequence = exampleDF_disc$AA,
property = exampleDF_disc$Tendency,
nbResidues = 3,
labelType = "number") #Only residue numner labels
sequenceMap(
sequence = exampleDF_disc$AA,
property = exampleDF_disc$Tendency,
nbResidues = 3,
labelType = "none") #No labels
#The text can also be rotated for ease of reading,
## espeically helpful for larger sequences.
sequenceMap(
sequence = exampleDF_disc$AA,
property = exampleDF_disc$Tendency,
labelType = "number",
labelLocation = "on",
rotationAngle = 90)
#Specify colors for continuous values
sequenceMap(
sequence = exampleDF_cont$AA,
property = exampleDF_cont$Charge,
customColors = c("purple", "pink", "grey90"))
#or discrete values
sequenceMap(
sequence = exampleDF_disc$AA,
property = exampleDF_disc$Tendency,
customColors = c("#999999", "#E69F00", "#56B4E9"))
#change the number of residues on each line with nbResidue
#or discrete values
sequenceMap(
sequence = exampleDF_disc$AA,
property = exampleDF_disc$Tendency,
nbResidues = 1)
sequenceMap(
sequence = exampleDF_disc$AA,
property = exampleDF_disc$Tendency,
nbResidues = 3)
sequenceMap(
sequence = exampleDF_disc$AA,
property = exampleDF_disc$Tendency,
nbResidues = 10)
#Use sequenceMapCoordinates for additional annotations
gg <- sequenceMap(sequence = exampleDF_disc$AA,
property = exampleDF_disc$Tendency,
nbResidues = 3,
labelType = "both")
#Change the nbResidues to correspond to the sequenceMap setting
mapCoordDF <- sequenceMapCoordinates(aaVector,
nbResidues = 3)
head(mapCoordDF)
#subsetting for positive residues
mapCoordDF_subset <- mapCoordDF$AA %in% c("K", "R", "H")
mapCoordDF_subset <- mapCoordDF[mapCoordDF_subset,]
library(ggplot2)
gg <- gg + geom_point(inherit.aes = FALSE,
data = mapCoordDF_subset,
aes(x = col + 0.5, #to center on the residue
y = row + 0.2), #to move above on the residue
color = "purple",
size = 3,
shape = 3)
plot(gg)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.