Their powerful poems evoke all the misery, pain and horror of a brutal war that robbed a generation of its youth and would change the world forever.

Wilfred Owen and Siegfried Sassoon’s First World War poems have become synonymous with annual Remembrance commemorations, read in solemn tones against backdrops of row after row of white war graves in foreign lands or grainy footage of muddy trenches and wounded soldiers.

Now new research has uncovered fine details of the leading role Scotland’s capital city and its people played in moulding their minds, influencing their writing, and forging their friendship, helping to seal their status as Britain’s best-known war poets and inspiring some of their most gripping works.

It has also added to the debate that has swirled around Owen’s sexuality which have seen him often referred to as being gay.

According to researcher, author and University of Aberdeen historian Neil McLennan, who has scoured local and international archives to pie ce together snippets of the pair’s short time as patients at Craiglockhart War Hospital, the connections they made in the city tend to be skimmed over, yet played a crucial role in igniting their creative juices minds after the horrors of war.

In a new Edinburgh-themed collection of their work, he says: “Most people will have studied the war poets in their school days – the words of Owen and of Sassoon are popular and used in many classrooms.

“However, perhaps few will be aware that Owen and Sassoon’s most powerful poems were written while in Edinburgh.”

The new book includes a previously unpublished fragment of a poem written by Owen, found in his editor’s notes for an edition of The Hydra and a fragment that Owen left in an autograph book.

Mr McLennan was head of history at Tynecastle High School when he uncovered details of Owen’s spell teaching at the school, part of his therapy for shellshock arranged by the hospital’s pioneering Dr Arthur Brock.

His believes one of his most powerful poems, ‘Anthem for Doomed Youth’, was partly influenced by the pupils he taught there and his journey to the school past a railway siding, cattle market and abattoir.

The poem opens with the lines: “What passing-bells for these who die as cattle? Only the monstrous anger of the guns.”

He has also delved deeper into Owen’s relationship with fellow officer Sassoon and their lesser-known travels outside the city to Milnathort in Kinross-shire.

There they visited the Thistle Inn, run by a former head chef at the Savoy in London, Albert Dauthieu, and his daughters, Albertina and Rose.

Despite already being committed to a Scottish captain, Albertina, 19 at the time, vowed that, should her fiancé not survive the war, then Owen should take her hand.

Mr McLennan believes that although Owen is often referred to as being gay, the Milnathort example shows his sexuality was more complex.

“Although other biographers have noted Owen’s interaction with the opposite sex, few have explicitly said Owen was bisexual.

“I believe it is only right we acknowledge Owen’s female relationships to give some balance to understanding the man and his poems.”

Owen arrived in Edinburgh having been injured twice on the Western Front. The second injury, in April 1917, affected him mentally and physically, and left him suffering from ‘[NB spelling change: neurasthenia]’ or shell shock.

Craiglockhart War Hospital near Slateford, was one of just a few to care for shell-shocked soldiers with staff who had radical ideas for treatment.

While there, he met established poet Sassoon. An outspoken critic of the war, he had been medically referred to Craiglockhart – which he dubbed ‘Dottyville’ – which probably enabled him to avoid a court martial and its potential consequences.

Sassoon became a major supporter of Owen’s work, however Mr McLennan has uncovered nuggets of detail that show how influential the city and both poets were on each other.

He said: “Biographies of Owen often mention Edinburgh as if it was a passing episode. Yet he wrote his most powerful poems during that period.

“I wanted to know what he was doing, where he was going, who was he meeting and how the geography and environment of Edinburgh, this city of Enlightenment helped to propel his thinking and his writing.

“Just as Sassoon is mentioned as having an influence on him, there was a social, cultural [socio-cultural] set in Edinburgh that helped Owen with his ideas and inspiration.”

Owen’s Edinburgh works include the deeply moving Dulce et Decorum Est, which begins: “Bent double, like old beggars under sacks, Knock-kneed, coughing like hags, we cursed through sludge” and goes on to describe the harrowing impact of a trench gas attack.

Mr McLennan was driven to explore the poets’ Edinburgh links by his own family’s wartime connection: his great grandfather Roderick McLennan witnessed the death of poet Ewart Alan Mackintosh on the second day of the Battle of Cambrai in 1917.

He was head of history at Tynecastle High School he uncovered evidence of Owen’s connections with the school, arranged by Dr Brock as part of therapy which included editing a hospital magazine, The Hydra.

Mr McLennan now believes the episode had a key influence in his searing work, Anthem for Doomed Youth.

“It is one of his most famous works but no one had looked at it in the context in which it was written,” he said. “The first draft was called Anthem for Dead Youth, but he changed it to ‘doomed’.

“I believe that is because he had been teaching these kids at Tynecastle, it was 1917 and he could see the way the war was going. These boys were the fallen generation.

“What is their future? Conscription is happening, they would be leaving school to be conscripted and he knew what happened at the front.

“There’s the analogy of cattle. Owen would travel to the school and pass railway sidings where cattle trucks would be waiting, the Corn Exchange meat market and an abattoir.

“You can say this is not just a war poem, it’s an Edinburgh poem bringing together the social and environmental experience of Edinburgh.

“I’m convinced the boys at Tynecastle High School influenced his poetry – he clearly had a good relationship with the class teacher and the boys.”

As he prepared to return to the frontline, Owen visited the school, where his army postal address was written on a board.

“The boys sent gifts - a bottle of whisky and cigarettes for him. There is an obvious connection and he clearly built up a strong rapport.”

One of the school’s teachers, a Mrs Fullarton, may also have influenced a later poem, called School Mistress.

She was one of five Edinburgh people – including Dr Brock - whom Owen had stipulated should receive a copy of his poems should they ever be published.

Owen, however, never saw his collection published: he was killed whilst crossing the Sambre Oise canal, Ors, with a week of the war left.

Mr McLennan’s book is the first to gather Owen and Sassoon’s Edinburgh poems in a single collection.

He said the Edinburgh collection sheds fresh light on the connection between the two: “One part of the narrative is that Sassoon helped Owen.

“He did, but this whole network across Edinburgh and Owen also helped Sassoon.

“It was a symbiotic relationship.”

Owen & Sassoon: The Edinburgh Poems, edited by Neil McLennan is published by Polygon on 2 November.