modified purge pipeline for ibd clustering