Folding and misfolding of the prion protein in the secretory pathway