Organizing Directories

Organizing Directories

For each new project you will usually want to have a separate dedicated folder to contain all major code scripts and output data related to that project. Even if you are re-using scripts that are already located in another project’s folder, consider copying that code over into your new project folder, instead of reading it from another location.

Why?

The guiding principle should be that you want to be able to run your whole project’s code (barring any software you have to download) using the scripts that are located within that project folder. That way, if you ever have to move your project files to another computer, you won’t be missing any scripts on which you’re dependent.

So once you’ve made a new project folder, for example by using the mkdir command in the terminal

mkdir NewProject

you’ll want to navigate into that folder (cd NewProject) and create subdirectories to house specific file types.

Good habits

Two good starting folders to have are a src folder and a results folder. An src folder (derived from “source”), should house all the core scripts necessary for your project. So all novel R scripts, Python code, Perl pipelines you’ve dredged up, etc. would be housed here. The results folder would house all output files generated by scripts in src.

Depending on the project, you’ll want to have a data folder to keep the raw data sets that you yourself did not generate with the scripts in src.

README File

Finally, you’ll want to create a simple text README file that explicitly states what subdirectories you have in your project folder, and what they should contain. Ideally you should have a README file in each directory that states what files it contains.

A README file written in markdown could look like this:

# Files for New Project by Student McGee and PI ForFree, Year Month(s)

Short description of New Project

## Description of each folder or file and the data contained within:
  src - What scripts are here?
  results - What kind of result files are here?
  data - What sort of data?

In all, a practical project directory can look like:

    • README.md
      • README.md
      • README.md
      • README.md