For superscript citations like Nature citation style I prefer to put the citation outside the punctuation (at least with a period...less sure about comma). This guide suggests always to put outside period or comma: https://libguides.usc.edu/c.php?g=293795&p=1956824
Nature Methods doesn't appear to have any specific guidance about this, however.
As noted by @jaclyn-taroni we are using different placements of punctuation vs citations (https://github.com/jaybee84/ml-in-rd/pull/137#discussion_r552009917) - need to pick one approach and make manuscript uniform.