filter.fsa: Applies filter() to a "fsa" object

View source: R/filter.fsa.R

filter.fsaR Documentation

Applies filter() to a "fsa" object

Description

Replaces the requested column of values by the output of filter, possibly after masking values out of a specified index or bp range.

Usage

  filter.fsa(x, channel, ..., from = NA, to = NA, units = "bp")

Arguments

x

An object of class fsa, as returned by read.fsa

channel

Single character value, the name of the channel used for size markers.

...

Further arguments to be passed to filter.

from

Single numeric value, the starting offset (integer index or numeric bp) to consider. No subsetting will be applied if NA.

to

Single numeric value, the last offset (integer index or numeric bp) to consider. No subsetting will be applied if NA.

units

Either "index" or "bp", defining the unit of from and to. Notice x must have been processed by align.fsa to use "bp".

Value

Returns x, with updated content.

Author(s)

Sylvain Mareschal

See Also

read.fsa

Examples

  # Example FSA file provided
  fsa <- read.fsa(system.file("extdata/fsa_GEP/A5918.fsa", package="FSAtools"))
  fsa <- align.fsa(fsa)
  
  # Profile before filtering
  plot(fsa)
  
  # Plot subset of the profile (base pairs)
  fsa <- filter.fsa(fsa, channel="ROX", filter=20, from=40, to=140, units="bp")
  
  # Profile after filtering
  plot(fsa)

FSAtools documentation built on Aug. 19, 2023, 1:06 a.m.