View on GitHub

Data for Data Science

fredhutch.io's four-class series on data management and organization

Data for Data Science

Class 2: Organizing data and project files

By the end of this class, you should be able to:

What are “data”? What is a “dataset”?

What goes in a single cell? How to organize data in a spreadsheet? How to standardize data files? How to organize collections of related files for a single project?

Good Enough Practices in Scientific Computing

Project Organization: Overview

|-- CITATION.txt (how to reference project)
|-- README.txt	(overview of project)
|-- LICENSE.txt	(how project/code can be used)
|-- data/
|-- doc/
|-- results/
|-- analysis/

Put each project in its own directory, which is named after the project. Divide work into projects based on overlap of data and code. The examples presented here are for a generic analysis that isn’t based in code. Modified from Good Enough Practices For this presentation, files have a suffix, folders end in /

Project Organization: Documentation

|-- doc/
|	|-- notebook.txt (electronic lab notebook)
|	|-- manuscript.doc (manuscript draft)

Put text documents associated with the project in the doc directory. If you use other software or tools for these tasks, it would be useful to describe that here. Modified from Good Enough Practices

Project Organization: Raw data

|-- data/
|	|-- original_data.xlsx (raw data, before tidying)
|	|-- data.csv (raw data, with tidy data principles applied)
|	|-- README.txt (metadata, or information about data)

Put raw data and metadata in a data directory (we’ll spend the next class session talking more about metadata!) Modified from Good Enough Practices

Project Organization: Results

|-- results/
|	|-- filtered_data.csv
|	|-- summarized_results.csv
|-- figures/
|	|-- scatterplot.csv

Put files generated during cleanup and analysis in a results directory. A separate figures directory may also be useful. Modified from Good Enough Practices

Project Organization: Genomics

|-- results/
|	|-- QC_sequences/
|	|-- assembly/
|	|-- variant_analysis/

For projects that have many intermediate steps, your results directory may be separated into additional folders Modified from Good Enough Practices

Project Organization: Analysis

|-- analysis/
|	|-- Sept_analysis.xlsx

Put files used for data analysis and creating figures in analysis This may include files created from analysis programs, like Tableau, Geneious, etc. Modified from Good Enough Practices

Project Organization: Analysis

|-- bin/
|	|-- labmates_script.R
|-- src/
|	|-- data_analysis.R

If you are writing code for analysis, it is more appropriate to separate files into:

Modified from Good Enough Practices

Project Organization: Naming files and folders

|-- raw_data/
|	|-- insulin_experiment_2017.csv
|-- figures/
|	|-- clinical_scatterplot.jpg

Why do names matter?

Project Organization Summary Put each project in its own directory, which is named after the project. Include license, citation, and README documents for the project Put text documents associated with the project in the doc directory. Put raw data and metadata in a data directory and files generated during cleanup and analysis in a results directory. Put files associated with analysis or creating figures in the analysis directory. Name all files to reflect their content or function.

These guidelines may vary based on the lab, project, or organization! Modified from Good Enough Practices

Project organization activity

Reorganize the files in sample_project such that: Files are named consistently with no special characters Files are separated into relevant folders A file called README describes the basic file structure

What are some challenges associated with organizing data files for a project?

What are “big data”?

What is a project? Challenges: Data may be used across multiple projects with different collaborators Long-term projects may have intermediate and longitudinal analysis Solutions: Focus on specific deliverables (publications, reports, etc) Develop workflows that allow standardization, not necessarily total synchronization

How to store/access data files? Challenges Big data: Many data files: hundreds or thousands Large data files: MB, GB, TB? Files with different data types: genomic, clinical, simulations, statistical output Data security: balancing protection of sensitive information with allowing access to researchers Data transfer: maintaining data integrity while publishing, sharing, and archiving data

How to store/access data files? Solutions

Solutions: Organize data into projects and otherwise plan for long term, team-based approaches Fred Hutch Data Science Wiki: Data Storage section describes available resources Office hours available for various groups at Fred Hutch who can help provide recommendations

“Legacy” issues with data Challenges: You may “inherit” data from coworkers/collaborators Long-term studies may have suboptimal, unscalable strategies Solutions: If a project is nearing completion, it may not be worth adjusting strategies and you should focus on what is necessary for publication/archival Identify a natural point of transition (if possible), and document how management has changed

Reproducibility and transferability are big data management challenges! Reproducibility: obtaining the same results multiple times Confirm previously published scientific results Automate large-scale data analysis projects Transferability: using data multiple times Among researchers Among research questions

Challenges with the data life cycle

We tend to be most concerned about data collection and analysis. Best practices in data management help facilitate other steps in this process as well! Primer on Data Management

Wrapping up

Applying best practices for project management can help streamline the process of analyzing and reporting your data Plan ahead to help both yourself and other people who may need to use the data later Every project is different, and may require specific practices to suit its needs

Next time: documenting data with metadata

For more information, please see: