View Modes

knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

 protein_sequences <- system.file("extdata", "sample.fasta", package = "ggmsa")
 miRNA_sequences <- system.file("extdata", "seedSample.fa", package = "ggmsa")
 nt_sequences <- system.file("extdata", "LeaderRepeat_All.fa", package = "ggmsa")

library(ggmsa)
library(ggplot2)

ggmsa also uses functional views to make MSA features prominent. For instance, for specific properties that predominate regions, there are two methods to highlight them.

Consensus Views

Using consensus_views option to executes Consensus View. We provide four parameters——use_dot, disagreement, ignore_gaps and ref to adjust the Consensus View executes.

Example 1

When disagreement = TRUE and use_dot = TRUE, characters that agreememt to consensus have displayed as dot.

 ggmsa(protein_sequences, 300, 350, char_width = 0.5, seq_name = TRUE, consensus_views = TRUE, disagreement = TRUE, use_dot = TRUE)

Example 2

When disagreement = FALSE and use_dot = FALSE, characters that disagreement to consensus have faded their colors.

 ggmsa(protein_sequences, 300, 350, char_width = 0.5, seq_name = TRUE, consensus_views = TRUE, disagreement = FALSE, use_dot = FALSE)

Example 3

Specifying one of the input sequences as the reference sequence. The reference sequence will be placed at the top.

 ggmsa(protein_sequences, 300, 350, char_width = 0.5, seq_name = TRUE, consensus_views = TRUE ,use_dot = TRUE, ref = "PH4H_Rhizobium_loti")

By Conservation

The existing color scheme is modified so that the most conserved position in each column has the most intense colors and the least conserved are the palest. For example, conserved hydrophobic columns are shown with predominately red residues and conserved hydrophilic columns with blue in the Hydrophobicity color scheme.

ggmsa(protein_sequences, 300, 350, color = "Hydrophobicity", 
      font = NULL, seq_name = TRUE ,border = "white", by_conservation = TRUE)


Try the ggmsa package in your browser

Any scripts or data that you put into this service are public.

ggmsa documentation built on Aug. 3, 2021, 9:06 a.m.