The function of a protein is determined by its shape. The shape of a protein is determined by its primary structure (sequence of amino acids). The sequence of amino acids in a protein is determined by the sequence of nucleotides in the gene (DNA) encoding it.