Mark Wilson / Getty Images on August 20, 2013 in Fort Meade, Maryland.

Bradley Manning’s decision to live as a woman highlights how complex gender identity is.

Sentenced to 35 years in prison for the largest leak of classified information in American history, Bradley Manning wants to serve that term as a woman. “As I transition into this next phase of my life, I want everyone to know the real me,” she wrote to NBC’s Today Show, “I am Chelsea Manning. I am a female. Given the way that I feel, and have felt since childhood, I want to begin hormone therapy as soon as possible.”

The army has said it will not provide such treatment in prison, but research is beginning to suggest there is a biological basis for gender dysphoria, or distress over a perceived mismatch between one’s visible gender and actual identity. As a private, Manning struggled with gender-identity issues, and this experience factored in the soldier’s defense in explaining the leaks. The latest science also shows that gender and sexuality are far from clear cut and that gender may really be a spectrum of grays, not the black and white we tend to see.

MORE: Manning Biographer: Media Should Respect The Trans Experience

Like Manning, most transgendered people know that they are different very early in life. “The research that I’ve done suggests that it’s on average between [age] four and five, which has been supported by other studies,” says Genny Beemyn, the director of the Stonewall Center at the University of Massachusetts in Amherst, who is transgendered and does not identify as either male or female. Beemyn adds, “Some say from their earliest memories, they recognize that there’s something different about their gender, as compared to their playmates.”

That perception may derive from biological differences in their brains, says Dr. Dick Veltman, professor of neuroscience at VU Medical Center in Amsterdam, who has published research on children with gender identity issues. In his work, he and his colleagues examined whether the brains of these children look more “male” or “female” when performing visual or verbal tasks that are designed to identify gender differences.

“Our results indicate that for both spatial and verbal [skills], transgenders will perform and show regional brain activity similar to their desired rather than their biological sex,” he says. “Importantly, these findings were obtained in children prior to the onset of puberty, so that these differences appear to be present at an early age, and are not necessarily due to hormonal changes associated with puberty.”

MORE: A 6-Year-Old Boy Becomes a Girl: Do Schools Need New Rules for Transgender Students?

But research on the brains of transgendered people is still in its infancy. A few studies, such as Veltmann’s, have found some differences, while others have not. “The results from different studies show different findings depending on whether the study group is male to female, or female to male, and depending on which technique was used,” says Ivanka Savic Berglund of the Karolinska Institute in Sweden, who studies gender and the brain.

She published a study in 2007, which examined how heterosexual female to male transgendered people responded to the smell of sex hormones, compared to heterosexual men and women. Their response was more like a female response, but not quite like that of a heterosexual male. “We found a pattern of brain activation which was more congruent with the perceived sex than with the chromosomal sex,” she says.

And despite many people’s assumptions that transgendered people identify as homosexuals, sexual orientation and gender identity are separate issues— transgendered people can be straight or gay, just as occurs with those whose genders match their physical appearance.

MORE: Study: Why Some Transgendered People Have Higher Levels of Autistic Traits

Complicating matters even further for transgendered individuals is the fact that during childhood, many who grow up to be gay or lesbian identify themselves with behaviors associated with the opposite sex from which they are raised. There are also some children who feel uncomfortable with their biological gender whose feelings change with puberty or who ultimately decide to resolve them without surgery or hormones. “There are differences between someone who feels that they want to express masculinity as a female-bodied child [and those who want to do the reverse],” says Beemyn, “ We have [the idea of the] ‘tomboy.’ For male-assigned children, there is not that cultural space to express themselves.”

Beemyn adds, however, “There’s a big difference between a boy who wants to wear feminine clothing or pink and a boy who says, ‘I want my penis cut off because I don’t feel like I am a boy.’” Until recently, such children had little choice but to act in gender-conforming ways. But now, Beemyn says, gender therapists can help parents and kids find their way through these issues.

It’s a challenging journey, and not surprisingly, the approach must be highly individualized. What is right for one child in terms of dress, hormones and surgery may be wrong for another. Some children may take hormones to delay puberty so that development can be altered later to produce an appropriately-gendered body; others may just want to dress in clothes that reflect their sense of gender and never take hormones or have surgery. But because these perspectives can change over the course of a child’s development, parents and therapists should take care not to make irreversible decisions without adequate consideration.

MORE: Identity Crisis: Changing Legal Documents No Easy Task for Transgender Individuals

Given how complicated the biology is— not to mention the cultural, social and parental contributors to sexual identity—it’s not surprising that some people, like Manning, fall somewhere between neat categories of male and female. Beemyn has chosen to use the pronoun “ze” rather than “he” or “she” when self-identifying, to reflect this fact.

Manning’s desire to change genders was clearly a long time in the making, and driven by biological and cultural factors that interact in ways that scientists still can’t unravel. For Chelsea Manning, the next hurdle will be to fight for the treatment that she wants. Manning’s attorney, David Coombs, said on Today that if the therapy Manning desires is not provided at Fort Leavenworth, where Manning will likely be sentenced, “I’m going to do everything in my power to make sure they are forced to do so.” The National Journal reports that two ongoing cases may make that possible, and it’s likely that the military will be facing increasing questions about how to best help transgender soldiers to be all they can be.