Folding of the polypeptide chain during biosynthesis.