bl_chrom_name_cmp(3)

NAME
bl_chrom_name_cmp() - Compare chromosome names numerically or lexically

LIBRARY
#include <biolibc/biostring.h>
-lbiolibc -lxtend

SYNOPSIS
int     bl_chrom_name_cmp(const char *name1, const char *name2)

ARGUMENTS
name1, name2    Names of two chroms

DESCRIPTION
Perform a numeric comparison of two chrom names. The names may contain a prefix of non-digits, such as "chr". Characters that follow must be a chrom number or letter. Numbers are considered less than letters (e.g. 22 < X). As such, if either is a letter, they are compared lexically. If both are numbers, they are converted to integers and compared numerically. Use bl_chrom_name_cmp() only if you need to know which string is < or >. If only checking for equality/inequality, strcmp() will be faster.

RETURN VALUES
A value < 1 if name1 is numerically < name2 A value > 1 if name1 is numerically > name2 0 if name1 == name2

SEE ALSO
strcmp(3)