Sequence difference plot

Here we use the data published in Potato Research1 as an example.

## [1] "/private/tmp/Rtmpm6mj1n/Rinst9981636ae515/seqcombo/examples/GVariation/A.Mont.fas"  
## [2] "/private/tmp/Rtmpm6mj1n/Rinst9981636ae515/seqcombo/examples/GVariation/B.Oz.fas"    
## [3] "/private/tmp/Rtmpm6mj1n/Rinst9981636ae515/seqcombo/examples/GVariation/C.Wilga5.fas"

The input fasta file should contains two aligned sequences. User need to specify which sequence (1 or 2, 1 by default) as reference. The seqdiff function will parse the fasta file and calculate the nucleotide differences by comparing the non-reference one to reference.

## sequence differences of Mont and CF_YL21 
## 1181 sites differ:
##   A   C   G   T 
## 286 315 301 279

We can visualize the differences by plot method:

We can parse several files and visualize them simultaneously.

Sequence similarity plot

Session info

Here is the output of sessionInfo() on the system on which this document was compiled:

## R version 3.5.0 (2018-04-23)
## Platform: x86_64-apple-darwin15.6.0 (64-bit)
## Running under: OS X El Capitan 10.11.6
## 
## Matrix products: default
## BLAS: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRblas.0.dylib
## LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib
## 
## locale:
## [1] C/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
## 
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     
## 
## other attached packages:
## [1] igraph_1.2.1    ggplot2_2.2.1   emojifont_0.5.1 tibble_1.4.2   
## [5] seqcombo_1.2.0 
## 
## loaded via a namespace (and not attached):
##  [1] Rcpp_0.12.16        compiler_3.5.0      pillar_1.2.2       
##  [4] plyr_1.8.4          XVector_0.20.0      bindr_0.1.1        
##  [7] sysfonts_0.7.2      prettydoc_0.2.1     tools_3.5.0        
## [10] zlibbioc_1.26.0     digest_0.6.15       evaluate_0.10.1    
## [13] gtable_0.2.0        pkgconfig_2.0.1     rlang_0.2.0        
## [16] rvcheck_0.0.9       yaml_2.1.18         parallel_3.5.0     
## [19] proto_1.0.0         bindrcpp_0.2.2      showtextdb_2.0     
## [22] stringr_1.3.0       dplyr_0.7.4         knitr_1.20         
## [25] Biostrings_2.48.0   S4Vectors_0.18.0    IRanges_2.14.0     
## [28] stats4_3.5.0        rprojroot_1.3-2     grid_3.5.0         
## [31] cowplot_0.9.2       glue_1.2.0          R6_2.2.2           
## [34] rmarkdown_1.9       magrittr_1.5        backports_1.1.2    
## [37] scales_0.5.0        htmltools_0.3.6     BiocGenerics_0.26.0
## [40] showtext_0.5-1      assertthat_0.2.0    colorspace_1.3-2   
## [43] labeling_0.3        stringi_1.1.7       lazyeval_0.2.1     
## [46] munsell_0.4.3

References

1. Chang, F. et al. Complete Genome Analysis of a PVYN-Wi Recombinant Isolate from Solanum tuberosum in China. Potato Research 58, 377–389 (2015).