FROM the role of gut bacteria in depression to how plant science can deliver food security in the face of climate change, and the 'Angry Chef' taking on the food myths and identity politics surrounding what we eat, this year's Edinburgh Science Festival is putting nutrition front and centre of the debate.

The rise in veganism, calls for meat taxes, and a push to tackle obesity with state-led interventions such as sugar levies on soft drinks and restrictions on junk food offers have thrust our diet into the spotlight like never before.

Like the rest of Europe, Scotland's high streets have experienced an exponential rise in the number of fast food outlets since the 1970s. Where takeaways might once have been limited to a fish supper or portion of chips, consumers today can take their pick round-the-clock from kebabs, burgers, pizzas, curries, burritos and foot-long sandwiches.

Ready meals high in salt, sugar and trans-fats have replaced home cooking as the norm in many households. Supermarket shelves are so awash with cheap crisps, cakes, confectionary and junk food that the Scottish Government - fresh from its long legal fight on minimum alcohol pricing - has set about becoming the first country in the world to ban multi-buy promotions on such items.

The transformation in our food environment is not only impacting waistlines but lifespans, with research in the Lancet last week reporting that unhealthy diets are now responsible for an estimated 11 million deaths globally each year - overtaking smoking for the first time.

Major studies this year have backed huge increases in the recommended fibre intake at a time when most Scots still fall well short of achieving their 'five-a-day'. The World Health Organisation, meanwhile, warned that a global shift from meat-based to plant-based diets (red meat threshold around one Sirloin steak per fortnight) would be vital not only for human wellbeing, but preventing an environmental catastrophe.

Now the cutting edge new science of 'psychobiotics' - how gut bacteria affect the brain - suggests that what we eat might also be influencing everything from anxiety, depression and stress to age-related degeneration and autism.

Evidence is already mounting that people with a lower diversity of bacteria in their intestinal tract are more prone to weight gain, but the psychological impact is only beginning to be explored.

Nothing is more important to the composition of our gut bacteria - or the "microbiome" - than what we eat. A varied diet rich in fibre, fruits, vegetables, nuts, and oily fish - a so-called Mediterranean diet - appears to deliver an optimum mix, but the modern Scottish diet is far from this ideal.

Genetics play only a minor role in microbiome composition - possibly as little as five per cent - while other factors such as the decline in breastfeeding rates and the increase in caesarean deliveries have both contributed to a decline in microbiome diversity among recent generations less likely to have been exposed to their mother's bacteria during birth or infancy.

The task for those studying psychobiotics is unravelling the mechanism by which gut bacteria affect brain health, and proving that there is a causative link between the changes in diet over recent decades and rising rates of mental health problems.

Professor John Cryan, chair of anatomy and neuroscience at University College Cork and one of the world's leading experts in 'psychobiotics', first became interested in the field around ten years ago when he was involved in experiments that showed stressed animals experienced changes in their microbiome.

He said: "It got us thinking that that could maybe be relevant to how they actually deal with stress, so we did a whole slew of experiments and proved that indeed that is the case.

"Then we wanted to see if we could reverse the changes, or at least dampen down the stress response, by targeting microbes in the gut. In animal experiments we would target them with specific bacterial strains or 'prebiotics' - the fibres and sugars which good bacteria use to grow and thrive. It worked.

"More recently we moved into human studies and we were able at some level to replicate the findings."

The team has also shown that individuals born by C-section are more susceptible to stress, and have found evidence that middle-aged mice fed prebiotics to boost their microbiome also experience reductions in neural inflammation in the brain typically associated with ageing.

Reduced microbial diversity has repeatedly been found in the guts of patients suffering depression, and a recent Belgian study found that certain important bacteria were missing altogether. This was not explained by antidepressants, which are known to disrupt gut flora over long term use.

"We need to go a bit further to show whether all depressed people have this, or how we tackle it," said Cryan. "It's very hard to get causation yet. There definitely is a diet-mental health relationship, I think that's pretty much accepted, the question is how it works.

