Пример #1
0
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));
}
Пример #2
0
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));
}
Пример #3
0
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));
}
Пример #4
0
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));
}
Пример #5
0
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));
}