  We study the algebraic rank of various classes of $\mathrm{CAT}(0)$ groups.
They include right-angled Coxeter groups, right-angled Artin groups, relatively
hyperbolic groups and groups acting geometrically on $\mathrm{CAT}(0)$ spaces
with isolated flats. As one of our corollaries, we obtain a new proof of a
result on commensurability of Coxeter groups
