This function generates a joyplot of the blast_nucleotide_to_genomes output.

gg_blast_hits(
  blast_tbl,
  type = "scope",
  scope_cutoff = 0,
  alpha = 0.7,
  scale = 4,
  xlab = "Query",
  ylab = "Density over Number of BLAST Hits",
  title = "Total number of BLAST hits: ",
  xticks = 5,
  levels = NULL,
  trim = TRUE
)

Arguments

blast_tbl

a BLAST table generated with blast_nucleotide_to_genomes.

type

the type of BLAST hit visualization. Options are:

  • type = "scope"

  • type = "alig_length"

  • type = "evalue"

  • type = "bit_score"

  • type = "qcovhsp"

  • type = "qcov"

  • type = "perc_identity"

scope_cutoff

The scope is defined as 1 - (abs(q_len - alig_length) / q_len)). The scope_cutoff defines the minimum scope that is required to retain a BLAST hit. Default is scope_cutoff = 0.1 (meaning that each BLAST hit must have at least 0.1 scope).

alpha

a value passed to aes specifying the transparency of distributions.

scale

the ridges scale passed to geom_density_ridges.

xlab

x-axis label.

ylab

y-axis label.

title

figure title which will be concatenated with the number of BLAST hits available in the inpit blast_tbl.

xticks

number of ticks on the x-axis. Default is xticks = 5.

levels

a character vector specifying the exact order of species names (levels) that is used to factor and sort species in the geom_density_ridges plot.

trim

a logical value indicating whether ridges densities shall be trimmed. Default is trim = TRUE.

Note

In some cases it may happen that for certain species no line is drawn although there are a few hits present in the dataset. This happens when the hits are too few and their values too close to eachother to be able to estimate density functions. It is important to remember that density functions are estimated which usually requires a sufficient amount data to be useful and accurate. However, when density estimation is not possible this plot will omit drawing a line since this visualization approach is intended to be an analytics tool.

Author

Hajk-Georg Drost