Contents

1 introduction

A sequence logo has been widely used as a graphical representation of an alignment of multiple amino acid or nucleic acid sequences. There is a package seqlogo(Bembom 2006) implemented in R to draw DNA sequence logos. And another package motifStack(Ou 2012) was developed for drawing sequence logos for Amino Acid, DNA and RNA sequences. motifStack also has the capability for graphical representation of multiple motifs.

IceLogo(Colaert et al. 2009) is a tool developed in java to visualize significant conserved sequence patterns in an alignment of multiple peptide sequence against background sequences. Compare to webLogo(Crooks et al. 2004), which relying on information theory, iceLogo builds on probability theory. It is reported that iceLogo has a more dynamic nature and is correcter and completer in the analysis of conserved sequence patterns.

However iceLogo can only compare conserved sequences to reference sequences peptide by peptide. As we know, some conserved sequence patterns are not conserved by peptides but by groups such as charge, chemistry, hydrophobicity and etc.

Here we developed a R package:dagLogo based on iceLogo to visualize significant conserved sequence patterns in groups.

#Prepare environment You will need ghostscript: the full path to the executable can be set by the environment variable R_GSCMD. If this is unset, a GhostScript executable will be searched by name on your path. For example, on a Unix, linux or Mac “gs” is used for searching, and on Windows the setting of the environment variable GSC is used, otherwise commands “gswi64c.exe” then “gswin32c.exe” are tried.

Example on Windows: assume that the gswin32c.exe is installed at C:\ Program Files\ gs\ gs9.06\ bin, then open R and try:

Sys.setenv(R_GSCMD=file.path("C:", "Program Files", "gs", 
                             "gs9.06", "bin", "gswin32c.exe"))

3 using dagLogo to analysis Catobolite Activator Protein

CAP (Catabolite Activator Protein, also known as CRP for cAMP Receptor Protein) is a transcription promoter that binds at more than 100 sites within the E. coli genome.

The motif of the DNA-binding helix-turn-helix motif of the CAP family is drawn by motifStack as following figure.

library(motifStack)
protein<-read.table(file.path(find.package("motifStack"),"extdata","cap.txt"))
protein<-t(protein[,1:20])
motif<-pcm2pfm(protein)
motif<-new("pfm", mat=motif, name="CAP", 
            color=colorset(alphabet="AA",colorScheme="chemistry"))
##The DNA-binding helix-turn-helix motif of the CAP family ploted by motifStack
plot(motif)
Catobolite Activator Protein Motif

Figure 7: Catobolite Activator Protein Motif

If we use dagLogo to plot the motif, it will be shown as following figure. Residues 7-13 form the first helix, 14-17 the turn and 18-26 the DNA recognition helix. The glycine at position 15 appears to be critical in forming the turn.

library(Biostrings)
cap <- as.character(readAAStringSet(system.file("extdata", 
                                                "cap.fasta", 
                                                package="dagLogo")))
data(ecoli.proteome)
seq <- formatSequence(seq=cap, proteome=ecoli.proteome)
bg <- buildBackgroundModel(seq, bg="wholeGenome", 
                           proteome=ecoli.proteome, 
                           permutationSize=10L)
##The DNA-binding helix-turn-helix motif of the CAP family ploted by dagLogo
t0 <- testDAU(seq, bg)
dagLogo(t0)
Catobolite Activator Protein Motif

Figure 8: Catobolite Activator Protein Motif

If the peptides are grouped by chemistry and then plot, it will be shown as following figure. Positions 10, 14, 16, 21 and 25 are partially or completely buried and therefore tend to be populated by hydrophobic amino acids, which are very clear if we group the peptides by chemistry.

## The DNA-binding helix-turn-helix motif of the CAP family grouped by chemistry
t1 <- testDAU(seq, bg, group="chemistry")
dagLogo(t1, namehash=nameHash(t1@group), legend=TRUE)
Catobolite Activator Protein Motif

