[论文解读] Computational reproducibility of Jupyter notebooks from biomedical publications
本研究通过使用声明的依赖项自动重新运行,评估了来自 PubMed Central 的 1,419 篇生物医学出版物中的 4,169 个 Jupyter 笔记本的计算可复现性。仅有 396 个笔记本在无错误的情况下执行成功,仅 245 个完全复现了原始结果,凸显了由于依赖项和环境问题导致的广泛可复现性挑战,对改进文档记录和将可复现性检查整合到同行评审流程中具有启示意义。
Jupyter notebooks allow to bundle executable code with its documentation and output in one interactive environment, and they represent a popular mechanism to document and share computational workflows, including for research publications. Here, we analyze the computational reproducibility of 9625 Jupyter notebooks from 1117 GitHub repositories associated with 1419 publications indexed in the biomedical literature repository PubMed Central. 8160 of these were written in Python, including 4169 that had their dependencies declared in standard requirement files and that we attempted to re-run automatically. For 2684 of these, all declared dependencies could be installed successfully, and we re-ran them to assess reproducibility. Of these, 396 notebooks ran through without any errors, including 245 that produced results identical to those reported in the original. Running the other notebooks resulted in exceptions. We zoom in on common problems and practices, highlight trends and discuss potential improvements to Jupyter-related workflows associated with biomedical publications.
研究动机与目标
- 评估与生物医学出版物一同共享的 Jupyter 笔记本在计算上的可复现性。
- 识别影响计算工作流可复现性的常见技术与文档问题。
- 评估依赖项声明、版本控制以及笔记本结构对可复现性的影响。
- 提出将可复现性检查整合到学术出版工作流程中的改进建议。
- 考察大规模自动化重新执行笔记本的计算环境影响。
提出的方法
- 从与 1,419 篇 PubMed Central 出版物相关的 1,117 个 GitHub 仓库中收集了 9,625 个 Jupyter 笔记本。
- 从其中筛选出 4,169 个带有标准依赖文件中声明依赖项的 Python 笔记本,用于自动化重新执行。
- 在隔离环境中自动安装依赖项并重新运行笔记本,以测试可复现性。
- 分析异常、依赖项声明、笔记本结构、命名方式以及模块使用情况。
- 利用版本控制元数据和出版日期,追踪笔记本实践随时间的变化趋势。
- 测量重新执行管道的计算环境影响。
实验结果
研究问题
- RQ1在生物医学出版物中,有多少比例的 Jupyter 笔记本能通过声明的依赖项成功重新执行?
- RQ2在生物医学 Jupyter 笔记本重新执行过程中,最常见的失败原因是什么?
- RQ3在生物医学研究中,Jupyter 笔记本的使用及其可复现性随时间如何演变?
- RQ4笔记本结构、命名方式和模块使用与可复现性成功之间存在多大程度的相关性?
- RQ5大规模自动化重新执行研究笔记本的环境与计算成本是多少?
主要发现
- 在 2,684 个可重新执行的笔记本中,仅有 396 个在无任何异常的情况下成功执行,成功率约为 14.7%。
- 在成功执行的笔记本中,仅有 245 个产生了与原始出版物中报告结果完全一致的结果,精确结果复现的成功率仅为 9.1%。
- 最常见的异常是 ModuleNotFoundError、ImportError 和 FileNotFoundError,且 2020–2021 年发表的笔记本失败率显著上升。
- 超过 80% 的分析笔记本使用 Python 编写,但仅有 4,169 个在标准依赖文件中声明了依赖项。
- 笔记本的命名和结构一致性较低,其中 16% 的笔记本标题中包含字符串 'test',表明测试代码与生产代码可能存在混淆。
- 重新执行 2,684 个笔记本的环境影响显著,估计产生 1,200 千克二氧化碳当量的排放,凸显了可复现性努力的可持续性成本。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。