Just saw this. Thanks very much Ian. Yes it did seem bizarre, and fortunately it hasn't occurred on my laptop, where I also loaded Affinity. But something strange has undoubtedly happened. Besides showing the Affinity icon, the files are described by Windows Explorer as "Type: Affinity Photo file". That may only have meant that AP had become the default programme for opening them, as you say. I've now acted on suggestion, and set LR as default for this type of file. LR now wants to add them to the catalogue, which I take to mean it wants to reconnect with them. It's going to be laborious but my guess is that it will work, so thanks again. I'll post to confirm when/if it's sorted out.
I bought Affinity Photo in December as an additional external editor for Lightroom (alongside Elements 2018 XXL). I have used it a few times so far and found it helpful for certain processes on TIFF files. However, I noticed recently that all of my RAW files (nearly 50,000) had mysteriously been converted from Nikon format to Affinity Photo files. I did not see this as significant until I started to have problems with Lightroom (versions 5 and 6 with slightly different catalogues in each). I did not realise the cause of the Lightroom problems at first. After Lightroom 5 crashed completely I reinstalled it and deleted the previews. It now works up to a point but cannot read the RAW files. Lightroom 6, also reinstalled, is stuck in a mode of partial reading of the RAW files, but cannot read them properly. I have no idea how Affinity took over all my RAWs but I would like to know how to recover them, i.e. convert them back to their original format.