densityProfile {GeneR}R Documentation

Density profiles

Description

Computes profile(s) of user defined quantities around sites of interest in sequence fragments. Profile(s) is(are) constituted of bins of equal size around the sites of interest named origins. It produces for each bin, and for each quantity the mean, the standard deviation and the number of valid events.

Usage

densityProfile(ori, from, to, seqno = 0, fun = seqSkew,
               fileout = NULL, nbinL, nbinR, sizeBin,
               threshold=0,strand=getStrand(),accu=FALSE,case="all")
plot.profile (x,ylim=NULL,...)

Arguments

ori Integer/vector, Absolute address of the origins in each fragment
from, to Integer/vector, Absolute addresses of the beginning and the end of each fragment, (1 means the first nucleotide and 0 conventionally the last one; from must not be larger than to and both vectors must be the same size)
seqno Integer/scalar, Strand (forward: 0, reverse: 1)
fun Function, function to be used (by example seqSkew
fileout String/scalar, if not NULL, a file name to write results
nbinL Integer/scalar, number of bins to create before the origin
nbinR Integer/scalar, number of bins to create after the origin
sizeBin Integer/scalar, size of the bins
threshold Integer/scalar, For each bin, maximum number of N tolerated in the sequence to participate to the computation
strand strand
accu Flag, if true, returns sum , sum of square, and count on demanding function; else returns, mean and standard error on mean.
case String/scalar, Case of the letters taken into account ("all", "upper", "lower")
x An element of class profile
ylim Range of y axis limits
... Graphical parameters can be given as arguments to 'plot'.

Value

a list of matrices, with the mean(s), the standard deviation(s) and the number of valid sub-fragments in each bin.

Author(s)

Emna Marrakchi and Antoine Lucas

See Also

bankDensityProfile,GCcontent,seqSkew

Examples


  s <- ""
  for(i in 1:10)
     s <- paste(s, randomSeq(n=100),randomSeq(prob=c(0.3,1,1,1,0)/3.3,n=100),sep="")
 
  placeString(s,seqno=0)

  dens <- densityProfile(ori=200*(1:10)-100,from=200*(0:9)+1,to=200*(1:10),
              seqno=0, fun=seqSkew,nbinL=10,nbinR=10,sizeBin=10)

  plot(dens$skta,main="TA skew")

  ## Example with flagged 'N'

  ## We create a sequence with a biais every 100 nucleotides
  s <- ""
  for(i in 1:10)
     s <- paste(s, randomSeq(n=100),randomSeq(prob=c(0.3,1,1,1,0.2)/3.5,n=100),sep="")
 
  placeString(s,seqno=1)

  dens2 <- densityProfile(ori=200*(1:10)-100,from=200*(0:9)+1,to=200*(1:10),
              seqno=1, fun=compoSeq,nbinL=10,nbinR=10,sizeBin=10)

  plot(dens2$T,main="#T")

  ## The same but more permissive (allow 4 N in each bin)

  dens3 <- densityProfile(ori=200*(1:10)-100,from=200*(0:9)+1,to=200*(1:10),
              seqno=1, fun=compoSeq,nbinL=10,nbinR=10,sizeBin=10,threshold=4)

  plot(dens3$T,main="#T")

  ## Show numbers
  dens

  dens2

  dens3

[Package GeneR version 2.2.1 Index]