globalSeg               package:GeneR               R Documentation

_C_l_a_s_s _m_a_n_i_p_u_l_a_t_i_n_g _s_e_g_m_e_n_t_s

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

     We made a set of tools manipulation segments

_D_e_t_a_i_l_s:

     The aim of this class is to describe regions on chromosomes that
     are discontinuous segments on a line like:


                 1        10             25             40
     Region A:   ##########              #######
     Region B:   ####  ####              #############
     Region C:                                          ######  ####

     We made two kind of class

        *  'segSet': segments set, is a matrix nx2 composed of a column
           of "from", and a column of "to". Used to describe a region
           like 'A' or 'B' in our example. (A matrix 3x2 to describe
           region 'B').

        *  'globalSeg': a list of 'segSet'. It allows the notion of
           list of discontinuous segments (our use: a list of gene's
           models as a gene's model is stored as a list of its exons).
           In our sample, globalSeg will be the list of the 3 regions
           A,B and C. Note that it store more information than just a
           matrix with 2 columns containing all 'segments' of theses 3
           regions.    

     For a better comprehension of other man pages, we introduce this
     notation:

        *  a segment is just a part of a line determined by two values
           (from and to)

        *  an object of class segSet is a set of 'n' segments,
           determined by a matrix 'n'x2

        *  an  object of class globalSeg is a set of segSets,
           determined by a list of matrix.

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

     Epissage group at CGM.

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

     See also 'as.segSet', 'as.globalSeg', 'unionSeg'

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

     a = list(
         matrix( c( 1, 15, 17,  5, 45, 38),ncol=2),
         matrix( c( 100 , 120),ncol=2),
         matrix( c( 130, 135, 140, 145),ncol=2),
         matrix( c( 142 , 160),ncol=2))

     b = list(
         matrix( c(15, 28, 18, 45),ncol=2),
         matrix( c(1, 15, 25, 10, 20, 40),ncol=2),
         matrix( c(17, 35, 23, 38),ncol=2),
         matrix( c(100, 110, 105, 120),ncol=2))

     a = as.globalSeg(a)
     b = as.globalSeg(b)

     par(mar=c(1,0,1,0))

     par(mfrow=c(8,1))
     plot(a,xlim=c(1,160),main="A")
     plot(b,xlim=c(1,160),main="B")

     plot(and(b),xlim=c(1,160),main="and(B)")
     plot(or(b),xlim=c(1,160),main="or(B)")
     plot(Xor(b),xlim=c(1,160),main="Xor(B)")

     plot(a&b,xlim=c(1,160),main="A&B")
     plot(a|b,xlim=c(1,160),main="A|B")
     plot(Xor(a,b),xlim=c(1,160),main="Xor(A,B)")

