Tech news 2: Publishing code

reproducibility
R
package
technews
experience
Published

August 18, 2023

Disclaimer: this blog post is my opinion, at the time of writing, and might not reflect the opinion of my employer, or mine today.

I would like to talk a little bit about sharing and archiving code. And data, and figures. People want to see it when you publish and your future self does not want to look for the final version in a cascade of folders. And a tip for double-blind submission at the end!

Publishing code

To begin, let’s focus on the primary platform: GitHub. While the tendency may be to upload code only upon publication, consider the advantages of maintaining a GitHub repository from the project’s inception. Not only does this foster collaboration, but it also provides a comprehensive history, promoting transparency and enabling retrospective analysis of decisions made.

Archiving code

For a seamless archiving process, I recommend establishing a connection between GitHub and Zenodo. This integration automatically archives new versions of your repository whenever necessary. Particularly valuable for evolving data sets used across multiple publications, this approach streamlines the documentation process. Comprehensive instructions on setting up this connection can be found here

To elaborate briefly, the steps involve:

  1. Granting Zenodo access to your GitHub repositories within your Zenodo account.
  2. Creating a release on GitHub, e.g., “Version 1 - Metacommunity Surveys - Nature Article by Wubing Xu.”
  3. Zenodo will automatically archive the repository at the time of the release and assign a DOI for proper citation. A noteworthy bonus is the CITATION.cff file, ensuring accurate attribution to all contributors. Further information can be found in Github documentation and here is an example.

Should you opt for a more straightforward approach, consider utilizing Zenodo directly. This method entails uploading content and obtaining a DOI, allowing for future updates and simplified acknowledgment of collaborators.

While I’ve focused on Zenodo, please note that Figshare offers similar functionality and may be an alternative to explore.

Double blind review

When submitting a paper, if the editor asks you anonymised code, you can use Anonymous GitHub. This tool anonymizes your GitHub repository by replacing any identifying information, enabling you to share code anonymously with editors and reviewers during the submission process.

https://docs.github.com/en/repositories/archiving-a-github-repository/referencing-and-citing-content#repository

Conclusion

Efficient code sharing and archiving not only enhance collaboration but also ensure the integrity of our research efforts. By implementing these practices, we collectively contribute to the advancement of our field. Thank you for your attention, and let’s continue to empower each other through shared knowledge.

Best wishes,

Alban