RiboDiPA: A wrapper function for the RiboDiPA pipeline

View source: R/package.R

RiboDiPAR Documentation

A wrapper function for the RiboDiPA pipeline

Description

A wrapper function for the RiboDiPA pipeline, that will call PsiteMapping, DataBinning, and DPTest in order. This function is provided for users' convenience and requires BAM files (one per biological replicate), a GTF file, and a classlabel object describing what comparisons to make. The minimal output from the function is a list of genes with signficant differential patterns.

Usage

RiboDiPA(bam_file_list, gtf_file, classlabel, psite.mapping = "auto",
    exon.binning = FALSE, bin.width = 0,zero.omit = FALSE, 
    bin.from.5UTR = TRUE, method = c("gtxr", "qvalue"), cores = NULL)

Arguments

bam_file_list

A vector of bam file names to be tested. Users should include path names if not located in the current working directory. Index files (.bai) will be generated if not already present.

gtf_file

Annotation file used to generate the BAM alignments. Note that a GTF file sourced from one organization (e.g. Ensembl) cannot be used with BAM files aligned with a GTF file sourced from another organization (e.g. UCSC).

classlabel

For matrix input: a DataFrame or data.frame with at least one column named comparison. In comparison, 1 stands for the reference condition, 2 stands for the treatment condtion, and 0 represents replicates not invloved in the test. Rows of classlabel correspond to the data, which is one row per BAM file.

psite.mapping

Rules for P-site offsets, to map a given read length of RPF to a P-site. See psiteMapping for details.

exon.binning

Logical indicator. If exon.binning is TRUE, use the exon boundaries indicated in the GTF file as bins for testing, otherwise, adaptive or fixed binning will be performed.

bin.width

Binning width per bin. 0 represents adaptive binning, which is the default method. The minimal value for fixed-width binning is 1, which represent single-codon binning. See dataBinning for details.

zero.omit

If this parameter is TRUE, bins with zero reads across all replicates for a given gene are removed.

bin.from.5UTR

When the coding region length is not any integer multiple of binning width, and if value of bin.from.5UTR is TRUE, the uneven width bins will be arranged at the 3' end of the total transcript.

method

2-component character vector specifies the multiplicity correction method for codon/bin-level p-value adjustment. The default See diffPatternTest for details.

cores

The number of cores to use for parallel execution. If not specified, the number of cores is set to the value of detectCores(logical = FALSE).

Value

bin

A List object of codon/bin-level results. Each element of list is of a gene, containing codon/bin results columns: pvalue, log2FoldChange, and the adjusted p-value named by the first string in method.

gene

A DataFrame object of gene-level results. It contains columns: tvalue, pvalue, and the adjusted p-value named by the second string in method.

small

Names of genes without sufficient reads

classlabel

The same as input classlabel.

data

Tracks of binned data of all genes reported in bin and gene.

method

The same as input method.

coverage

A list object of matrices. Each element is a matrix representing the P-site footprints of a gene. Rows corrspond to replicates and columns corrspond to nucleotide location with reference to the total transcript.

counts

A matrix object of read counts. Rows corrspond to genes and columns corrspond to replicates.

exons

A List object of matrices. Each element contains the relative start and end positions of exons in the gene with reference to the total transcript

psite.mapping

The P-site mapping rule or A-site mapping rule used.

See Also

psiteMapping, dataBinning, diffPatternTest, diffPatternTestExon

Examples


library(BiocFileCache)
file_names <- c("WT1.bam", "WT2.bam", "MUT1.bam", "MUT2.bam", "eg.gtf")
url <- "https://github.com/jipingw/RiboDiPA-data/raw/master/"
bfc <- BiocFileCache()
bam_path <- bfcrpath(bfc,paste0(url,file_names))

classlabel <- data.frame(
    condition = c("mutant", "mutant", "wildtype", "wildtype"),
    comparison = c(2, 2, 1, 1)
)
rownames(classlabel) <- c("mutant1","mutant2","wildtype1","wildtype2") 
result.pip <- RiboDiPA(bam_path[1:4], bam_path[5], classlabel, cores=2)


jipingw/RiboDiPA documentation built on June 25, 2022, 4:47 p.m.