Hi, Angela. We have stated in the "Provisional Guidance for Chemistry Notation Using Nemeth in UEB Contexts" that when chemical abbreviations appear in narrative context, code switching is unnecessary. Even though a functional group is technically not an "abbreviation", chemical groups fall in this category. We neglected to make that distinction in the Provisional Guidance. A switch to Nemeth Code is necessary only when technical symbols are associated with the letter or if typeform is other than regular or italic. So go ahead and transcribe A, C, T, and G in UEB.
Regarding the graphic, I confirmed with my chemistry experts (it helps to have one of those when you are working on a chemistry book!) that the "P" in the graphic represents a phosphate group, not the element SYMBOL for phosphorus (likewise, the "S" represents a sugar group, not the element SYMBOL for sulfur) which means that you do not need to switch to Nemeth Code for the graphic. However, do note that since the letters in the diagram are not labels they will each require a UEB grade-1 indicator unless you set grade-1 mode for the diagram. I recommend that option, to keep the diagram uncluttered.
Thank you for your important question.
Lindy