Last data update: 2014.03.03

R: AmpliconDuo List Amplicon Filter
filter.ampliconduo.setR Documentation

AmpliconDuo List Amplicon Filter

Description

Marks or removes amplicons from each ampliconduo data frame in a list according to the specified filter criteria.

Usage

filter.ampliconduo.set(x, min.freq = 1, OR = NULL, q = NULL, p = NULL, remove = FALSE)

Arguments

x

List of ampliconduo data frames, return value of an ampliconduo call.

min.freq

Optional. Integer, minimium frequency/read count for a given amplicon in each of the two amplicon sets of an ampliconduo to be retained. Default value is 1.

OR

Optional. Numeric, minimum odds ratio for an amplicon to be retained. If no value is specified the odds ratio is excluded from the filter criteria.

q

Optional. Numeric, minimum value for q, the adjusted p-value foran amplicon to pass the filter. If no value is specified, q is excluded from the filter criteria.

p

Optional. Numeric, minimum p-value for an amplicon to pass the filter. If no value for p is specified p is excluded from the filter criteria.

remove

Optional. Logical, decides whether amplicons that fail the filter criteria should be removed (TRUE), or retained (FALSE).

Details

For every ampliconduo data frame in argument x, applies each filter criterion that was specified to each amplicon. If an amplicon i fails any of the applied criteria, the logical value in column rejected in row i is set to TRUE. In case the parameter remove was set to TRUE, all amplicons with rejected = TRUE are removed. The position information in respect to the data used as input for the ampliconduo call are kept. This method uses the function filter.ampliconduo.

Value

List of ampliconduo data frames. Same as input parameter x but with the adjustments in the rejected column according to the specified filter criteria, or removed rows (removed = TRUE)

Author(s)

Anja Lange & Daniel Hoffmann

See Also

filter.ampliconduo, performs filtering on single ampliconduo data.frames, is called by this method.

ampliconduo, generates the input data x for this method.

accepted.amplicons, returns the indices of amplicons that have passed the filter criteria.

Examples

## load example data
data(amplicons)

## apply filter criteria
ampliconduos.f <- filter.ampliconduo.set(amplicons)
ampliconduos.f <- filter.ampliconduo.set(amplicons, min.freq = 3, remove = TRUE)

## to return a list with the indices (corresponding to the indices of the data 
## the ampliconduo function was called on) of all amplicons that passed the filter criteria 
good.reads <- accepted.amplicons(ampliconduos.f)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(AmpliconDuo)
Loading required package: ggplot2
Loading required package: xtable
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/AmpliconDuo/filter.ampliconduo.set.Rd_%03d_medium.png", width=480, height=480)
> ### Name: filter.ampliconduo.set
> ### Title: AmpliconDuo List Amplicon Filter
> ### Aliases: filter.ampliconduo.set
> ### Keywords: manip
> 
> ### ** Examples
> 
> ## load example data
> data(amplicons)
> 
> ## apply filter criteria
> ampliconduos.f <- filter.ampliconduo.set(amplicons)
> ampliconduos.f <- filter.ampliconduo.set(amplicons, min.freq = 3, remove = TRUE)
> 
> ## to return a list with the indices (corresponding to the indices of the data 
> ## the ampliconduo function was called on) of all amplicons that passed the filter criteria 
> good.reads <- accepted.amplicons(ampliconduos.f)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>