15080c151c9929733fa2af71ce5dc98533c4f913 galt Fri Mar 20 18:45:40 2026 -0700 The error messages are more detailed to help users, something MarkD wanted. It aborts by default if chromStart or chromEnd are greater than chromSize, unless the user has specified -skipChromCheck which skips both chrom name and chrom size checks now. Fixes issues with undetected overflowing integers issues, warns when they are too large instead of silently failing. Expanded the all the coordinates in the utils and the lib so that they use full range of unsigned integer space when querying and using GB for chromStart and chromEnd coordinates used by BED standard and supported by .2bit chroms. Fixed minor overflow issue with bigBed.c going past the end of the 4GB space. I made changes to bigBedToBed.c and then used CLAUDE prompt to refactor those changes into the 6 other utilities bigMafToMaf, bigChainToChain, bigGenePredToGenePred, bigPslToPsl, bigWigToBedGraph, bigWigToWig. refs #28109 diff --git src/inc/bigBedCmdSupport.h src/inc/bigBedCmdSupport.h index 42838f51125..595008de6b8 100644 --- src/inc/bigBedCmdSupport.h +++ src/inc/bigBedCmdSupport.h @@ -1,43 +1,43 @@ /* bigBedCmdSupport - functions to support writing bigBed related commands. */ /* Copyright (C) 2022 The Regents of the University of California * See kent/LICENSE or http://genome.ucsc.edu/license/ for licensing information. */ #ifndef bigBedCmdSupport_h #define bigBedCmdSupport_h #include "bigBed.h" void bigBedCmdOutputHeader(struct bbiFile *bbi, FILE *f); /* output a autoSql-style header from the autoSql in the file */ void bigBedCmdOutputTsvHeader(struct bbiFile *bbi, FILE *f); /* output a TSV-style header from the autoSql in the file */ struct hash *makeChromHash(struct bbiChromInfo *chromList); /* make a fast searchable hash from chromList */ struct bed *bed3FromPositions(char *fileName); /* Read positions file and retrun bed 3 list. */ void genericBigToNonBigFromBed(struct bbiFile *bbi, struct hash *chromHash, char *bedFileName, FILE *outFile, - void (*processChromChunk)(struct bbiFile *bbi, char *chrom, int start, int end, char *bedName, FILE *f) + void (*processChromChunk)(struct bbiFile *bbi, char *chrom, uint start, uint end, char *bedName, FILE *f) ); /* Read list of ranges from bed file chrom start end. * Automatically sort them by chrom, start */ void genericBigToNonBigFromRange(struct bbiFile *bbi, struct hash *chromHash, FILE *outFile, struct slName *ranges, - void (*processChromChunk)(struct bbiFile *bbi, char *chrom, int start, int end, char *bedName, FILE *f) + void (*processChromChunk)(struct bbiFile *bbi, char *chrom, uint start, uint end, char *bedName, FILE *f) ); /* Read list of ranges from commandline option as chrom start end or chrom:start-end. * Supports multiple -range options. * Automatically sort them by chrom, start. */ void genericBigToNonBigFromPos(struct bbiFile *bbi, struct hash *chromHash, char *posFileName, FILE *outFile, - void (*processChromChunk)(struct bbiFile *bbi, char *chrom, int start, int end, char *bedName, FILE *f) + void (*processChromChunk)(struct bbiFile *bbi, char *chrom, uint start, uint end, char *bedName, FILE *f) ); /* Read positions from file (chrom:start-end). starts are 1-based, * but after conversion to bed3 list, they are 0-based. * Automatically sort them by chrom, start */ #endif