PAC_nbias: Generates a nucleotide bias analysis from a PAC object

View source: R/PAC_nbias.R

PAC_nbiasR Documentation

Generates a nucleotide bias analysis from a PAC object

Description

PAC_nbias analyses nucleotide bias.

Usage

PAC_nbias(
  PAC,
  position = 1,
  norm = NULL,
  range = NULL,
  anno_target = NULL,
  pheno_target = NULL,
  summary_target = NULL,
  colors = NULL,
  ymax = NULL,
  data_only = FALSE
)

Arguments

PAC

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

position

Integer indicating the nucleotide position from 3' to 5' position (default=1).

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 indicating the sequence size range (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 vector of target object in summary(PAC), 2nd object being a character vector of the target column(s) in the target summary 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).

data_only

logical. If data_only=TRUE a data.frame a simple Anno object is returned with a Size and a Nucleotide bias column. As default, data_only=FALSE then graphs are returned in addition to data.

Details

Given a PAC object the function will attempt to extract the ratios of specific nucleotides at a given position in sequences in the Anno data.frame in relation to the sequence counts in Counts.

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.

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_norm(), PAC_pca(), PAC_pie(), PAC_saturation(), PAC_sizedist(), PAC_stackbar(), PAC_summary(), PAC_trna(), as.PAC(), filtsep_bin(), map_rangetype(), tRNA_class()

Examples



# Load a PAC-object 
load(system.file("extdata", "drosophila_sRNA_pac_filt_anno.Rdata", 
                  package = "seqpac", mustWork = TRUE))
output_nbias <- PAC_nbias(pac)
cowplot::plot_grid(plotlist=output_nbias$Histograms)

# Only miRNA (Oops, heavy T-bias on 1st nt; are they piRNA?)  
table(anno(pac)$Biotypes_mis0)
output_nbias <- PAC_nbias(pac, anno_target = list("Biotypes_mis0", "miRNA") )
cowplot::plot_grid(plotlist=output_nbias$Histograms)

# Switch to 10:th nt bias 
output_nbias <- PAC_nbias(pac, position=10, 
                          anno_target = list("Biotypes_mis0", "miRNA"))
cowplot::plot_grid(plotlist=output_nbias$Histograms)

# Summarized over group cpm means
pac_test <- PAC_summary(pac, norm = "cpm", type = "means", 
                        pheno_target=list("stage"), merge_pac=TRUE)
output_nbias <- PAC_nbias(pac_test, summary_target = list("cpmMeans_stage") )
cowplot::plot_grid(plotlist=output_nbias$Histograms)



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