A justfile is a configuration file for the command runner tool just, which allows you to write commands in a structured and reusable way, similar to a Makefile. Below is a simple example of a justfile that defines some basic tasks you might perform when analyzing single-cell RNA-seq (scRNA-seq) data on Linux. This example assumes you have some tools installed, such as cellranger, fastqc, multiqc, and a generic scRNA-seq analysis package like Seurat in R.
justfile
# Define the default recipe
default:
@echo "Please choose a specific task to run."
# Quality control on raw reads using FastQC
fastqc INPUT_DIR="raw_data":
fastqc {{INPUT_DIR}}/*fastq.gz -o qc_results
# Aggregate FastQC reports using MultiQC
multiqc:
multiqc qc_results -o multiqc_report
# Run the cellranger count to generate gene expression matrices
cellranger_count SAMPLE_ID REFERENCE_GENOME INPUT_DIR OUTPUT_DIR:
cellranger count --id={{SAMPLE_ID}} \
--transcriptome={{REFERENCE_GENOME}} \
--fastqs={{INPUT_DIR}} \
--output-dir={{OUTPUT_DIR}} \
--localcores=`nproc` \
--localmem=`grep MemTotal /proc/meminfo | awk '{print int($2/1024/1.5)}'`
# Run Seurat for scRNA-seq data analysis
seurat_analysis INPUT_FILE OUTPUT_DIR SCRIPT_PATH="scripts/seurat_analysis.R":
Rscript {{SCRIPT_PATH}} {{INPUT_FILE}} {{OUTPUT_DIR}}
# Define variables with default values
REFERENCE_GENOME := "/path/to/reference/genome"
Please replace /path/to/reference/genome, scripts/seurat_analysis.R, and other placeholders with your actual file paths and parameters.
Here's how each command in the justfile works:
fastqc: Performs quality control checks on the raw sequencing data files located in the INPUT_DIR directory.
multiqc: Aggregates the FastQC reports into a single report using MultiQC.
cellranger_count: Processes the raw data using cellranger count to align reads, generate feature-barcode matrices, and perform clustering and gene expression analysis. Replace SAMPLE_ID, REFERENCE_GENOME, INPUT_DIR, and OUTPUT_DIR with your specific values.
seurat_analysis: Runs an R script for scRNA-seq data analysis using Seurat. This script should be prepared in advance and located at the path specified by SCRIPT_PATH. It should take INPUT_FILE and OUTPUT_DIR as inputs.
To run a task with just, you would enter the command just <task-name> in your terminal. For example, to run quality control, you would type just fastqc INPUT_DIR="path/to/your/raw/data".
Remember that this justfile is a template and should be customized based on the specific tools and analysis pipelines you intend to use, as well as the directory structure of your project. The specific parameters and analysis steps can vary widely depending on the experimental design, sequencing platform, and research questions.