void cdwValidatePng(char *path) /* Check png file is really png */ { // Signature from http://www.libpng.org/pub/png/spec/1.2/PNG-Structure.html static unsigned char pngSig[] = {137, 80, 78, 71, 13, 10, 26, 10, 0}; if (!fileStartsWith(path, (char*)pngSig)) errAbort("%s is not a valid .png file", fileNameOnly(path)); }
void cdwValidateTabixIndex(char *path) /* Check that a tabix index file (used for VCF files among other things) starts with right characters */ { if (!fileStartsWith(path, "TIDX")) errAbort("%s is not a valid TABIX index file", fileNameOnly(path)); }
void cdwValidateBamIndex(char *path) /* Check .bam.bai really is index. */ { if (!fileStartsWith(path, "BAI")) errAbort("%s is not a valid .bam.bai file", fileNameOnly(path)); }
void cdwValidateCram(char *path) /* Validate cram file. */ { if (!fileStartsWith(path, "CRAM")) errAbort("%s is not a valid .cram file, it does not start with CRAM", fileNameOnly(path)); }
void cdwValidatePdf(char *path) /* Make sure PDF really is PDF */ { if (!fileStartsWith(path, "%PDF")) errAbort("%s in not a valid .pdf file, it does not start with %%PDF", fileNameOnly(path)); }