Scientists recently discovered a tapeworm living inside a patient's brain in the United Kingdom, and rather than getting rid of it after it was removed, they decided to sequence its genome instead, according to a new study.

Tapeworms are parasites most commonly found living in the human gut and lead to infection referred to as sparganosis. They cause symptoms such as weakness, weight loss and abdominal pain. And if that doesn't already make your skin crawl, the larvae of some tapeworm species can even reside in areas like the eyes, brain and spinal cord.

Well one such tapeworm made its way to a 50-year-old Chinese man's brain (living in the UK), reportedly triggering symptoms of headaches, seizures, altered smell and memory impairment. Doctors remained puzzled by this man's case until an MRI showed that a lesion had mysteriously moved at least five centimeters across his brain over the past four years. A biopsy finally revealed the 1-cm-long, ribbon-shaped larval worm.

"This infection is so rare worldwide and completely unexpected in this country that the patient was not diagnosed with sparganosis until the worm was pulled out from the brain," lead study author Hayley Bennett, from the Wellcome Trust Sanger Institute, said in a press release.

After an operation removed the slimy culprit - later identified as Spirometra erinaceieuropaei - from his brain, scientists decided to sequence the worm's entire genome for the first time. It measured at 1.26 billion base pairs long, currently the largest reported genome for any flatworm.

"We were also surprised at how large the genome was, it is much bigger than those of other known flatworms, and roughly a third of the size of the human genome," Bennett said.

S. erinaceieuropaei is a rare tapeworm species typically found in China, South Korea, Japan and Thailand. It causes a parasitic infection usually by ingesting undercooked frogs or snakes, using frog meat for treating wounds, and ingesting contaminated water.

"By comparing the genome to other tapeworms," she added, "we can see that certain gene families are expanded - these possibly underpin this worm's success in a large variety of host species."

The findings are described in the journal Genome Biology.