\name{densityProfile} \alias{densityProfile} \alias{plot.profile} \title{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,...) } %- maybe also 'usage' for other objects documented here. \arguments{ \item{ori}{Integer/vector, Absolute address of the origins in each fragment} \item{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)} \item{seqno}{Integer/scalar, Strand (forward: 0, reverse: 1)} \item{fun}{Function, function to be used (by example seqSkew} \item{fileout}{String/scalar, if not NULL, a file name to write results} \item{nbinL}{Integer/scalar, number of bins to create before the origin} \item{nbinR}{Integer/scalar, number of bins to create after the origin} \item{sizeBin}{Integer/scalar, size of the bins} \item{threshold}{Integer/scalar, For each bin, maximum number of N tolerated in the sequence to participate to the computation} \item{strand}{strand} \item{accu}{Flag, if true, returns sum , sum of square, and count on demanding function; else returns, mean and standard error on mean.} \item{case}{String/scalar, Case of the letters taken into account ("all", "upper", "lower")} \item{x}{An element of class profile} \item{ylim}{Range of y axis limits} \item{...}{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{Emna Marrakchi and Antoine Lucas} \seealso{\code{\link{bankDensityProfile}},\code{\link{GCcontent}},\code{\link{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 } \keyword{utilities}