Not sure if a sorted pair file is still required by pairix but I suggest to change the original sort -k2,2 -k4,4 -k3,3n -k5,5n ${prefix}_contacts.pairs | bgzip -c > ${prefix}_contacts.pairs.gz to the following to avoid segmentation fault when dealing with extremely large pair files (>50G).
https://github.com/nf-core/hic/blob/fe4ac656317d24c37e81e7940a526ed9ea812f8e/modules/local/hicpro/hicpro2pairs.nf#L23
Not sure if a sorted pair file is still required by pairix but I suggest to change the original
sort -k2,2 -k4,4 -k3,3n -k5,5n ${prefix}_contacts.pairs | bgzip -c > ${prefix}_contacts.pairs.gz
to the following to avoid segmentation fault when dealing with extremely large pair files (>50G).