"Our thinking is that it creates vulnerabilities in the microbiome that interferes with gut-brain signalling."

In obesity science, researchers have already been probing whether the guts of overweight people can be 'reprogrammed' with bacteria extracted from the stools of slim people found to have particularly diverse microbiomes and high concentrations of certain microbes associated with calorie burning.

Now a pilot study into autism in the US is testing whether similar faecal transplants from healthy children can alleviate some of the behavioural symptoms associated with the condition.

"It's highly emotive," said Cryan. "But what we find is when you mess with the microbiome, you can mess with the social brain and social behaviour. So there is hope - but it's just hope at the moment - that microbiome research might one day be useful in helping with some of the symptoms of autism.

"There's one pilot study using FMT [faecal microbiota transplantation] in autism. It's a small study in Arizona of about 20 people, published in the journal Microbiome. But it worked."

The question is, if altering the microbiome does deliver results in relation to depression, anxiety, stress, autism and even ageing, then will doctors be prescribing routine faecal transplants or prebiotic drinks in future?

Cryan, who delivered his talk, 'Good for your Guts', at the Pleasance in Edinburgh last week, said: "There are ongoing trials into faecal transplants in people with depression and bipolar illness. I don't know whether we'll need something that radical, but I do think we'll see situations where personalised approaches to not just nutrition but prebiotics and probiotics are added onto current therapies, be it medication or psychotherapy.

"But we've got a lot to figure out yet because we don't know what a 'normal' microbiome is. What I think is more likely is that someone who is prone to depression could be able to examine their microbiome when they're well, see what happens when they're ill, and try to reverse that or to predict a flare-up. That's what happening now in some Crohn's disease research."

As for the general population, what does psychobiotics tell us we should be eating?

"This is what we're really trying to test now and get some real evidence behind," said Cryan. "We know that diversity is really important - we know that a Mediterranean style diet is really important. You can't have enough fibre if you can tolerate it, plenty of vegetables, plenty of Omega 3 from fish, some meat - but not too much.

"Try to avoid processed food as much as possible - emulsifiers, sweeteners, these are all bad for the microbiome. We also know that there is growing evidence of the influence of sleep on the microbiome. Studies are looking at jetlag, for example.

"Having a pet, especially a dog, has also been shown to really improve microbiome diversity."

What we eat as a planet has implications far beyond human health. Climate change, freshwater shortages and a global population projected to balloon from 7.2 billion today to 9.8 billion by 2050 will demand a dramatic shift in what we farm, where and how.

"If we don't, we have a very, very serious problem in feeding the growing population," said Professor Bill Davies, who will deliver a lecture at the Royal Botanic Gardens in Edinburgh on Thursday entitled 'Sourcing Healthy Food as the World Changes'.

As an environmental biologist and director of the Centre for Sustainable Agriculture at Lancaster University, Davies believes that science offers some of the answers - but not all. Changes in diet will also be crucial, he said.

"There doesn't seem to be any doubt that many people's health would benefit if they ate less meat, and it's pretty clear that the planet would benefit in terms of reduced greenhouse gas emissions," said Davies. "But there are also lots of potential downsides. Britain looks like Britain largely because of the kind of agriculture we practice here, and a lot of the land which is used for the production of meat won't be so easy to do anything else with."

Meat may have taken on pariah status in recent years, but it is not the only foodstuff wrecking the environment. Rice, so ubiquitous in the Asian diet, is also causing serious harm. Prof Davies is working directly with Chinese farmers to find more sustainable ways to raise the crop.

He said: "In the last 50 years, the push for food in China has been so great - from a position where probably 30-40 million Chinese died from starvation in the 1960s, to a position where China is effectively self-sufficient in food.

"But they've done that at the expense of the environment in many of these areas. In the area where we work, in northwest China, the water table which 50 years ago was a few tens of centimetres from the surface is now a hundred metres or more below the surface.

"Rice is the thirstiest crop on the planet. One third of the world's freshwater and half the freshwater in Asia is used to irrigate rice crops - it's nuts. One sixth of all the methane produced by agriculture is produced by growing rice, and rice is not even particularly good for you.

