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")

