I converted a number of large SeqArray (.gds) files into PLINK binary format, but when the .bed files were written to storage, it appears that many of them became truncated. I would like to salvage as much data as possible from these truncated files.
According to the documentation, based on the number of bytes in the truncated file, it should be possible to figure out how many variants the file contains. Snipping off any partial block at the end of the .bed file and truncating the .bim file to match the truncated .bed file should yield a set of PLINK binary files with the correct information for at least those variants.
Has anyone out there tried to salvage an incomplete .bed file like this? Does anyone have the code to do this? It would save a lot of effort if I could salvage data from these files, but I'm not confident in my ability to do it correctly on my own.
(I apologize for accepting my own solution. It feels as though it's in poor taste to do so.)
That is OK in this case. If @LChart's answer helped you get there then you could accept that answer as well.