"But that's a great example of the kinds of environmental and cultural problems we need to grapple with. Asking people in China to eat less rice is probably a comparable challenge to persuading people in the UK to only eat meat once a week.

"We can't just tell people not to eat it - but if we can grow rice with less water, that's a start."

Davies' project in China is exploring 'alternate wetting and drying irrigation', where the water supply on the paddy field is reduced during certain phases of development.

Microsoft billionaire and philanthropist Bill Gates is also using his Foundation to fund research into whether rice can be genetically modified to grow with less water.

Although restricted in Europe, the total acreage of farmland worldwide used to grow GM crops has overtaken non-GM for the first time this year.

Davies believes this sort of biotechnology - which has already shown success in making some plants pest-resistant, thereby cutting the need for pesticides - will be crucial to delivering substantially higher crop yields in future.

He said: "The kind of thing people are working on now is to make plants more productive. To manipulate the biochemistry within the plant to discover what's limiting its yield. For example, why is the record yield for wheat in the UK 16 tonnes per hectare - why can't we produce 30 tonnes?

"The chances are within the next 10 years the people working on this will overcome those limitations and there will be much more productive crops available that would allow us to grow the same amount of food on a reduced area of land."

While gut science and biotechnology advance, nutrition will almost certainly continue to be fertile territory for what 'Angry Chef' Anthony Warner dubs "pseudo-scientific food charlatanry".

Warner has made it his mission to debunk food myths and so-called 'miracle' diets which he says are stripping the joy out of eating and ladling on guilt instead.

As a chef with a background in science who has spent years working in restaurants, hotels and developing recipes for major brands, he said he decided to create his online 'Angry Chef' persona to rebut the "bad science".

"I was at a food industry event and people were speaking about 'clean eating'," said Warner. "There was this Instagram-style influencer with half a million followers or something. Everyone seemed kind of enamoured by her, but I was thinking 'she's got no idea, from a scientific point of view, what's she talking about'.

"Her recipes might look quite nice, but she was actually communicating some quite dangerous stuff."

He has since gone on to pen the bestselling books, 'Bad Science and the Truth about Healthy Eating' and 'The Truth about Fat: Why Obesity is not that Simple', and will bring his common sense and science message to Edinburgh next week.

Warner believes that the whole discourse around food has fallen victim not only to expert-shunning and 'alternative facts', but social media's polarising identity politics.

He said: "One of the issues with food now is that it's very much become part of our identity, almost in a way that's replaced some sort of religious signalling. If you look at people's online profiles, terms like 'vegan', 'paleo', 'low carb', it's one of the first things people think defines them.

"What you ate for dinner - or more so what you didn't have - is so tied into people's sense of self that when you challenge people's rhetoric and suggest that it's not actually based on fact, it's like you are attacking their identity and it can make people very upset.

"I know several dieticians and registered nutritionists who have been abused in a very organised way on Twitter by people with massive 50-60-70,000 followings, organising mass pile-ons - almost exclusively onto women - for expressing opinions that are usually very sensible and based on science. It's awful."

The difficulty for those trying to fight pseudoscience with facts, however, is that nutrition science is inherently complex.

"It's very difficult to do proper experiments - hard science - when it comes to food and diet," said Warner. "If you want to check whether beetroot improves a certain health condition for example, you can't use a placebo beetroot the way you would with a drug.

"And you can't really do long-term experiments because you can't be expected to change someone's diet permanently over the long term to see how it affects them.

"The problem is, people want definitive answers. They want to be told 'sugar is toxic' or 'gluten is bad for you'.

"In the 1980s it was all 'fat is bad, you must avoid fat'. Now we've shifted and it's all about avoiding sugar and carbohydrates. The problem isn't one or the other, it's the oversimplification.

"But if you're selling simple answers and simple solutions to people that will supposedly transform their health, that's a really attractive message.

"The uncertainty and nuance of actual science, unfortunately, is less compelling."