2008-06-09

Using Sweave with LyX customisation script

Gabor suggested I should write a short batch file or R script which would copy the various files needed to use Sweave in LyX so that one does not need to actually do it onself. That would be nice, but there are several things that I should take care of:
  • I would need to find the LyX user/library directory. I do not know how to get his information in scriptable manner.
  • If the preference file already exists, I would have to append new content. That is easy, but in case some definitions are already used I would first need to parse the old version of prefences. That would not be so easy.
  • I would need to write a Unix shell script for Unix like systems and a batch file for MS Windows. I am not sure about Mac OS-X - I think Unix shell script should work there out of the box.
I think I will leave this step to someone else. I actually hope, that LyX developers might find a way to provide automatic customisation if R is installed on the computer. Some ideas were given here. Additionally, Gabors' {Sweave,Stangle}.bat could be used instead of {Sweave,Stangle}.sh that are shipped with R.

2008-06-08

Using Sweave with LyX on MS Windows

Ian Holliday has informed me that my solution for using Sweave with LyX has additional requirement that I have not stated. Beside LyX & R (obviously) one needs also a variant of Unix shell. I have not realized this before since I usually use Linux, which always has installed a variant of Unix shell. Additionally, I always install a set of Unix tools (via Cygwin or MSYS) on my MS Windows boxes. Therefore, I could not realize that Unix shell is needed. However, I could have figured this requirement since R CMD Sweave and R CMD Stangle (commands that drive the weaving and the tangling process - this two commands are also inserted in LyXs' preferences file) use shell scripts Sweave.sh and Stangle.sh. I have provided additional info about this issue in INSTALL file. New version of the Rnews paper will appear soon.

2008-06-07

Slides and videos from The 3rd International Conference of Quantitative Genetics

The 3rd International Conference of Quantitative Genetics was held at Zhejiang University, Hangzhou, China August 19 -24, 2007. The webpage of the conference is available at:

http://ibi.zju.edu.cn/icqg/

Now, slides and videos are available for download. Great!

2008-05-24

Quantitative genetics in maize


Crow wrote a paper "90 Years Ago: The Beginning of Hybrid Maize" in 1998. It is a nice overview of development of hybrid lines of maize - the theory as well as practice (using genetics and agricultural techniques).

On related topic, Edwards and Lamkey analysed effect of inbreeding from quantitative genetics perspective i.e. they estimated all components of variance due to dominant effect of alleles in noninbred and inbred individuals.

2008-05-15

Towards a new paradigm in quantitative genetics

Peresentation by Daniel Gianola "Alice in Wonderland: towards a new paradigm in quantitative genetics" is available at

http://www.dcam.upv.es/ACTEON/docs/Gianola%20VALENCIA%202008.ppt

Partitioning of additive genetic variance between relatives

I am deriving covariance between haplodiploids to correct some misunderstandings in the literature (e.g. Liu & Smith, 2000) and to extend their work and work of others (eg. Grossman & Eisen, 1989; ...) for general estimation of genetic parameters and breeding values in haplodiploids.

Grossman & Eisen (1989, page 140) derive genetic covariance for sex-linked genes between two females i.e. between two diploids. This result should be the same as genetic covariance for autosomal genes between two diploid individuals, since females have two sex chromosomes i.e. the result should be $$ \inline Cov\left(g_{jk},g_{j'k'}\right)=a_{12}\sigma^2_a + d_{12}\sigma^2_d $$, where $$ \inline Cov\left(g_{jk},g_{j'k'}\right) $$ is genetic covariance between genetic values of individual 1 with genotype jk and individual 2 with genotype j'k', $$ \inline a_{12} $$ is the additive relationship coeffcient (see bellow), $$ \inline \sigma^2_a $$ is additive genetic variance, $$ \inline d_{12} $$ is the dominance relationship coeffcient (see bellow), and $$ \inline \sigma^2_d $$ is dominance variance. They show the following equation:

$$
Cov\left(g_{jk},g_{j'k'}\right)=\\
Cov(\alpha_j+\alpha_k+\delta_{jk},\\
\alpha_{j'}+\alpha_{k'}+\delta_{j'k'})\\
= Cov\left(\alpha_j, \alpha_{j'}\right) + \\
Cov\left(\alpha_j, \alpha_{k'}\right) + \\
Cov\left(\alpha_k, \alpha_{j'}\right) + \\
Cov\left(\alpha_k, \alpha_{k'}\right) + \\
Cov\left(\delta_{jk}, \delta_{j'k'}\right)\\
= \Pr\left(j \equiv j' \right)E\left(\alpha^2_j\right) + \\
\Pr\left(j \equiv k' \right)E\left(\alpha^2_j\right) + \\
\Pr\left(k \equiv j' \right)E\left(\alpha^2_j\right) + \\
\Pr\left(k \equiv k' \right)E\left(\alpha^2_j\right) + \\
\Pr\left(jk \equiv j'k'\right)E\left(\delta^2_{jk}\right)\\
= 4 r_{12}\left(\frac{1}{2}\sigma^2_a\right) + d_{12}\sigma^2_d\\
= 2 r_{12}\left(\sigma^2_a\right) + d_{12}\sigma^2_d\\
= a_{12}\left(\sigma^2_a\right) + d_{12}\sigma^2_d,
$$

where $$ \inline \equiv$$ means alleles identical by descent, $$ \inline \alpha_j $$ and $$ \inline \alpha_k $$ are additive genetic values of individual with genotype jk and $$ \inline \delta_{jk} $$ is dominance deviation.



This is not clear to me, since individual can have only one breeding (additive genetic) value, which is a sum of average effect of alleles. Are then $$ \inline \alpha_j $$ and $$ \inline \alpha_k $$ average effects of alleles? Note that they assumed that $$ \inline E\left(\alpha^2_j\right) = \frac{1}{2}\sigma^2_a $$. I think that this indicates that $$ \inline \alpha_j $$ and $$ \inline \alpha_k $$ are half the breeding values from parents of individual 1, which in turn is the average effect i.e. breeding value is a sum of average effects.



Followup: yes, the $$ \inline \alpha_j $$ and $$ \inline \alpha_k $$ are average effects of alleles! Lange (as well as others) have shown the derivation of genetic covariance in his book (Mathematical and statistical methods for genetic analysis, 2nd edition 2003, page 101).


additive relationship coeffcient = twice the coefficient of coancestry also called kinship or parentage (the probability that a random allele at a particular locus in individual 1 is identical by descent to a random allele at the same locus in individual 2)

dominance relationship coeffcient = the coefficient of fraternity (the probability that both alleles at a particular locus in individual 1 are identical by descent to alleles at the same locus in individual 2)

Liu, F.-H., Smith, S. M. (2000). Estimating quantitative genetic parameters in haplodiploid organisms. Heredity, 85(4):373-382. http://dx.doi.org/10.1046/j.1365-2540.2000.00764.x

Grossman, M., Eisen, E. J. (1989). Inbreeding, coancestry, and covariance between relatives for X-chromosomal loci. J. Hered., 89(2):137-142. http://jhered.oxfordjournals.org/cgi/content/abstract/80/2/137

2008-05-10

Genotypic values under genomic imprinting model

I came across paper by Spencer where he develops the quantitative genetic theory for a single loci with two alleles (A1 and A2) with genomic imprinting. Genomic imprinting is also known as parent-of-origin effect. If there is no imprinting, there are three possible genotypes A1/A1, A1/A2, and A2/A2 and therefore three different genotypic values. However, when imprinting is in place, the mean of genotypes depends on alleles and origin of alleles e.g. maternal imprinting means that alleles inherited from a father are more expressed. Spencer, as well as many others (see bellow), assumed that genomic imprinting changes the mean of heterozygotes. Additionally, heterozygotes need to be distinguished i.e. A1/A2 and A2/A1 are treated separately. He showed the following genotypes: A1/A1, A1/A2, A2/A1, and A2/A2. I was a bit surprised, since I excepted that there should also be some change in homozygotes.

If we assume that there is imprinting, then alleles have different effect when inherited from a particular parent. Naive approach would be to mark alleles as A1, A1+, A2, and A2+, where + means additional effect. However, this is actually a set of four alleles i.e. A1, A2, A3, and A4, from which we can construct 16 ordered genotypes. This is not OK. Let us mark alleles as A1f, A1m, A2f, and A2m, where f means father and m means mother. We can construct the following ordered genotypes: A1m/A1f, A1m/A2f, A2m/A1f, and A2m/A2f. Therefore, there are four possible ordered genotypes and it is clear that only four different genotypic values need to be defined by the model.

Here is a list of some papers on the genomic imprinting - I am sure I missed a bunch of important ones:

Reviews
Models
Applications
"Our [Their] results show that the effects of genomic imprinting are relatively small, with reciprocal heterozygotes differing by {approx}0.25 standard deviation units and the effects at each locus accounting for 1% to 4% of the phenotypic variance. We detected a variety of imprinting patterns, with paternal expression being the most common. These results indicate that genomic imprinting has small, but detectable, effects on the normal variation of complex traits in adults and is likely to be more common than usually thought."
Evolution of imprinting

LaTeX in blog posts

Sometimes I would like to include equation into the blog post. I claim that LaTeX is perfect for this job! However, one can not just type LaTeX code directly on Blogger. Wordpress has a plugin for this job. What can Blogger users use? I found the following:
I wil try the jsTeXrender since they have a nice installation howto!

Now let us try with double $ tags: $$\Pr\left(A_1\right)=\frac{1}{2}$$

with pre tags:
\Pr\left(A_1\right)=\frac{1}{2}


and with code tags: \Pr\left(A_1\right)=\frac{1}{2}

A joke about 0

Click on the picture to increase its size. The joke is written under it!