#!/usr/bin/env bash set -e # 1. Capture the target path from the first argument TARGET_DIR=$1 if [ -z "$TARGET_DIR" ]; then echo "❌ Error: No path provided." echo "Usage: curl -s [URL] | bash -s -- path/to/my_project" exit 1 fi echo "🚀 Initializing nf-core style project at: $TARGET_DIR" # 2. Create the full directory structure mkdir -p "$TARGET_DIR/workflows" mkdir -p "$TARGET_DIR/modules"/{qc,alignment,sc,utils} mkdir -p "$TARGET_DIR/conf/data_params" mkdir -p "$TARGET_DIR/containers"/{docker,conda} mkdir -p "$TARGET_DIR/envs/venvs" mkdir -p "$TARGET_DIR/env_docs" mkdir -p "$TARGET_DIR/data"/{raw,processed,reference} mkdir -p "$TARGET_DIR/results/objects"/{anndata,seurat} mkdir -p "$TARGET_DIR/results"/{tables,figures,logs} # 3. Create placeholder files touch "$TARGET_DIR/workflows/main.nf" touch "$TARGET_DIR/conf/base.config" touch "$TARGET_DIR/README.md" touch "$TARGET_DIR/env_docs/README.md" # 4. Create the YAML Template (The only file you edit per run) cat < "$TARGET_DIR/conf/data_params/dataset_v1.yaml" # Single Cell Data Parameters input_path: "data/raw/*.h5ad" reference_path: "data/reference/genome.fa" outdir: "results" sample_id: "experiment_01" EOF # 5. Create .gitignore (To prevent uploading data/results to Git) cat < "$TARGET_DIR/.gitignore" # Nextflow temporary files .nextflow* work/ .nextflow.log* # Data and Results data/raw/* data/processed/* results/* # OS files .DS_Store EOF # 6. Create .dockerignore cat < "$TARGET_DIR/.dockerignore" .git .nextflow work/ data/ results/ EOF # 7. Create basic nextflow.config cat < "$TARGET_DIR/nextflow.config" params { input_path = "data/raw/*.h5ad" outdir = "results" } profiles { docker { docker.enabled = true } conda { conda.enabled = true } } includeConfig 'conf/base.config' EOF echo "---" echo "✅ Project successfully created at: $TARGET_DIR" echo "📂 To start: cd $TARGET_DIR && code ." echo "🧬 To run: nextflow run workflows/main.nf -params-file conf/data_params/dataset_v1.yaml"