Examples of figurative language used in popular science writing:
"…the human genome…was invaded by foreign DNA elements, which then multiplied hugely in number, finally becoming stable integral parts of our genetic heritage. These foreign elements act as a kind of fossil record in our genome, which can be compared with the records from other species.
…
When the draft human genome sequence was released, it was astonishing to realise just how widely these genetic interlopers have spread through our DNA."
Nessa Carey (2015) Junk DNA. A journey through the dark matter of the genome. London: Icon Books Ltd.
"A kind of fossil record" is a simile as the comparison is marked.
Read about examples of science similes
As commonly happens with similes, the subsequent reference to 'the records' is not marked and so would of itself be a metaphor without this context.
The notion of DNA elements invading the human genome reflects the common metaphorical military language used about infection (read 'Disease and immunity – a biological myth'). Seeing these DNA elements as 'foreign' and 'interlopers' reflects a particular perspective on the evolution of the genome that sees certain elements as properly part of our inheritance and others as in some sense improper. (This is a bit like seeing people whose ancestors invaded your country from some foreign countries as proper citizens but those ancestors arrived peacefully more recently as not belonging.) Clearly a different perspective is possible that sees extant human genomes as having a complex development drawing on multiple sources that are all seen as contributing.
There is a parallel in this use of language with the way early Homo sapiens may be described as human ancestors when other hominids which successfully bred with them (Neanderthals, for example) and so are the source of some elements of modern human genomes, are not described as our ancestors! (Read 'Can ancestors be illegitimate?'). This is a bit like crossing your great-great grandfather off the family tree because your great-great grandmother married beneath herself!