fibertools on Biowulf

fibertools is a rust-based command line tool for creating, filtering, interacting, and extracting from Fiber-seq BAM files.

References:

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 --cpus-per-task=4
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 fibertools

[user@cn3144 ~]$ cp $FIBERTOOLS_TEST_DATA/ctcf.bam 

[user@cn3144 ~]$ ft validate --threads 2 ctcf.bam
[00:00:01]    Records 1,770.9125/s    Read 1,879 records   Total reads tested: 1879
Fraction with m6A: 100.00%
Fraction with nucleosomes: 100.00%
Numer of FIRE calls: 4229
Fraction aligned: 100.00%
Fraction phased: 0.00%
Fraction with kinetics: 0.00%

Fiber-seq BAM file is valid
[user@cn3144 ~]$ ft qc ctcf.bam
[00:00:01]    Records 1,715.7719/s    Read 1,879 records                                                                                      statistic	value	count
phased_reads	UNK	1879
phased_bp	UNK	22370158
fiber_length	1543	1
fiber_length	1772	1
fiber_length	1839	1
fiber_length	1848	1
fiber_length	1932	1
fiber_length	1967	1
fiber_length	2240	1
[...]

[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. fibertools.sh). For example:

#!/bin/bash
set -e
module load fibertools
cd /data/$USER/project-directory
ft extract --threads $SLURM_CPUS_PER_TASK --m6a m6a.bed.gz input.bam 

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

sbatch [--cpus-per-task=#] [--mem=#] fibertools.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. fibertools.swarm). For example:

ft predict-m6a --threads $SLURM_CPUS_PER_TASK input1.bam out1.bam
ft predict-m6a --threads $SLURM_CPUS_PER_TASK input2.bam out2.bam
ft predict-m6a --threads $SLURM_CPUS_PER_TASK input3.bam out3.bam
ft predict-m6a --threads $SLURM_CPUS_PER_TASK input4.bam out4.bam

Submit this job using the swarm command.

swarm -f fibertools.swarm [-g #] [-t #] --module fibertools
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 fibertools Loads the fibertools module for each subjob in the swarm