fiberhmm on Biowulf

fiberhmm is a Fiber-Seq tool for calling chromatin footprints and methylase-sensitive patches (MSPs).

It works with Fiber-seq (m6A via Hia5) and DAF-seq (deamination via DddA/DddB), producing fibertools-compatible BAM output with ns/nl/as/al tags. FiberHMM provides a unified framework for calling footprints across different single-molecule chemistries (Hia5, DddA, DddB) and sequencing platforms (PacBio, Nanopore), making it straightforward to directly compare chromatin accessibility measurements between experiments.
Documentation
Important Notes

Interactive job
Interactive jobs should be used for debugging, graphics, or applications that cannot be run as batch jobs.

Allocate an interactive session and run the program.
Sample session (user input in bold):

[user@biowulf]$ sinteractive --mem=8G
salloc.exe: Pending job allocation 46116226
salloc.exe: job 46116226 queued and waiting for resources
salloc.exe: job 46116226 has been allocated resources
salloc.exe: Granted job allocation 46116226
salloc.exe: Waiting for resource configuration
salloc.exe: Nodes cn3144 are ready for job

[user@cn3144 ~]$ module load fiberhmm

[user@cn3144 ~]$ cd /data/$USER/my-fiberseq-project

[user@cn3144 ~]$ fiberhmm-extract -i input.bam 
Input: input.bam
Output: /data/$USER/my-fiberseq-project
Extract types: footprint, msp, m6a, m5c
Cores: 1

=== Extracting footprint ===
Indexing input BAM...
Processing 493 regions with 1 cores...
  Regions: 493/493 | Reads: 1,879 | Features: 109,132 | 691 reads/s
Concatenating results...
Sorting BED...
Completed in 2.8s: 1,879 reads -> 109,132 features
[...]

[user@cn3144 ~]$ exit
salloc.exe: Relinquishing job allocation 46116226
[user@biowulf ~]$

Batch job
Most jobs should be run as batch jobs.

Create a batch input file (e.g. fiberhmm.sh). For example:

#!/bin/bash
set -e
module load fiberhmm
cd /data/$USER/my-fiberseq-project
fiberhmm-probs \
    -a accessible_control.bam \
    -u inaccessible_control.bam \
    -o probs/ \
    --mode pacbio-fiber \
    -k 3 4 5 6 \
    --stats

Update paths and filenames as needed. Submit this job using the Slurm sbatch command.

sbatch [--cpus-per-task=#] [--mem=#] fiberhmm.sh
Swarm of Jobs
A swarm of jobs is an easy way to submit a set of independent commands requiring identical resources.

Create a swarmfile (e.g. fiberhmm.swarm). For example:

fiberhmm-apply -i input1.bam -m model.json -o output1/ -c $SLURM_CPUS_PER_TASK
fiberhmm-apply -i input2.bam -m model.json -o output2/ -c $SLURM_CPUS_PER_TASK
fiberhmm-apply -i input3.bam -m model.json -o output3/ -c $SLURM_CPUS_PER_TASK
fiberhmm-apply -i input4.bam -m model.json -o output4/ -c $SLURM_CPUS_PER_TASK

Submit this job using the swarm command.

swarm -f fiberhmm.swarm [-g #] [-t #] --module fiberhmm
where
-g # Number of Gigabytes of memory required for each process (1 line in the swarm command file)
-t # Number of threads/CPUs required for each process (1 line in the swarm command file).
--module fiberhmm Loads the fiberhmm module for each subjob in the swarm