Skip to content

robomics/compress-nfcore-hic-output

Repository files navigation

Nextflow workflow to compress nf-core/hic output


License License
Nextflow Nextflow version
DOI Zenodo DOI
CI CI Status

This repository hosts a Nextflow workflow to compress the output produced by nf-core/hic v2+.

Requirements

Software requirements

  • Nextflow (at least version: v25.04. Pipeline was developed using v25.04.6)
  • Docker or Apptainer/Singularity

Required input files

The workflow requires two inputs:

  1. The output folder produced by nf-core/hic
  2. The reference genome used for mapping by nf-core/hic

You can download an example dataset to test the pipeline from doi.org/10.5281/zenodo.16083810:

# Make sure you have curl and zstd available in your PATH
user@dev:/tmp/$ curl -L 'https://zenodo.org/records/16083811/files/nfcore-hic-v2.1.0-results.tar.zst?download=1' | zstdcat | tar -xf -
user@dev:/tmp/$ curl -L 'https://zenodo.org/records/16083811/files/W303_SGD_2015_JRIU00000000.fsa.zst?download=1' | zstdcat > reference.fa

# Note that decompressing the reference genome is optional.
# The pipeline can transparently handle most compression formats.

user@dev:/tmp/$ ls -lah
total 12M
drwxr-xr-x.   3 user user   80 Jul 18 11:18 .
drwxrwxrwt. 110 root root 3.0K Jul 18 11:17 ..
drwxr-xr-x.  11 user user  220 Jul 17 16:42 results
-rw-r--r--.   1 user user  12M Jul 18 11:18 reference.fa

Running the workflow

The workflow can be run as follows:

nextflow run --nfcore_hic_outdir='nfcore_hic_results/' \
             --fasta='reference.fa' \
             -output-dir 'results/' \
             https://github.com/robomics/compress-nfcore-hic-output \
             -r v1.0.0 \
             -with-apptainer  # Replace this with -with-docker to use Docker instead

This will produce the following outputs:

  1. results/alignment: Folder containing the bwt2pairs files in CRAM format (one per sample). With default settings, the reference genome is embedded in the .cram files.
  2. results/stats: Folder containing one .tar.xz file for each stats folder produced by nf-core/hic.
  3. results/validpairs: Folder containing the .allValidPairs files compressed using xz.
  4. results/*.tar.xz: One TAR archive for each folder (besides contact_maps and hicpro) found under nfcore_hic_outdir (e.g., archive multiqc.tar.xz contains the report generated by MultiQC.
Troubleshooting

Permission errors when running pipeline with -with-docker:

Try to pass option -process.containerOptions="--user root" to nextflow run

Cannot find revision vx.x.x:

Try to remove folder ~/.nextflow/assets/robomics/compress-nfcore-hic-output before running the workflow

Error 403 when pulling containers from ghcr.io:

In order to pull docker images from ghcr.io, you first need to log in to ghcr.io/robomics.

  1. Follow GitHub instructions to generate a personal access token (PAT): docs
  2. Run docker login or apptainer remote to login into the remote.

Example:

# Using Docker
docker login -u your-github-username ghcr.io/robomics

# Using apptainer
apptainer remote login -u your-github-username docker://ghcr.io/robomics

# You will now be prompted to enter your PAT

Getting help

If you are having trouble running the workflow feel free to reach out by starting a new discussion here.

Bug reports and feature requests can be submitted by opening an issue.

About

A nextflow workflow to compress the output folder produced by nf-core/hic

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors 2

  •  
  •