Giter Club home page Giter Club logo

guidelines's People

Contributors

brunograndephd avatar

Watchers

 avatar  avatar  avatar  avatar

guidelines's Issues

Testing

TTD
Add new tests when edge cases or bugs are found

Set the seed whenever you rely on a random number generator

Short Description

Set and report the seed for random number generators.

Rationale

Obviously, random number generators can hinder reproducibility, but their usage is sometimes necessary (e.g. in simulations and sub-sampling). An easy workaround is to set the seed for random number generators such that their output is "predictably random". This aids with the reproducibility of analyses, but also with debugging. Hence, whenever you're using a program that allows you to set the seed for a random number generator, set it to some value (see below for an example of how to generate such a value). If you're writing your own script that relies on a random number generator, provide a parameter for setting the seed and set it to some value when you run the script. It's also important to report the seed you use in the methods such that others can reproduce your analysis.

Example Implementations

In Python, use random.seed() whenever you import the random module. In R, use set.seed() whenever you rely on simulations or other computations involving random numbers. Karl Broman suggests to obtain a large random integer using runif(1, 0, 10^8) and use that as your seed, so that your seed incorporates some element of randomness as well. In other words, don't always set your seed to 42.

Sources

http://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1003285#s7

https://biowize.wordpress.com/2015/08/05/reproducible-software-behavior-with-random-seeds/

http://kbroman.org/knitr_knutshell/pages/reproducible.html

Software versions

Short Description

Track the versions of software you install and use, and report software versions in methods.

Rationale

A major difficulty in reproducing published results is that authors don't often report the versions of software they used in their analyses (source). Therefore, you should report software versions when you write the methods of any manuscript involving computation. However, it isn't trivial to collect the versions of every software used.

Example Implementations

You can organize your software installation directory by software and then by version number. This way, any absolute paths to software binaries or scripts will include the version number. It allows easily allows multiple versions of the software to co-exist.

.
├── anaconda
│   ├── 2.3.0
│   └── 4.1.0
├── aspera_connect
│   └── 3.6.0.106805
├── bamhash
│   └── 1.0
├── bamUtil
│   └── 1.0.13
├── bcftools
│   └── 1.2
├── bedops
│   └── 2.4.19
├── bedtools
│   └── 2.25.0
[...]

Parameterize any arbitrarily chosen number

Short Description

Parameterize (semi-)arbitrarily chosen numbers, and explain how the default value was chosen and the use case they're intended for.

Rationale

Scripts commonly use thresholds, cut-offs or other (semi-)arbitrarily chosen numbers. The value of these variables typically have a significant effect on the script's output and thus they should be discoverable by the user. Parameterizing these variables is a straightforward way for exposing them to the user. Otherwise, they are concealed within the script. This also allows the user to easily edit the values according to their needs. The default value for these variables should be explained whenever possible; it's important to describe how they were obtained and the use case they're intended for. This helps the user determine whether the default is appropriate for their specific use case.

Sources

http://www.jonzelner.net/statistics/make/docker/reproducibility/2016/05/31/script-is-a-program#command-line-options

Example Implementations

If your code consists of modular functions, every (semi-)arbitrarily chosen number should become a parameter for the function that contains it. In the case of a script, these parameters should all be made user-adjustable as command-line arguments. If default values are provided, explain how they were obtained and what use case they're intended for in the script's self-documentation (e.g. docstrings in Python) and/or associated README.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.