cliffgao的个人博客分享 http://blog.sciencenet.cn/u/cliffgao 兴趣:生物信息学、统计、概率

博文

开发计算生物学软件的建议

已有 2252 次阅读 2016-1-1 12:45 |个人分类:bioinformatics|系统分类:科研笔记

开发计算生物学软件的建议

Cliff Gao

本文是总结《Ten simple rules for effective computational research》十条建议。

参考文献:

Osborne JM, Bernabeu MO, Bruna M, Calderhead B, Cooper J, Dalchau N, et al.  (2014) Ten Simple Rules for Effective Computational Research. PLoS Comput Biol 10(3):        e1003506.        doi:10.1371/journal.pcbi.1003506

http://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1003506


1.做好前期准备。(Look before you leap).

在编写软件之前,先搜索一下是否有已经开发的软件包或者库。你可以上 GitHub https://github.com  或者  SourceForge http://sourceforge.net/  搜索。你也可以咨询你身边的同事,他们的经验和建议会加快你的工作。


常见的科学开发软件:

Matlab 你可以到 这个网址 http://www.mathworks.co.uk/matlabcentral/  下载或者寻找Matlab脚本。

Octave ( http://www.gnu.org/software/octave/   ) 是和Matlab类似的开源软件。Matlab的很多命令都可以在Octave上运行。


R 是开源的统计软件。


Python  在该软件的基础上安装 numpy ( http://www.numpy.org/  )  和scipy ( http://www.scipy.org/   )包可以使你的程序代码更加紧凑。 Matplotlib (  http://matplotlib.org  )是基于python的高质量做图包。

你可以到Python Package Index (http://pypi.python.org  ) 上搜索共享的ptyhon代码。


C++ 如果你使用C++编程,你可以参考:

Boost(http://www.boost.org/  )  提供大量的供科学计算的库。

PETSc (http://www.mcs.anl.gov/petsc/  )提供大规模矩阵计算的库。

 


2. 先开发一个简单版本。(Develop a prototype first)

将你的问题拆分为几个小问题。对每个小问题编写程序并检验你的结果。你可以使用高级语言例如 Matlab/Octave,R, Python 开发一个简单版本,然后再不断补充,完善。


3. 让你的代码方便别人理解。(Make your code understandable to others(and yourself))

变量的名字应该有意义,代码的格式应该一致,这些可以帮助别人或自己理解自己的代码。除了这些,你还应该写一个文档来说明这些程序的输入,输出,为什么这么做。

一个经验:如果你写了相同的代码两次,这些代码应该变成一个函数,子程序或者方法。

As a rule of thumb, if you write the same code twice, it should become a function, subroutine, or method.


可以自动产生帮助文档的工具

Doxygen (any language)  http://www.doxygen.org

Pydoc (Python): http://docs.python.rog/2/library/pydoc.html


4. 不要低估你工作的复杂度. (Don't underestimate the complexity of your task).

在编程程序的过程中,随时写一个类似 logbook的日志文件。你可以使用如Evernotde的跨平台工具来记录你执行的命令。这是你将来使你程序自动化的第一步。

一旦你做了相同的事情两遍,这时你应该考虑将它自动化。

A good rule to follow is "the rule of three": once you have had to do the same thing twice already, automate it.

一些脚本语言例如bash,和linux命令如awk,grep等,编译命令make等,如果你需要输入很多数学公式,可使用LaTex 输入。


5. 理解你的工作中涉及大的数学、数值的计算方法。  (Understand  the mathematical, numerical, and computational methods underpinning your work).

确保你的计算方法、模型是正确的。


6.使用图,一图抵千言.(Use pictures: they really are worth a thousand words).

除了R, pyplotlib,Matlab, 等做图软件,你也考虑这些开源软件, D3.js (http://d3js.org/ ) Processing ( http://processing.org   )  ParaView (http://www.paraview.org   )


7 版本控制. Version control everything.

两个常用的版本控制( Version controal systems, VCSs)  Subversion( http://subversion.apache.org ), Git (http://www.github.com ).  你可以将你的脚本存储到 Dropbox ( http://www.dropbox.com ) SkyDrive (http://www.skydrive.live.com ) Google Drive, Office 365.

   

8. 调试你所有的程序. (Test everything).

9. 分享你所有的程序.(Share everything).

10.坚持 (Keep Going).





https://wap.sciencenet.cn/blog-468005-947359.html

上一篇:大学时光摘录
下一篇:上课或听讲座
收藏 IP: 124.191.8.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-4-19 16:48

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部