Skip to main content
Advertisement

Code Sharing Guidance

Data Availability Statement Examples

Below are some example statements that illustrate how you might wish to describe the location of the data and code in your manuscript.

Where code is shared:

The data and code files underlying the results of the study are available from the Github code repository (https://github.com/SindisoNyathi/California-Vaccine-Policy) and Figshare data repository (DOI: https://doi.org/10.6084/m9.figshare.9775496.v1).

All replication files (de-identified data and code) are deposited in Harvard Dataverse. The replication file for the paper is available via this link https://doi.org/10.7910/DVN/RFODZC.

The computer code for all simulations and data for the meta-analysis are publicly available (https://github.com/moyinNUHS/abxduration_abm).

Data used in this project cannot be publicly shared due to the terms of our license preclude us from sharing individual patient level data with third parties. Clinical Practice Research Datalink (CPRD) Aurum data used in this study was provided from the CPRD under a licence from UK Medicine and Healthcare products Regulatory Agency. Data from CPRD at the UK Medicine and Healthcare products Regulatory Agency is available subject to ethical approval, and can be requested using CPRD’s Research Data Governance process (https://www.cprd.com/data-access, all enquiries should be sent to: enquires@cprd.com). Programming code and code lists used in this study are available at: https://github.com/ParisBap/TTE_ONTARGET/.

Where code cannot be openly shared:

Data described in the manuscript, code book, and analytic code will be made available upon request pending application and approval. Researchers from public institutions can submit a collaboration request including information on the institution and a brief description of the project to collaboration@etude-nutrinet-sante.fr. All requests will be reviewed by the steering committee of the NutriNet-Santé study. If the collaboration request is accepted, a data access agreement will be necessary and appropriate authorizations from the competent administrative authorities may be needed. In accordance with existing regulations, no personal identification data will be accessible.

This research was conducted according to a framework collaboration agreement between the University of Oxford and the food retailers. Access to the study dataset by external researchers is not permitted as this is defined as confidential information in the agreement. Access to the study data by external researchers will require the expressed written consent of the retailer. Please contact hw@theconsumergoodsforum.com. Access to the statistical code used in this analysis will be reviewed and granted upon request by the Nuffield Department of Primary Care PRimDISC committee (primdisc@phc.ox.ac.uk).

Further Information and Support

When did this policy come into effect?

This policy was launched on 22 April 2026 and applies to all new manuscripts submitted to PLOS Medicine.

How does the code sharing policy on PLOS Medicine relate to the data and software sharing policies?

This policy complements the existing Data Sharing and Software Sharing policies. PLOS Medicine already requires that any underlying data that is needed to replicate the study' s findings should be made openly available and has previously noted an expectation for authors to make their code and software openly available. We now require all author-generated code directly related to their study’s findings to be made available. The Software Sharing policy is specifically for manuscripts describing new software.

Will the reviewers look at my code?

The code sharing policy does not change the way reviewers will assess your manuscript. If there are limitations on your ability to share the code, this should be outlined in the cover letter on initial submission and it will be subject to staff and/or editorial assessment. When code is shared, reviewers are encouraged to look at the code but are not required to include it in their review. We recommend that code central to the findings should be shared on submission either publicly or privately with the reviewers and editors for their assessment as necessary. It is the authors’ responsibility to ensure that the code is of sufficient quality.

My code has many dependencies and I think this will make sharing it meaningless. What do you suggest I do?

If you want to go further than describing your code’s dependencies, and render your code reusable for a longer period of time then you could consider using a container to package your code along with any dependencies in the environment it was created to run in. Examples of container technology are Code Ocean, Binder and Docker. You will need to ensure that any dependencies allow for redistribution in this way.

What license should I give my code?

You are free to choose whatever license you wish, although PLOS Medicine strongly recommends a license that supports open, reproducible research. If you chose to apply an open source license to your code and need help deciding on which license to use, you might find the Choose a Licence website useful. Please note, Creative Commons licenses are not recommended for code or software.

 

Before selecting a license for your code, be sure to take into consideration any third party obligations that may apply, for example: any license that may apply to third party code used by you (if applicable), the policies of your institution, funder and collaborators.

When should I share?

Your code must be publicly available at the time of publication of the article and available for peer review; however, it does not need to be publicly available at the peer review stage. Some repositories, such as Github, figshare or Code Ocean, will allow you to share your work with others privately. You should include private links in the cover letter.

What if I cannot provide a DOI for my code at submission?

If the code is uploaded to a repository that issues DOIs (or other permanent identifiers) only at publication, authors may submit their manuscript and include placeholder language in their Data Availability Statement indicating that the DOI/identifier will be made available after acceptance. The journal office will contact authors prior to publication to ask for this information and will hold the manuscript until it is received.

 

Providing private code access to reviewers and editors during the peer review process is acceptable. Many repositories permit private access for review purposes, and have policies for public release at publication.

How do I share my code well?

Your code should be well described and documented in order to facilitate others reusing it or running it. Repositories will usually require certain information to be entered when you submit your code but the more information you add the more useful your code becomes. Including a README file is regarded by many as a basic requirement to share alongside your code. You should ensure that you describe the environment in which your code should be run and any dependencies there are. You should also state the version of the code you are sharing and a link to live code so users can check for any updates. Including a LICENSE.txt file which specifies the copyright holder and terms under which others can use, modify and share your code is a good idea. Within your code, annotation is very important as it helps others understand what you are aiming to achieve. For more information on describing your code see The Software Sustainability Institute’s guide Software deposit: how to describe a software deposit.

Are there any guidelines on how to share research using machine learning or AI techniques?

Some community-derived guidelines do exist and some provide checklists as to what you should share. The following resources may be helpful:

How should I link my data to my code?

The location of both your data and code should be stated in your Data Availability Statement. In addition you can add information to both the data and code repository records detailing the associated article and other supporting outputs (data or code). If the repository does not have a dedicated field to add this information to, then you should cite the data or code using citation best practice guidelines.

Should my data and code be shared in the same place?

There is no requirement for your data and code to be in the same place. It is possible that they are more suited to different repositories and you should use domain specific repositories whenever possible.

 

I cannot share my data due to ethical/legal reasons. Do I still need to share my code?

Even if you cannot share your data, you should still share your code unless there are ethical/legal reasons that prevent you from sharing it. Where possible, you should share synthetic or dummy data that works with the code. Sharing the code, even if the full data is not available, aids transparency of your research. You may find this blog post about creating synthetic data useful.

My institution/funder/employer retains the IP of the code I produce. Can I publish in PLOS Medicine​?

If there are contractual obligations, local regulations, legal or ethical reasons why you cannot share code these should be shared with the journal who will assess whether it can be exempted from this policy. Please also check the policy of your institution/funder/employer carefully as some may make exceptions for sharing code or software for scientific advancement. PLOS Medicine does not require you to use a certain license and applying an “all rights reserved” license may satisfy your institutional/funder requirements. If you need to share your code with a specific license you should use a permanent repository that offers the correct licence as Supporting Information is not suitable.

What happens if I want to commercialise the code in the future?

This policy does not prohibit you from commercialising your code.

 

Further resources: 

 

External Link Disclaimer

PLOS includes external links in this policy as a convenience and for informational purposes only; they do not constitute an endorsement by PLOS of any of the products, information or opinions found on those links. Please contact the external site for answers to questions regarding its content.