TRF on Biowulf

Tandem Repeats Finder is a program to locate and display tandem repeats in DNA sequences.

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@biowulf]$ sinteractive --mem 5g
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 trf
[+] Loading trf, version 4.09...
[user@cn3144 ~]$ trf \
 /fdb/igenomes/Homo_sapiens/UCSC/hg38/Sequence/WholeGenomeFasta/genome.fa \
 2 `# match weight` \
 7 `# mismatch penalty` \
 7 `# indel penalty` \
 80 `# match probability` \
 10 `# indel probability` \
 50 `# minimum alignment score to report` \
 500 `# maximum period size to report` \
 -f `# record flanking sequence` \
 -d `# produce detailed data file` \
 -m `# generate a masked sequence file` \
 -l 6 `# longest tandem repeat array expected (in Mbp)`


Tandem Repeats Finder, Version 4.09
Copyright (C) Dr. Gary Benson 1999-2012. All rights reserved.

Loading sequence...
Allocating Memory...
Initializing data structures...
Computing TR Model Statistics...
Scanning Sequence 1...
Freeing Memory...
Resolving output...
Done.
Loading sequence file...
Allocating Memory...
Initializing data structures...
Computing TR Model Statistics...
...

....................

.....................

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

#!/bin/sh

module load trf || exit 1

trf \
 /fdb/igenomes/Homo_sapiens/UCSC/hg38/Sequence/WholeGenomeFasta/genome.fa \
 2 `# match weight` \
 7 `# mismatch penalty` \
 7 `# indel penalty` \
 80 `# match probability` \
 10 `# indel probability` \
 50 `# minimum alignment score to report` \
 500 `# maximum period size to report` \
 -f `# record flanking sequence` \
 -d `# produce detailed data file` \
 -m `# generate a masked sequence file` \
 -l 6 `# longest tandem repeat array expected (in Mbp)`

Submit this job using the Slurm sbatch command.

sbatch --mem 5g --time 4:00:00 trf.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. trf.swarm). For example:

cd sample1 && trf sample1.fa 2 7 7 80 10 50 500 -f -d -m
cd sample2 && trf sample2.fa 2 7 7 80 10 50 500 -f -d -m
cd sample3 && trf sample3.fa 2 7 7 80 10 50 500 -f -d -m
cd sample4 && trf sample4.fa 2 7 7 80 10 50 500 -f -d -m

Submit this job using the swarm command.

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