Hi,
I have a channel like this:
[[sample_id:patient1_1, donor_id:patient1], patient1_1.vcf],
...
[[sample_id:patient1_11, donor_id:patient1], patient1_11.vcf],
[[sample_id:patient2_1, donor_id:patient2], patient2_1.vcf],
...
[[sample_id: patient2_11, donor_id: patient2], patient2_11.vcf]
I would like to be able to batch samples within donors into groups of 5, with remainders, so would hope to get an output something like this:
[[donor_id:patient1], [patient1_1.vcf,patient1_2.vcf,patient1_3.vcf,patient1_4.vcf,patient1_5.vcf]],
[[donor_id:patient1], [patient1_6.vcf,patient1_7.vcf,patient1_8.vcf,patient1_9.vcf,patient1_10.vcf]],
[[donor_id:patient1], [patient1_11.vcf]],
[[donor_id:patient2], [patient2_1.vcf,patient2_2.vcf,patient2_3.vcf,patient2_4.vcf,patient2_5.vcf]],
[[donor_id:patient2], [patient2_6.vcf,patient2_7.vcf,patient2_8.vcf,patient2_9.vcf,patient2_10.vcf]],
[[donor_id:patient2], [patient2_11.vcf]]
Any ideas? Thanks!