R script to merge all chromosomes