Assembly of protein tertiary structures from secondary structures using optimized potentials