PAC_sizedist: Generates size distribution plots from a PAC object

View source: R/PAC_sizedist.R

PAC_sizedistR Documentation

Generates size distribution plots from a PAC object

Description

PAC_sizedist plotting size distribution with bar charts, allowing for visualization of sequence classes and summaries.

Usage

PAC_sizedist(
  PAC,
  norm = "counts",
  range = NULL,
  anno_target,
  pheno_target = NULL,
  summary_target = NULL,
  colors = NULL,
  ymax = NULL
)

Arguments

PAC

PAC-list object containing an Anno data.frame with sequences as row names and a count table with raw counts.

norm

Character indicating what type of data to be used. If type="counts" the plots will be based on the raw Counts. If type="cpm" the analysis will be done on cpm values returned from PAC_norm function and stored in the norm folder of the PAC-list object. The name of any other table in the norm(PAC) folder can also be used.

range

Integer vector giving the range in sequence lengths (default=c(min, max)).

anno_target

List with: 1st object being character vector of target column(s) in Anno, 2nd object being a character vector of the target biotypes(s) in the target column (1st object). (default=NULL)

pheno_target

List with: 1st object being character vector of target column(s) in Pheno, 2nd object being a character vector of the target group(s) in the target column (1st object). (default=NULL)

summary_target

List with: 1st object being character target object in summary(PAC), 2nd object being a character vector of the target columns(s) in the target object (1st object). (default=NULL)

colors

Character vector with RGB color codes to be parsed to ggplot2.

ymax

Integer that sets the maximum y for all plots (all plots gets the same y-axes). If ymax=NULL, then ggplot2 will automatically set ymax for each plot individually (different y-axes).

Details

Given a PAC object the function will attempt to order sequences by their size (number of nucleotides) and visualize the contribution of specific classes of sequences (e.g. sRNA classes) at each size point.

Value

A list of objects: 1st object (Histograms::Samples): Individual histograms showing the nucleotide ratios per sample over the specified range. 2nd object (Data::Samples): Data used to generate the plots. 3rd object (Stacked_bars::Groups): Stacked bars showing the mean ratios of each nucleotide per group over the specified range. 4th object (Error_bars::Groups): Error bar plots with mean ratio of each nucleotide per group over the specified range.

See Also

https://github.com/Danis102 for updates on the current package.

Other PAC analysis: PAC_covplot(), PAC_deseq(), PAC_filter(), PAC_filtsep(), PAC_gtf(), PAC_jitter(), PAC_mapper(), PAC_nbias(), PAC_norm(), PAC_pca(), PAC_pie(), PAC_saturation(), PAC_stackbar(), PAC_summary(), PAC_trna(), as.PAC(), filtsep_bin(), map_rangetype(), tRNA_class()

Examples


##########################################
### Stacked bars in seqpac 
##----------------------------------------
load(system.file("extdata", "drosophila_sRNA_pac_filt_anno.Rdata", 
                  package = "seqpac", mustWork = TRUE))

PAC_filt <- PAC_norm(pac, norm="cpm")
PAC_filt <- PAC_summary(PAC=PAC_filt, norm = "cpm", 
                        type = "means", pheno_target=list("stage"))


ord <- c("no_anno", "other", "miRNA", "tRNA", "rRNA", "snoRNA",  "lncRNA")

sizedist_plots <- PAC_sizedist(PAC_filt, 
                               anno_target=list("Biotypes_mis0", ord), 
                               summary_target=list("cpmMeans_stage"))
cowplot::plot_grid(plotlist=sizedist_plots[[1]], nrow = 3, ncol = 1)

sizedist_plots <- PAC_sizedist(PAC_filt, norm="counts", 
                               anno_target=list("Biotypes_mis0", ord), 
                               pheno_target=list("batch", "Batch1"))
cowplot::plot_grid(plotlist=sizedist_plots[[1]], nrow = 3, ncol = 1)



Danis102/seqpac documentation built on Aug. 26, 2023, 10:15 a.m.