bamtofastq on Biowulf
Tool for converting 10x BAMs produced by Cell Ranger, Space Ranger, Cell Ranger ATAC, Cell Ranger DNA, and Long Ranger back to FASTQ files that can be used as inputs to re-run analysis. The FASTQ files emitted by the tool should contain the same set of sequences that were input to the original pipeline run, although the order will not be preserved. The FASTQs will be emitted into a directory structure that is compatible with the directories created by the 'mkfastq' tool.
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
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 bamtofastq

[user@cn3144 ~]$ bamtofastq $bam $output_path 

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

#!/bin/bash
set -e
module load bamtofastq
bamtofastq $bam $output_path

Submit this job using the Slurm sbatch command.

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

  bamtofastq sample1.bam out1
  bamtofastq sample2.bam out2
  bamtofastq sample3.bam out3

Submit this job using the swarm command.

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