Q&A 1 How do you create a GWAS project directory ready for analysis?
1.1 Explanation
Before working with data, itβs important to set up a clean and organized project directory. A consistent folder structure helps you manage scripts, datasets, and outputs across both Python and R β making your work easier to follow and share.
In this guide, weβll create a root directory called gwas-data-science with four folders:
data/β for datasets
scripts/β for code files
images/β for plots and charts
library/β for reusable functions
Example Folder Structure:
gwas-data-science/
βββ data/
βββ scripts/
βββ images/
βββ library/
1.4 R Code
Hereβs how to do it in R:
folders <- c("data", "scripts", "images", "library")
root <- "gwas-data-science"
if (!dir.exists(root)) dir.create(root)
for (folder in folders) {
dir.create(file.path(root, folder), showWarnings = FALSE)
}
cat("Created", root, "project folder with subdirectories.\n")β A clean project directory helps you stay organized, reuse code, and avoid errors β itβs the first step toward reproducible, professional data science.