ENH: added (currently untested) function separating out sample metadata collapsing