As the bicentenary of Edgar Allan Poe is celebrated, fans should be thanking him for his invention of the modern detective genre, writes crime fiction author Andrew Taylor.
Bestseller lists and library lending figures tell the same story - crime and detective stories are more popular than ever, and their success has spilled over into film and TV drama.
It's remarkable how many of the genre's classic elements can be traced back to the feverishly fertile imagination of one man, Edgar Allan Poe. Once you start looking, the clues are everywhere.
Edgar Allan Poe is best known for his gloomy gothic tales
Born 200 years ago, on 19 January 1809, Poe was a prolific writer of poetry, fiction and essays. But his influential contribution to crime and detective fiction mainly derives from a handful of short stories.
The most important are the three featuring his French investigator, C Auguste Dupin.
The first, The Murders in the Rue Morgue, was published in 1841, predating the founding of a detective office even at Scotland Yard. Its format brought about a revolution in fiction.
Dupin is well-educated and eccentric. He relishes the intellectual challenge of pitting his analytical abilities against those of the conceited but frequently baffled prefect of police in Paris - a man who calls "every thing 'odd' that is beyond his comprehension".
Lines of descent
Dupin is extraordinarily skilled in inferring the thoughts of others from the smallest external traces. He also has a loyal friend who narrates the stories and signals the proper responses to readers ("Dupin... I do not hesitate to say that I am amazed").
THE DUPIN STORIES
Dupin lives in seclusion
His sidekick is constantly amazed by deductions
Police portrayed as dull-witted
Poe calls detection ratiocination
The Murders in the Rue Morgue (1841) is tale of killing of woman and daughter in locked room
The Mystery of Marie Roget is based on details of real murder
The Purloined Letter is about missive used by blackmailer
Sounds familiar? Arthur Conan Doyle admitted that he used Poe's formula as a blueprint for Sherlock Holmes and Dr Watson. From Holmes, there are clear lines of descent to Dorothy L Sayers' Lord Peter Wimsey and Bunter, Margery Allingham's Albert Campion and Lugg, and of course to Agatha Christie's series protagonists.
One reason why the format has lasted is that it can so easily be adapted. Christie's Hercule Poirot is a Belgian designed to amuse English readers with his quaint foreign ways while he uses his ferociously efficient "little grey cells" to solve fictional murders.
She invented another variant in Miss Marple, the elderly spinster whose detective talents are rooted in her experience of village life.
Many of Dupin's descendants are either amateurs of crime or private detectives whose role sets them apart from official investigators. But some are found in the police force.
The clever criminal
Inspector Alleyn, created by Christie's contemporary Ngaio Marsh, is a case in point. Only nominally a policeman, he detects from choice rather than to earn a living.
In diluted form, this version of Dupin still flourishes today, most notably in PD James's Adam Dalgliesh and Colin Dexter's Inspector Morse. Recently the role of Dupin as a semi-independent investigator has been assumed by those with psychological expertise, such as James Patterson's Alex Cross and Val McDermid's Tony Hill.
The classic detective uses his powers because of the love of detection
One relatively recent development is what might be called the criminalisation of Dupin, an ingenious variant that gives his intellectually superior role to the criminal.
But the idea has been around for a while - as far back as 1899 Ernest William Hornung, Conan Doyle's brother-in-law, invented Raffles, a gentleman burglar who runs rings around the police.
Patricia Highsmith gave the idea a distinctive contemporary twist with her psychopathic anti-hero Tom Ripley. An even closer criminal parallel to Dupin can be found in the twisted psychology and almost superhuman powers of Thomas Harris' Hannibal Lecter. It's a shorter leap than at first appears from the Dupin stories to The Silence of the Lambs.
The Murders in the Rue Morgue is also the first locked-room mystery, an idea enormously fashionable among writers in the Golden Age of detective fiction.
In the second (and least successful) Dupin story, The Mystery of Marie Roget, Poe attempted to use his deductive skills in fictional form to solve a genuine murder in New York City, initiating the long-standing tendency of crime writers to look to real life for their raw material.
The third story, The Purloined Letter, is not a murder mystery but an elegantly-crafted puzzle whose solution has inspired generations of crime writers.
The Three Apples in 1001 Nights is story of woman's body found in locked chest in river
Bao Gong An mystery story dates from Ming Dynasty
ETA Hoffmann's Das Fraulein von Scuderi (1819) tells story of series of murders in Louis XIV-era Paris
Dupin is Poe's greatest legacy to crime fiction but not his only one. Another short story, The Gold-Bug, revolves around the deciphering of a code leading to buried treasure. Stevenson used both elements in Treasure Island.
Conan Doyle employed a similar device in The Dancing Men, and codes have featured in the genre ever since. The line stretches through John Buchan and Sayers to Dan Brown.
Poe's Thou Art the Man is a bizarre murder mystery whose interest derives not from its solution but from its use of forensic evidence (markings on a bullet prove to have come from a particular rifle).
Forensics have become an increasingly significant ingredient - witness the careers of Patricia Cornwell and Kathy Reichs. Poe himself was drawn to science. After all, it's the appliance of reason.
Stories of crime and punishment have enthralled people for thousands of years. But Poe knew that his "tales of ratiocination" were "something in a new key". Readers have always enjoyed pitting their analytical abilities against those of the brilliant detective.
Poe's influence on crime fiction does not stop there. He was also deeply interested in crime itself, and in his best fiction connects it with his deep-rooted obsessions with guilt and death.
The Black Cat, for example, is narrated by a man whose moral disintegration begins with his gouging out a cat's eye and culminates in the murder of his wife. The Tell-Tale Heart also has an unreliable narrator whose failing grasp of reality leads him to commit murder.
William Wilson, which draws heavily on Poe's schooldays in England, is yet another story that ends in murder - this time of the narrator's alter ego (doubling is a frequent motif in Poe).
In The Cask of Amontillado, the narrator walls up a friend in a catacomb and leaves him to die because of a real or imagined insult.
Criminal insanity, the mind of the murderer, unreliable narrators - these are familiar themes to readers of modern psychological thrillers, such as those of Ruth Rendell/Barbara Vine. But not just to them - few crime novelists today, from Ian Rankin to Sara Paretsky, are not fascinated by the intricacies of the criminal mentality.
Of course Poe is not the only nineteenth-century author to have staked a claim in this territory, but he is arguably the most influential.
Crime and detective fiction has other ancestors, including the hardboiled urban crime writing popularised by the pulp magazines and Noir cinema.
But there's no question that Poe's influence continues to run deep and wide. It has done so for more than 160 years, and it shows no signs of petering out.
Andrew Taylor is the author of The American Boy, inspired by Poe's childhood, as well as Bleeding Heart Square. He was awarded the 2009 Cartier Diamond Dagger by the Crime Writers' Association.