Open erikyao opened 3 years ago
@erikyao Looks like post_download
or post_dump
might be the good place to add the md5 check for a data src like dbsnp:
see an example here from mychem: https://github.com/biothings/mychem.info/commit/79f704b4424036d06014798a2f143bcfab4617e8 and a small change https://github.com/biothings/mychem.info/commit/6fa89376efff4fb1886253f18f97d11d9e1b8889
Datasources in myvariant.io may contain large files to download (e.g.
dbsnp
release 155 has 380GB). Due to various reasons (like FTP connection issues), the download may be incomplete, leading errors during the uploading processes.Some of the datasource has MD5 checksum files available. It would be nice to download those
*.md5
files as well and validate the data files in thepost_dump
phrases.The validation in bash is quite straight forward. Each
.md5
file is essentially a tuple of(checksum, filename)
.md5sum -c
will read a.md5
file, re-calculate the checksum for thatfilename
and match it with the originchecksum
. E.g.It's also feasible in python with built-in
hashlib.md5()
. See Generating an MD5 checksum of a file. Performance of feeding file content tohashlib
should be taken into account before developing a MD5 helper class/function.