Merging partial sequences guided by a phylogenetic tree