@@ -24,14 +24,14 @@ knitr::opts_chunk$set(
2424* ** Load the data** : ` ggcoverage ` can load BAM, BigWig (.bw), BedGraph files from various NGS data, including WGS, RNA-seq, ChIP-seq, ATAC-seq, et al.
2525* ** Create genome coverage plot**
2626* ** Add annotations** : ` ggcoverage ` supports six different annotations:
27- * ** Base and amino acid annotaion** : Visualize genome coverage at single-nucleotide level with bases and amino acids.
27+ * ** base and amino acid annotaion** : Visualize genome coverage at single-nucleotide level with bases and amino acids.
2828 * ** GC annotation** : Visualize genome coverage with GC content
2929 * ** gene annotation** : Visualize genome coverage across whole gene
3030 * ** transcription annotation** : Visualize genome coverage across different transcripts
3131 * ** ideogram annotation** : Visualize the region showing on whole chromosome
3232 * ** peak annotation** : Visualize genome coverage and peak identified
3333
34- ` ggcoverage ` utilizes ` ggplot2 ` plotting system, so its usage is ggplot2-style!
34+ ` ggcoverage ` utilizes ` ggplot2 ` plotting system, so its usage is ** ggplot2-style** !
3535
3636
3737## Installation
@@ -188,6 +188,50 @@ track.df <- LoadTrackFile(
188188head(track.df)
189189```
190190
191+ #### Default color scheme
192+ For base and amino acid annotation, we have following default color schemes, you can change with ` nuc.color ` and ` aa.color ` parameters.
193+
194+ Default color scheme for base annotation is ` Clustal-style ` , more popular color schemes is available [ here] ( https://www.biostars.org/p/171056/ ) .
195+ ``` {r base_color_scheme, warning=FALSE, fig.height = 2, fig.width = 6, fig.align = "center"}
196+ # color scheme
197+ nuc.color = c("A" = "#ff2b08", "C" = "#009aff", "G" = "#ffb507", "T" = "#00bc0d")
198+ # create plot
199+ graphics::par(mar = c(1, 5, 1, 1))
200+ graphics::image(
201+ 1:length(nuc.color), 1, as.matrix(1:length(nuc.color)),
202+ col = nuc.color,
203+ xlab = "", ylab = "", xaxt = "n", yaxt = "n", bty = "n"
204+ )
205+ graphics::text(1:length(nuc.color), 1, names(nuc.color))
206+ graphics::mtext(
207+ text = "Base", adj = 1, las = 1,
208+ side = 2
209+ )
210+ ```
211+
212+ Default color scheme for amino acid annotation is from [ Residual colours: a proposal for aminochromography] ( https://academic.oup.com/peds/article/10/7/743/1593029?login=false ) :
213+ ``` {r aa_color_scheme, warning=FALSE, fig.height = 9, fig.width = 10, fig.align = "center"}
214+ aa.color = c(
215+ "D" = "#FF0000", "S" = "#FF2400", "T" = "#E34234", "G" = "#FF8000", "P" = "#F28500",
216+ "C" = "#FFFF00", "A" = "#FDFF00", "V" = "#E3FF00", "I" = "#C0FF00", "L" = "#89318C",
217+ "M" = "#00FF00", "F" = "#50C878", "Y" = "#30D5C8", "W" = "#00FFFF", "H" = "#0F2CB3",
218+ "R" = "#0000FF", "K" = "#4b0082", "N" = "#800080", "Q" = "#FF00FF", "E" = "#8F00FF",
219+ "*" = "#FFC0CB", " " = "#FFFFFF", " " = "#FFFFFF", " " = "#FFFFFF", " " = "#FFFFFF"
220+ )
221+
222+ graphics::par(mar = c(1, 5, 1, 1))
223+ graphics::image(
224+ 1:5, 1:5, matrix(1:length(aa.color),nrow=5),
225+ col = rev(aa.color),
226+ xlab = "", ylab = "", xaxt = "n", yaxt = "n", bty = "n"
227+ )
228+ graphics::text(expand.grid(1:5,1:5), names(rev(aa.color)))
229+ graphics::mtext(
230+ text = "Amino acids", adj = 1, las = 1,
231+ side = 2
232+ )
233+ ```
234+
191235#### Add base and amino acid annotation
192236``` {r base_aa_coverage, warning=FALSE, fig.height = 10, fig.width = 12, fig.align = "center"}
193237ggcoverage(data = track.df, color = "grey", range.position = "out", single.nuc=T, rect.color = "white") +
0 commit comments