Just a few years ago, teenage science prodigy Jack Andraka was at an all-time low. Bullied at school for being gay and geeky, he began self-harming and having suicidal thoughts.

But his love of science, his family and his incredible life-saving discovery have brought him out of the darkness.

Aged just 15, after years of experimenting in the basement of the family home in suburban Maryland and inspired by a close family friend who died from pancreatic cancer, Jack invented a new test to diagnose pancreatic, ovarian and lung cancers. The test is said to have the potential to be 400 times more sensitive, 168 times faster and 26,000 times cheaper than current tests, and costs only three cents per use.

However, it took some time before the profession would take him seriously, Jack, now 18, explains.

"It's hard being young in a scientific field, because I don't have the credentials or the letters behind my name. It was really hard for adults to take me seriously."

He wrote to 200 professors asking them to develop his theory. Only one took him up on it - Dr Anirban Maitra, at Johns Hopkins University School of Medicine in Baltimore, was prepared to take the risk.

He says that because it takes so long to have the test licensed, it will take five to 10 years to come to market, but that the potential is huge, as it can be adapted to detect all kinds of diseases, including Alzheimer's and heart disease.

"That's one of the frustrating parts of medicine, that it takes so long to get a product from bench to bedside."

Throwing himself into science was one way of alleviating the bullying, which started when he was around 12 and went on for nearly two years.

"I was bullied firstly because I was the maths and science kid who always won the science things, and also, I was coming out as gay and, when that happened, it intensified. After a while, I just tuned out.

"It left deep emotional scars. I went into deep depression when I was having suicidal thoughts and was cutting my wrists. It was a very dark time for me, but I was able to prevail because of my family, friends and by throwing myself into my science work."

He saw a school counsellor and went to a support group, but pursuing his scientific experiments also boosted his psychological state.

He would spend hours in the basement after school and at weekends, working on his tests for pancreatic cancer.

"One of my biggest inspirations was Alan Turing, the first openly gay scientist. Also, I'm really inspired by Marie Curie, because she was doing science at a time when women weren't typically doing that."

Today, Jack has the science world at his feet and was the personal guest of Michelle Obama at the Whitehouse, when she invited him to the State of the Union address. Later, he also met her husband.

"Meeting the Obamas was awesome. Barack Obama was really informed on pancreatic cancer and was able to ask about everything. Michelle was definitely a hugger! Meeting her was incredible."

Now, Jack's story is charted in his memoir, Breakthrough.

"I wanted to get the message out to other young people to show that anything's possible, and you can overcome hardships and turn them into your passion."

Jack was born into a clever family. His brother Luke is also a science whizz who is now focusing on electrical engineering, while his mother Jane is an anaesthetist and his father Steve, a civil engineer.

"I had always liked doing experiments," he recalls. "I started with basic ones, like working out how many books I could rest on eggs before they cracked, or making water boil at different temperatures using salt.

"By the time I entered fifth grade, my experimentation began to take on a life of its own."

After cultivating E. coli, a bacteria that can cause deadly infections, just for the fun of it, on the kitchen stove, his parents insisted he used the basement as his lab.

"Me and my brother would spend hours doing crazy experiments down there."

At one point, their house was searched by FBI officers, because of their online shopping history, which involved buying chemicals for their tests.

He and his brother won prizes at science fairs, attended maths camps during the school holidays and the young Jack even accompanied his anaesthetist mother to witness several operations in which she was involved at hospital.

"I would go to her work sometimes, at night - so she could smuggle me in, and I could watch some surgery. I was fascinated to see the operations. I saw cardiovascular work and that kind of thing."

He doesn't feel he has missed out on his childhood in pursuit of scientific discovery.

"I don't regret it at all. I did hang out with friends sometimes. There was a balance between my science life and my regular teenage life. "

Developing the test for pancreatic cancer and now writing the book has inevitably thrown him into the spotlight.

"My life has been absolutely crazy since then. I've been to 25 countries I didn't know existed. I could never have imagined meeting the Obamas.

School is now hard to fit in with his scientific schedule. He missed all of March for his book tour, but is confident he'll catch up and hopes to end up at medical school in a research position.

"It's not about the money, it's about saving as many lives as possible. I haven't licensed the patent yet, because I'm still in talks with biotech companies."

And the projects keep coming. He is currently planning to make a robot which can navigate the circulatory system to seek out cancer cells.

When he's not working, researching or touring, he likes to go kayaking and whitewater rafting.

He has a big circle of friends in the science world, who he bumps into at conferences. "We're known as the smart kids' group," he reveals. "And at school, I have a big bunch of friends. I don't get lonely any more.

"A few years ago I had no self-esteem and that's how the depression started. I felt worthless. My life now, compared to three or four years ago, is like night and day. It just goes to show how a single cruddy moment doesn't define your entire life."

:: Breakthrough by Jack Andraka with Matthew Lysiak is published by Scribe, priced £12.99