Incorporating cell hierarchy to decipher the functional diversity of single cells