cScale              package:geneplotter              R Documentation

_A _f_u_n_c_t_i_o_n _f_o_r _m_a_p_p_i_n_g _c_h_r_o_m_o_s_o_m_e _l_e_n_g_t_h _t_o _a _n_u_m_b_e_r _o_f _p_o_i_n_t_s.

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

     Given a number of points (generally representing the number of
     points on a plot's axis), and a vector of chromosome lengths -
     will generate a vector of the same length as the one passed in
     containing scaling factors for each chromosome.

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

     cScale(points, cLengths, method=c("max", "relative"), chrom)

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

  points: The number of points to scale the chromosome length to.

cLengths: A vector of chromosome lengths. 

  method: Determines whether to use relative or absolute scaling.
          Default is "max" (absolute).

   chrom: Which chrom to determine the scale for

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

     The scale factor is calculated in a manner based on the 'method'
     argument.  If method is 'max', the factor is derived by dividing
     the points argument by each chromosome's length (in base pairs). 
     If the method chosen is 'relative', then the scale is determined
     by dividing the points argument by the maximum chromsome length,
     and applying that value to each chromosome.

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

     Jeff Gentry

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

     'cPlot'

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

        ## A bit of a hack to not have a package dependency on hgu95av2
        ## but need to fiddle w/ the warn level to not fail the example anyways.
        curWarn <- options(warn=0)
        on.exit(options(warn=curWarn), add=TRUE)
        if (require(hgu95av2)) {
           z <- buildChromLocation("hgu95av2")

          for (sc in c("max","relative"))
            scale <- cScale(1000, chromLengths(z),sc,"Y")
        } else print("This example needs the hgu95av2 data package")

