In 2010, when scientists at Knome Inc. were looking to study a remarkable human’s DNA, they didn’t ring up Steve Jobs or Beyoncé. Instead, the Cambridge, Mass.-based human genome company reached out to Ozzy Osbourne. They wanted to know what genes had kept the rocker alive through decades of heavy drug and alcohol abuse.

Their findings did not disappoint. They discovered a never-before-seen mutation that may explain Osbourne’s ability to consume alcohol in great quantities and several genetic variations that predisposed him to drug and alcohol dependencies.

“Ozzy is indeed a genetic mutant,” writes Bill Sullivan in his new book, “Pleased to Meet Me: Genes, Germs and the Curious Forces that Make Us Who We Are” (National Geographic), out this month. He looks at the surprising ways we’re shaped by our DNA and biological factors that dramatically affect how our genes are expressed.

There’s a gene variant for a sweet tooth, multiple genes affect our enjoyment of coffee and genes even govern our basic emotions, sexual attraction and political tendencies. “After all these years of thinking we were free agents, we’ve come to realize that most, if not all, of our behavior is not of our own volition,” writes Sullivan, a professor at the Indiana University School of Medicine.

People who are politically liberal are more likely to possess a variant of a certain gene, and scientists can predict someone’s political affiliation with 72 percent accuracy by looking at a brain scan. Conservatives tend to have a bigger amygdala, the part of the brain activated in fearful situations, while liberals often have a larger anterior cingulate cortex, the area involved in analyzing instinctive thoughts.

When it comes to everyday emotions, Sullivan writes, our genes program the brain chemicals, including serotonin and dopamine, that cause us to feel certain ways. “However magical they may feel to you, your emotions are purely biological in origin,” he writes.

The reason that Scandinavian people are often singled out as the happiest people on Earth may be as much about genes as lifestyle. A Bristol University researcher looked at the DNA of people from 30 countries and found that the Danes and the Dutch had the fewest instances of carrying a serotonin receptor gene that’s been linked to depression.

With attraction, two different genetic forces are at work. On the one hand, we’re often drawn to people who are similar to us, which makes sense, Sullivan writes. “If selfish genes must yield half their territory to sexually reproduce, then why not recruit genes similar to those surrendered?” But, at the same time, we’re biologically wired against incest and being attracted to someone very similar to us. “Too much genetic similarity yields offspring that are enriched for deleterious traits.”

As for same-sex attraction, Sullivan notes that homosexuality can have a genetic component and has been detected in more than 400 species, from fruit flies to giraffes to whales. There are various hypotheses as to the benefits of homosexuality to society. Some have theorized that gay aunts and uncles are crucial to supporting the family tree in the animal kingdom. Others believe it may be a form of population control, “bringing the species into biological balance with the resources available in its environment,” Sullivan writes.

Meanwhile, traumatic experiences in childhood can alter the way our genes are expressed for a lifetime — and beyond. A 2004 McGill University study found that rat pups with inattentive mothers grew up to be anxious because neglect affects a specific gene related to handling stress. Studies suggest that the same is true for humans. Research has shown that being raised in an orphanage changes the way genes are expressed, particularly those related to regulating the brain and immune system. Adverse childhood experiences, Sullivan writes, “don’t just get under the skin; they get into victims’ DNA, scarring their genetic code in ways we are just beginning to understand.”

With so many genetic factors at play, Sullivan pleads for more sympathy toward those struggling with addiction and obesity. Over a dozen genes have been linked to impulse control. Addiction, the author writes, “has more to do with our DNA than our moral fiber.”

We should even think differently about those who commit violent crimes — and some already are. Sullivan notes a 2006 case where a man went on a rampage, shooting and killing his estranged wife’s friend and chopping off one of the wife’s fingers with a machete in front of their children. He was spared the death penalty because he was found to have a mutation of the MAOA gene, which is associated with malevolence in men. (Ironically, it’s linked to happiness in women.)

While some might envision a future in which people are screened for such gene variants, Sullivan stresses it’s not that simple. Some people could have the variant and be perfectly kind, while that same code could be absent in a brutal murderer.

“A gene is one piece of a puzzle that makes up a picture,” he writes. “You can’t tell what that picture is going to be solely by looking at one puzzle piece.”