A framework to quantify phenotypic and genotypic parallel evolution