effectplot                package:qtl                R Documentation

_P_l_o_t _p_h_e_n_o_t_y_p_e _m_e_a_n_s _a_g_a_i_n_s_t _g_e_n_o_t_y_p_e_s _a_t _o_n_e _o_r _t_w_o _m_a_r_k_e_r_s.

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

     Plot the phenotype means for each group defined by the genotypes
     at  one or two markers (or the values at a discrete covariate).

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

     effectplot(cross, pheno.col=1, mname1, mark1, geno1, mname2, mark2,
                geno2, main, ylim, add.legend=TRUE, draw=TRUE,
                var.flag=c("pooled","group"))

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

   cross: An object of class 'cross'.

pheno.col: Column number in the phenotype matrix which to be drawn in
          the plot.

  mname1: Name for the first marker.

   mark1: Genotype data for the first marker.  If unspecified,
          genotypes will be taken from the data in the input cross
          object, using the name specified in 'mname1'.

   geno1: Names for the genotypes (or classes in a covariate).

  mname2: Name for the second marker (optional).

   mark2: Like 'mark1' (optional).

   geno2: Names for the genotypes (or classes in a covariate).

    main: Optional figure title.

    ylim: Y-axis limits.

add.legend: A logical value to indicate add legend or not.

    draw: A logical value to indicate generate the plot or not. If
          FALSE, no figure will be plot and this function can be used
          to calculate the group means and standard errors.

var.flag: The method to calculate the group variance. "pooled" means to
          use the pooled variance and "group" means to calculate from
          individual group.

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

     In the plot, the Y-axis is the phenotype. X-axis is the genotype
     for the first marker.  In the case of one marker, there will be
     one line in the figure. In the case of two markers, the x-axis is
     for different genotypes of the second marker, and the first marker
     is represented by lines in different colors.  Error bars are
     plotted at +/- 1 SE.

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

     A data.frame containing the phenotype means and standard
     deviations for each group.

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

     Hao Wu, hao@jax.org; Karl W Broman, kbroman@jhsph.edu

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

     'plot.pxg', 'find.marker', 'effectscan'

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

     data(fake.f2)


     # impute gneotype data
     ## Not run: 
     fake.f2.impute <- sim.geno(fake.f2, step=5, n.draws=64)
     ## End(Not run)

     ########################################
     # one marker plots
     ########################################
     ### plot of genotype-specific phenotype means for 1 marker
     mname <- find.marker(fake.f2, 1, 37) # marker D1M437
     effectplot(fake.f2, pheno.col=1, mname1=mname)

     ### plot a pseudomarker
     effectplot(fake.f2.impute, pheno.col=1, mname1=mname)

     ### plot a phenotype
     # Plot of sex-specific phenotype means,
     # note that "sex" must be a phenotype name here
     effectplot(fake.f2, mname1="sex", geno1=c("F","M"))
     # alternatively I can do it this way
     sex <- fake.f2$pheno[,2]
     effectplot(fake.f2, mname1="Sex", mark1=sex, geno1=c("F","M"))

     ########################################
     # two markers plots
     ########################################

     ### plot two markers
     # plot of genotype-specific phenotype means for 2 markers
     mname1 <- find.marker(fake.f2, 1, 37) # marker D1M437
     mname2 <- find.marker(fake.f2, 13, 24) # marker D13M254
     effectplot(fake.f2, mname1=mname1, mname2=mname2)

     ### plot two pseudomarkers
     pmname1 <- "c1.loc35"
     pmname2 <- "c13.loc25"
     effectplot(fake.f2.impute, mname1=pmname1, mname2=pmname2)

     ### plot one marker and one imputed pseudomarker
     mark1 <- fake.f2.impute$geno[[1]]$draws[,11,]
     effectplot(fake.f2, mname1="D1M437", mark1=mark1, mname2="D13M254")

     ### Plot of sex- and genotype-specific phenotype means 
     mname <- find.marker(fake.f2, 13, 24) # marker D13M254
     # sex and a marker
     effectplot(fake.f2, mname1=mname, mname2="Sex",
                mark2=fake.f2$pheno$sex, geno2=c("F","M"))
     # sex and a pseudomarker
     effectplot(fake.f2.impute, mname1=mname, mname2="Sex",
                mark2=fake.f2$pheno$sex, geno2=c("F","M"))

     # Same as above, switch role of sex and the marker
     # sex and marker
     effectplot(fake.f2, mname1="Sex", mark1=fake.f2$pheno$sex,
                geno1=c("F","M"), mname2=mname)
     # sex and pseudomarker
     effectplot(fake.f2.impute, mname1="Sex", mark1=fake.f2$pheno$sex,
                geno1=c("F","M"), mname2=mname)

     # X chromosome marker
     mname <- find.marker(fake.f2, "X", 14) # marker DXM66
     effectplot(fake.f2, mname1=mname)

     # Two markers, including one on the X
     mname1 <- find.marker(fake.f2, 13, 24) # marker D13M254
     mname2 <- find.marker(fake.f2, "X", 14) # marker DXM66
     effectplot(fake.f2, mname1=mname1, mname2=mname2)

