Guidelines for data analysis scripts
Unorganized heaps of analysis code are a growing liability as data analysis pipelines are getting longer and more complicated. This is worrying, as neuroscience papers are getting retracted due to programmer error. In this paper, some guidelines are presented that help keep analysis code well organized, easy to understand and convenient to work with: 
1. Each analysis step is one script 
2. A script either processes a single recording, or aggregates across recordings, never both 
3. One master script to run the entire analysis 
4. Save all intermediate results 
5. Visualize all intermediate results 
6. Each parameter and filename is defined only once 
7. Distinguish files that are part of the official pipeline from other scripts 
In addition to discussing the reasoning behind each guideline, an example analysis pipeline is presented as a case study to see how each guideline translates into code.