Gnawing pests that are devastating Canada's forests and agriculture may not have an appetite for destruction for long, thanks to a recent scientific breakthrough.

Researchers at the University of British Columbia and the Michael Smith Genome Sciences Centre have decoded the genome of the mountain pine beetle, which will allow for a first look into how the beetles can cause so much devastation, and why.

Because mountain pine beetles live under a tree's bark, the bugs can't be sprayed and keeping the insect's voracious hunger at bay is difficult.

Christopher Keeling, research associate at the genome centre, said decoding the beetle's genome will allow scientists to uncover some of the pine beetle's secrets -- such as how it can survive the bitter cold.

He said the information can also be used to help manage the epidemic in the future.

The breakthrough opens up research for not only pine beetles, but all beetles and weevils that can be costly for the agriculture industry, Keeling said in an interview.

This includes pesky species like the spruce beetle, the southern pine beetle and the eastern larch beetle, all of which have wreaked havoc on Canada's forests.

The mountain pine beetle alone has caused massive destruction to over 18 million hectares of lodgepole pine in B.C. -- an area more than five times larger than that of Vancouver Island.

The beetle turned vast swaths of once-green forests first to an orange-red and then to dead black.

Pine beetle populations have moved further north and east and have started to infest other pine trees including the endangered whitebark pine.

Keeling said the pesky pine beetle problem is becoming more of an issue in Alberta and is now moving towards Saskatchewan.

"Beetles actually are the largest order of insects. There are over 40,000 prescribed species," he said.

"Pretty much everywhere in Canada there's an dendroctonus (bark) beetle that's affecting the pine or spruce or other conifer trees."

Researchers from the University of Northern B.C. and the University of Alberta have found the beetle has genes that allow it to defeat a tree's defence compounds and others that degrade plant cell walls, allowing it to suck up nutrients from the tree.

The research -- which was published this week in the journal Genome Biology -- revealed a large variation among beetles in the species that is almost four times greater than that of humans.

The mountain pine beetle genome consists of about 13,000 genes and 12 pairs of chromosomes.

Scientists think that could help the bug eat more effectively as it expands to new environments.

There was also a bacterial gene uncovered that the experts believe allows the beetle to digest wood or possibly micro-organisms that grow underneath tree bark

Keeling compared decoding the beetle genome to the sequencing of the human genome, which has opened up opportunities for researchers to quickly study human systems and figure out information about disease.

The pine beetle is only the second beetle ever sequenced, the first was the red flour beetle, which is a pest in stored grains.

Keeling said in a statement that the pine and red flour beetle are vastly different, however, and have "about the same relatedness as a pine tree and a head of lettuce."