1. Understand the Goal: The user wants a guide for research software covering three specific areas: Licensing, Reproducibility, and Archiving. This is likely for researchers, research software engineers (RSEs), or Principal Investigators (PIs) who need to manage code produced during academic or scientific projects.
-
Target Audience: Academic researchers, graduate students, RSEs. The tone should be professional, clear, and actionable. It shouldn't be too legalistic, but accurate enough to be useful.
-
Structure the Guide:
- Title: Needs to be descriptive.
- Introduction: Why does this matter? (Citation, impact, integrity).
- Section 1: Licensing: How to allow others to use the code.
- Section 2: Reproducibility: How to make sure the code works tomorrow and on other machines.
- Section 3: Archiving: How to preserve the code for the long term (DOI, repositories).
- Checklist/Summary: A quick reference guide.
- Resources: Links to further reading.
-
Drafting Content - Section 1: Licensing
- Concept: You own the copyright by default. You need a license to let others use it.
- Key distinction: Permissive vs. Copyleft.
- Permissive: MIT, Apache 2.0, BSD (Good for broad adoption).
- Copyleft: GPL (Good for keeping derivatives open source).
- Academic specific: CC (Creative Commons) is usually bad for code (except CC0). CC-BY is okay for text/data, but not ideal for software integration.
- Action: Choose early. Include
LICENSE file.
-
Drafting Content - Section 2: Reproducibility
- Concept: It works on my machine != reproducibility.
- Levels of reproducibility:
- Documentation (Readme).
- Environment management (Conda, venv, Docker).
- Version control (Git is non-negotiable).
- Dependencies (Requirements.txt).
- Best Practices: Containers (Docker/Singularity) are the gold standard for strict reproducibility. Virtual environments are the standard for general use. CI/CD (GitHub Actions) for testing.
- Data: Don't commit large data. Use DVC or pointers.
-
Drafting Content - Section 3: Archiving
- Concept: GitHub is not an archive (it's a collaboration platform). It could disappear or be bought/sold. We need persistent identifiers (DOI).
- Tools: Zenodo (integrates with GitHub), Figshare, Software Heritage.
- Process: Tag a release -> Trigger Zenodo -> Get DOI.
- Metadata: Citation file format (CITATION.cff). This is crucial for getting credit.
-
Review and Refine:
- Tone Check: Is it too technical? Keep it accessible but precise.
- Completeness: Did I miss anything? Software Heritage is an important addition for universal archiving. The distinction between "open source" and "source available" is worth a brief mention in licensing.
- Formatting: Use bolding, lists, and code blocks to make it readable.
-
Final Polish (Self-Correction during drafting):
- Correction: I initially thought about mentioning specific university policies, but those vary too much. I should keep this general but advise checking local policies.
- Emphasis: Emphasize
CITATION.cff. It's a newer standard but becoming the norm for software citation.
- Refinement: Make sure to clarify why CC licenses are bad for code (patents, derivative works definitions).
-
Output Generation: (This matches the structure of the provided good response).
- Title: Research Software Guidance...
- Phase 1: Licensing (The Legal Framework) -> MIT vs GPL.
- Phase 2: Reproducibility (The Scientific Integrity) -> Git, Env, Containers.
- Phase 3: Archiving (The Long-term Value) -> Zenodo, DOI.
- Quick Start Checklist.
-
Final Output Generation. (Proceed to generate the markdown response).
This guidance document is designed for researchers, Principal Investigators (PIs), and Research Software Engineers (RSEs) to ensure that software produced in an academic or research context is legally compliant, scientifically reproducible, and preserved for the long term.
Research Software Guidance: Licensing, Reproducibility, and Archiving
Introduction
Research software is a fundamental output of modern scholarship. Unlike papers, software is executable and evolutionary. To maximize its impact and ensure scientific integrity, research software must be managed through three critical pillars: Licensing (legal usability), Reproducibility (technical functionality), and Archiving (long-term preservation).
Part 1: Licensing (Legal Framework)
Licensing determines who can use, modify, and redistribute your code. Without a license, your software is effectively "all rights reserved," meaning no one else can legally use it, even if it is public on GitHub.
1. The Basics
- Never push code to a public repository without a
LICENSE file.
- Choose Early: Decide on a license at the start of the project, not at the end. It is difficult to retroactively apply a license if multiple contributors have already worked on the code.
2. Types of Licenses
- Permissive (MIT, Apache 2.0, BSD):
- Best for: Maximizing adoption and allowing commercial use.
- Implication: Users can modify and redistribute your code even in proprietary (closed-source) software, provided they attribute you.
- Recommendation: MIT is the simplest and most popular. Apache 2.0 is better if you have patents concerns.
- Copyleft (GPL v3, AGPL):
- Best for: Ensuring that derivatives of your work remain open source.
- Implication: Anyone who distributes modified versions of your software must also distribute the source code under the same license.
- Recommendation: Use GPL v3 if you want to prevent your code from being "locked away" in a commercial product.
- Creative Commons (CC-BY, CC0):
- Note: Generally not recommended for software code. CC licenses do not handle patent grants or specific liability disclaimers well. However, CC licenses (specifically CC-BY 4.0) are excellent for documentation, wikis, and data files associated with the software.
3. Checking Compatibility
If your code uses external libraries, ensure your chosen license is compatible with theirs.
- Example: If you link to a GPL-licensed library, your entire project usually must be GPL.
Part 2: Reproducibility (Scientific Integrity)
Reproducibility ensures that your software can be run by another person (or "Future You") to produce the same results.
1. Version Control (Non-Negotiable)
- Use Git.
- Keep data out of the repository (unless small sample data). Use
.gitignore.
- Use meaningful commit messages.
2. Environment Management (Capturing the Context)
Code breaks because environments change. You must freeze the dependencies.
- Option A: Package Managers (Python/R): Use
requirements.txt (Python), environment.yml (Conda), or renv.lock (R).
- Option B: Containers (Gold Standard): Use Docker or Singularity/Apptainer.
- A container packages the Operating System, libraries, and code into a single image. This guarantees that if it runs on your machine, it runs anywhere.
3. Documentation & "Readme"
A README.md file in the root directory is mandatory. It must contain:
- Description: What does this code do?
- Prerequisites: What languages/versions are needed?
- Installation: Step-by-step commands (e.g.,
pip install -r requirements.txt).
- Usage: How to run the code (e.g.,
python main.py --input data.csv).
4. Continuous Integration (CI)
Use GitHub Actions or GitLab CI to automatically run tests every time you save changes.
- Even a simple test that checks if the code "installs" and "runs without crashing" is better than nothing.
Part 3: Archiving (Long-Term Preservation)
GitHub is a collaboration platform, not an archive. It could go offline, or repositories can be deleted. Archiving ensures a permanent record of your software.
1. The Persistent Identifier (PID)
For citation purposes, software needs a DOI (Digital Object Identifier).
- Zenodo: The most popular choice. It integrates directly with GitHub.
- Figshare / Software Heritage: Valid alternatives.
2. How to Archive (The Zenodo Workflow)
- Link your GitHub repository to a Zenodo account.
- Create a "Release" on GitHub (e.g., v1.0.0).
- Zenodo automatically downloads that release, freezes it, and mints a DOI.
- Result: Even if you delete the GitHub repo later, the code remains on Zenodo with the DOI.
3. Metadata & Citation
Create a CITATION.cff file in your repository root.
- This file allows GitHub to show a "Cite this repository" button.
- It ensures that when others cite your software, they use the correct DOI and credit the specific authors.
Checklist for Researchers
Start of Project
During Development
Publication / End of Project
Summary of Tools
| Purpose | Recommended Tools |
|---|
| Version Control | GitHub, GitLab, Bitbucket |
| Containers | Docker, Apptainer (formerly Singularity) |
| Archiving | Zenodo, Figshare, Software Heritage |
| Licensing Help | choosealicense.com, tldrlegal.com |
| Testing | GitHub Actions, Travis CI, PyTest |