A new study looked at three dopamine system genes (previously associated with conditions including ADHD) that may explain some of that "W" factor.
[The study examined] DNA and lifestyle data from a representative group of 2,500 U.S. middle- and high-school students who were tracked from 1994 to 2008 in the National Longitudinal Study of Adolescent Health.
“We found that as the number of certain dopaminergic gene variants increased, grade point averages decreased, and the difference was statistically significant . . . For example, the GPA of a student with specific variants of three dopaminergic genes might be around 2.8, versus a GPA of around 3.3 without the variants. . . . they found a marginally significant negative effect on English grades for students with a single dopamine variant in a gene known as DAT1, but no apparent effect on math, history or science. In contrast, a variant in the DRD2 gene was correlated with a markedly negative effect on grades in all four subjects. Students with a single, DRD4 variant had significantly lower grades in English and math, but only marginally lower grades in history and science.
None of the dopamine genes are associated with IQ (and here).