Link Search Menu Expand Document

Why are structured directories important?

Now, let’s pretend that you store everything on your computer in one single folder – some of us are probably known to use our desktops for this. Imagine how long it would take you to find data you collected on a specific day a few years ago.

Instead of keeping every document in a single place, we often organize our files using directory or folder structures. This helps us save precious time and improve our productivity. Organizing folders can also help us collaborate more effectively by ensuring that everyone can find the files they need.

Looking for a cheat sheet? Check out our one-pager!


Table of contents


Directory Hierarchies

A typical directory structure is composed of a root directory (i.e. top-level folder), subdirectories (i.e. subfolders), and relevant files.

Usually, we separate data, analysis, and reports into stand-alone subdirectories under the project’s root directory. The structure looks like this:

├── Project-Folder/
|   ├── Experiment-Data/
|   |   ├── File-1
|   |   ├── File-2
|   ├── Experiment-Analysis/
|   |   ├── File-1
|   ├── Experiment-Report/
|   |   ├── File-1
|   |   ├── File-2

Directory names are frequently followed by a slash / to differentiate them from files.

Question

Which ones in this example are root directories? What about subdirectories?


README Files and Data Dictionaries

README files and Data Dictionaries - containing a brief description of the major folder contents, naming conventions, and data structure - are critical for transparency and reproducibility because they allow others to easily understand the contents of your directory and data without needing to ask the creator. This is especially helpful when working with a group or sharing directories with others.

Click here to review how to create a README file!

Two types of files needed to store all metadata

  1. _README file which resides in our root directory and elaborates on the contents of our folder structure, discusses how, where, and who did the data collection.
  2. _DATA-DICTIONARY file that resides in our data directory and elaborates on how our data variables are defined and described.

The stucture looks like this:

├── Project-Folder/
|   ├── _README.md                  <--
|   ├── Experiment-Data/
|   |   ├── _DATA-DICTIONARY.md     <--
|   |   ├── File-1
|   |   ├── File-2
|   ├── Experiment-Analysis/
|   |   ├── File-1
|   ├── Experiment-Report/
|   |   ├── File-1
|   |   ├── File-2


Naming

Readme files and data dictionaries should be the first things you look at when looking at any directory or folder, as this is your guide to its contents. Therefore these files should

  • Be prepended with an underscore “_”. This will push these files to the top of the directory for easy access;
  • Be in all caps, so they really stand out.

Format

Readme files and data dictionaries should be written in plain text, for this will ensure that the files describing your project can be opened on any computer. You will often see readme files called _README.txt or _README.md.


Exercise

Say you’re in BIOL 116 and you’re working on your research project. You have files that looked like the following before submitting our final assignment:

Pither_20210921_BIOL116RProject_ph-data.csv
Pither_20210922_BIOL116RProject_ph-data.csv
Pither_20210923_BIOL116RProject_ph-data.csv
Pither_20210924_BIOL116RProject_ph-data.csv
Pither_BIOL116RProject_Analysis_V0.xlsx
Pither_BIOL116RProject_Figure-freq-plot_V0.png
Pither_BIOL116RProject_Figure-linear-reg_V0.png
Pither_BIOL116RProject_Figure-linear-reg_V1.png
Pither_BIOL116RProject_Lab-report_V0.docx
Pither_BIOL116RProject_Lab-report_V1.docx
Pither_BIOL116RProject_Lab-report_V2.docx
Pither_BIOL116RProject_Lab-report_V3.docx

Let’s put them into structured folders! Please copy the template and use it for your exercise:

├── example/
|   ├── example/           
|   |   ├── example

Feel free to refer to the example that we saw earlier:

├── Project-Folder/
|   ├── _README.md                  
|   ├── Experiment-Data/
|   |   ├── _DATA-DICTIONARY.md            
|   |   ├── File-1
|   |   ├── File-2
|   ├── Experiment-Analysis/
|   |   ├── File-1
|   ├── Experiment-Report/
|   |   ├── File-1
|   |   ├── File-2


Congrats!

You know how to create structured directories for files now! Go ahead and organize your important personal or team files!



Sources


Need help?

Please reach out to research.data@ubc.ca for assistance with any of your research data questions.