Load Nextflow
Walks through running nf-core/hic for Hi-C analysis on MSU HPCC, including sample sheets, config, and SLURM submission.
What this file does
Walks through running nf-core/hic for Hi-C analysis on MSU HPCC, including sample sheets, config, and SLURM submission.
When to use it
- You need to run nf-core/hic on an HPC with SLURM scheduler
- You are new to Hi-C analysis and want a step-by-step guide
- You want to use Singularity containers with Nextflow on MSU HPCC
Assumes this stack
layout: post title: "Hi-C Analysis Using nf-core/hic and nf-core/differentialabundance on MSU HPCC" date: 2025-06-17 author: John Vusich, Leah Terrian, Nicholas Panchy categories: jekyll update
Overview
This guide will show you, step by step, how to analyze Hi-C data using the nf-core/hic pipeline for quality control, alignment, creating contact maps, and calling TADs and compartments.
Key Benefits
- Reproducibility: Community-curated workflows ensure standardized analysis.
- Portability: Run seamlessly on various infrastructures.
- Scalability: Handles datasets of different sizes efficiently.
Prerequisites
- Access to MSU HPCC with a valid ICER account.
- Basic familiarity with the command line.
Note on Directory Variables
On the MSU HPCC:
$HOMErefers to the user’s home directory (/mnt/home/username).$SCRATCHrefers to the user’s scratch directory, ideal for temporary files and large data processing.
Note on Working Directory
The working directory, where intermediate and temporary files are stored, can be specified using the -w flag when running the pipeline. This helps keep outputs and temporary data organized.
Step-by-Step Tutorial
Part 1: Pre-processing with nf-core/hic
1. Create a Project Directory
Make a new folder for your Hi-C analysis:
mkdir $HOME/hic
cd $HOME/hic
This command creates the directory and moves you into it.
2. Prepare a Sample Sheet
You need to create a file called samplesheet.csv that lists your samples and their FASTQ file paths. Use a text editor (like nano) to create this file:
nano samplesheet.csv
Then, add your sample information in CSV format. For example:
sample,fastq_1,fastq_2
CONTROL_REP1,/path/to/CONTROL_REP1_R1.fastq.gz,/path/to/CONTROL_REP1_R2.fastq.gz
CONTROL_REP2,/path/to/CONTROL_REP2_R1.fastq.gz,/path/to/CONTROL_REP2_R2.fastq.gz
TREATMENT_REP1,/path/to/TREATMENT_REP1_R1.fastq.gz,/path/to/TREATMENT_REP1_R2.fastq.gz
TREATMENT_REP2,/path/to/TREATMENT_REP2_R1.fastq.gz,/path/to/TREATMENT_REP2_R2.fastq.gz
Save the file (in nano, press Ctrl+O then Ctrl+X to exit).
3. Create a Configuration File
Do not type file content directly into the terminal. Use a text editor instead. Create a file named icer.config:
nano icer.config
Paste the following content into the file:
process {
executor = 'slurm'
}
Save and exit the editor.
4. Prepare the Job Submission Script
Now, create a shell script to run the pipeline. Create a file called run_hic.sh:
nano run_hic.sh
Paste in the following script:
#!/bin/bash --login
#SBATCH --job-name=hic
#SBATCH --time=24:00:00
#SBATCH --mem=4GB
#SBATCH --cpus-per-task=1
#SBATCH --output=hic-%j.out
# Load Nextflow
module purge
module load Nextflow
# Set the paths to the genome files
GENOME_DIR="/mnt/research/common-data/Bio/genomes/Ensembl_GRCm39_mm39" #Example GRCm39
FASTA="$GENOME_DIR/genome.fa" # Example FASTA
# Define the samplesheet, outdir, workdir, and config
SAMPLESHEET="$HOME/hic/samplesheet.csv" # Example path to sample sheet
OUTDIR="$HOME/hic/results" # Example path to results directory
WORKDIR="$SCRATCH/hic/work" # Example path to work directory
CONFIG="$HOME/hic/icer.config" # Example path to icer.config file
# Run the Hi-C analysis
nextflow pull nf-core/hic
nextflow run nf-core/hic -r 2.1.0 -profile singularity -work-dir $WORKDIR -resume \
--input $SAMPLESHEET \
--outdir $OUTDIR \
--fasta $FASTA \
-c $CONFIG
Make edits as needed. Save and close the file.
Hi-C Use case specific parameters
Hi-C digestion protocol:
nextflow run nf-core/hic --input $SAMPLESHEET --outdir $OUTDIR --fasta $FASTA --digestion 'dnpii'
--digestion automatically sets the --restriction_site and --ligation_site parameter according to the restriction enzyme you used. Available keywords are ‘hindiii’, ‘dpnii’, ‘mboi’, ‘arima’.
DNase Hi-C protocol:
nextflow run nf-core/hic --input $SAMPLESHEET --outdir $OUTDIR --fasta $FASTA --dnase --min_cis_dist 1000
Using --dnase mode, all options related to digestion Hi-C are ignored. Using the --min_cis_dist parameter is recommended to remove spurious ligation products.
5. Submit Your Job
Submit your job to SLURM by typing:
sbatch run_hic.sh
This sends your job to the scheduler on the HPCC.
6. Monitor Your Job
Check the status of your job with:
squeue -u $USER
After completion, your output files will be in the results folder inside your hic directory.
Quick Reminders
- Never type file content into the terminal. Always create or edit files using a text editor (like nano).
- Follow each step carefully.
- Visit the
nf-core/hicornf-core/differentialabundancewebpage for more detailed instructions and use cases.
Getting Help
If you encounter issues running nf-core/hic on the HPCC, consider these resources:
- nf-core Community: Visit the nf-core website for documentation and support.
- ICER Support: Contact ICER via the MSU ICER support page.
- Slack Channel: Join the nf-core Slack for real-time assistance.
- Nextflow Documentation: See the Nextflow documentation for further details.
Conclusion
Using nf-core/hic and nf-core/differentialabundance on the MSU HPCC simplifies the process of Hi-C analysis, including QC, alignment, quantification, and downstream analysis. The combination of Singularity and Nextflow ensures a reproducible and efficient workflow tailored for high-performance computing environments.
What's inside
6 numbered steps, 2 protocol variants, 3 code blocks, 1 job script, 1 config file
Change this for your project
- Replace
$HOME/hicwith your project directory - Replace
/mnt/research/common-data/Bio/genomes/Ensembl_GRCm39_mm39with your genome path - Replace
$SCRATCH/hic/workwith your scratch work directory - Replace
nf-core/hic -r 2.1.0with the pipeline version you want
Where it goes
Keep it in your repository where the agent or team that needs it will read it.
Worth borrowing
- Using a separate config file (
icer.config) to set the executor avoids hardcoding SLURM in the pipeline command - Pulling the pipeline with
nextflow pullbefore running ensures you have the exact version cached
Related Documents
SVI 2.0
Documents the SVI LoRA family for WanVideo I2V, covering version history, usage patterns, known limitations, and community workflows.
第一章 模型预处理
> 译者:[muxuezi](https://muxuezi.github.io/posts/1-premodel-workflow.html)
TVM: An Automated End-to-End Optimizing Compiler for Deep Learning
Describes TVM, a compiler that optimizes deep learning models for diverse hardware back-ends using graph-level and operator-level transformations.
Content Workflow
Defines a 6-stage content production pipeline with automated quality scoring and self-healing gates that enforce an 8.0 minimum score across four dimensions.