Efficient merging of data from multiple samples for determination of anomalous substructure