Figure 9: Catobolite Activator Protein Motif

4 Session Info

sessionInfo()
## R version 3.5.0 (2018-04-23)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Ubuntu 16.04.4 LTS
## 
## Matrix products: default
## BLAS: /home/biocbuild/bbs-3.7-bioc/R/lib/libRblas.so
## LAPACK: /home/biocbuild/bbs-3.7-bioc/R/lib/libRlapack.so
## 
## locale:
##  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
##  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=C              
##  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
##  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
##  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
## 
## attached base packages:
##  [1] stats4    parallel  grid      stats     graphics  grDevices utils    
##  [8] datasets  methods   base     
## 
## other attached packages:
##  [1] dagLogo_1.18.0      motifStack_1.24.0   Biostrings_2.48.0  
##  [4] XVector_0.20.0      IRanges_2.14.0      S4Vectors_0.18.0   
##  [7] ade4_1.7-11         MotIV_1.36.0        BiocGenerics_0.26.0
## [10] grImport_0.9-0      XML_3.98-1.11       biomaRt_2.36.0     
## [13] BiocStyle_2.8.0    
## 
## loaded via a namespace (and not attached):
##  [1] Rcpp_0.12.16                lattice_0.20-35            
##  [3] prettyunits_1.0.2           Rsamtools_1.32.0           
##  [5] assertthat_0.2.0            rprojroot_1.3-2            
##  [7] digest_0.6.15               R6_2.2.2                   
##  [9] GenomeInfoDb_1.16.0         plyr_1.8.4                 
## [11] backports_1.1.2             RSQLite_2.1.0              
## [13] evaluate_0.10.1             highr_0.6                  
## [15] httr_1.3.1                  zlibbioc_1.26.0            
## [17] progress_1.1.2              curl_3.2                   
## [19] blob_1.1.1                  Matrix_1.2-14              
## [21] rmarkdown_1.9               BiocParallel_1.14.0        
## [23] stringr_1.3.0               htmlwidgets_1.2            
## [25] pheatmap_1.0.8              RCurl_1.95-4.10            
## [27] bit_1.1-12                  munsell_0.4.3              
## [29] DelayedArray_0.6.0          compiler_3.5.0             
## [31] rtracklayer_1.40.0          xfun_0.1                   
## [33] seqLogo_1.46.0              htmltools_0.3.6            
## [35] SummarizedExperiment_1.10.0 GenomeInfoDbData_1.1.0     
## [37] bookdown_0.7                matrixStats_0.53.1         
## [39] GenomicAlignments_1.16.0    MASS_7.3-50                
## [41] bitops_1.0-6                gtable_0.2.0               
## [43] DBI_0.8                     magrittr_1.5               
## [45] scales_0.5.0                stringi_1.1.7              
## [47] rGADEM_2.28.0               RColorBrewer_1.1-2         
## [49] tools_3.5.0                 bit64_0.9-7                
## [51] BSgenome_1.48.0             Biobase_2.40.0             
## [53] yaml_2.1.18                 AnnotationDbi_1.42.0       
## [55] colorspace_1.3-2            GenomicRanges_1.32.0       
## [57] memoise_1.1.0               knitr_1.20

Bembom, Oliver. 2006. “SeqLogo: Sequence Logos for Dna Sequence Alignments.” R Package Version 1.5.4.

Colaert, Niklaas, Kenny Helsens, Lennart Martens, Joel Vandekerckhove, and Kris Gevaert. 2009. “Improved Visualization of Protein Consensus Sequences by iceLogo.” Nature Methods 6 (11):786–87.

Crooks, Gavin E., Gary Hon, John-Marc Chandonia, and Steven E. Brenner. 2004. “WebLogo: A Sequence Logo Generator.” Genome Research 14:1188–90.

Ou, Jianhong. 2012. “MotifStack: Plot Stacked Logos for Single or Multiple Dna, Rna and Amino Acid Sequence.” R Package Version 1.5.4.