plot_refseq_extremity_pq: Plot the nucleotide proportion at both extremity of the...

plot_refseq_extremity_pqR Documentation

Plot the nucleotide proportion at both extremity of the sequences

Description

lifecycle-experimental

It is a useful function to check for the absence of unwanted patterns caused for example by Illumina adaptator or bad removal of primers.

If hill_scale is not null, Hill diversity number are used to represent the distribution of the diversity (equitability) along the sequences.

Usage

plot_refseq_extremity_pq(
  physeq,
  first_n = 10,
  last_n = 10,
  hill_scales = c(1, 2),
  min_width = 0
)

Arguments

physeq

(required): a phyloseq-class object obtained using the phyloseq package.

first_n

(int, default 10) The number of nucleotides to plot the 5' extremity.

last_n

(int, default 10) The number of nucleotides to plot the 3' extremity.

hill_scales

(vector) A vector defining the Hill number wanted. Set to NULL if you don't want to plot Hill diversity metrics.

min_width

(int, default 0) Select only the sequences from physeq@refseq with using a minimum length threshold. If first_n is superior to the minimum length of the references sequences, you must use min_width to filter out the narrower sequences

Value

A list of 4 objects

  • p_start and p_last are the ggplot object representing respectively the start and the end of the sequences.

  • df_start and df_last are the data.frame corresponding to the ggplot object.

Author(s)

Adrien Taudière

Examples

res1 <- plot_refseq_extremity_pq(data_fungi)
names(res1)
res1$plot_start
res1$plot_last

res2 <- plot_refseq_extremity_pq(data_fungi, first_n = 200, last_n = 100)
res2$plot_start
res2$plot_last

plot_refseq_extremity_pq(data_fungi,
  first_n = 400,
  min_width = 400,
  hill_scales = NULL
)$plot_start +
  geom_line(aes(y = value, x = seq_id, color = name), alpha = 0.4, linewidth = 0.2)

plot_refseq_extremity_pq(data_fungi,
  first_n = NULL,
  last_n = 400,
  min_width = 400,
  hill_scales = c(3)
)$plot_last

adrientaudiere/MiscMetabar documentation built on Dec. 19, 2024, 3:16 a.m.