reducing tree to subset which contain a unique path for genes