added function to calculate cross sample assembly