densityProfile             package:GeneR             R Documentation

_D_e_n_s_i_t_y _p_r_o_f_i_l_e_s

_D_e_s_c_r_i_p_t_i_o_n:

     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.

_U_s_a_g_e:

     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,...)

_A_r_g_u_m_e_n_t_s:

     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'.

_V_a_l_u_e:

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

_A_u_t_h_o_r(_s):

     Emna Marrakchi and Antoine Lucas

_S_e_e _A_l_s_o:

     'bankDensityProfile','GCcontent','seqSkew'

_E_x_a_m_p_l_e_s:

       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

