In the previous Data Storage hands-on section, you should have copied the class scripts to your /data area. If you skipped or missed that section, type
hpc-classes biowulfnow. This command will copy the scripts and input files used in this online class to your /data area, and will take about 5 minutes.
In the following session, you will submit a batch job for Freebayes, a a Bayesian genetic variant detector, reading and writing from local disk on the node. If you're not familiar with this program, don't worry -- this is just an example. The basic principles of job submission are not specific for Freebayes.
# allocate an interactive session requesting 5 GB of local disk on the node sinteractive --gres=lscratch:5 # once you are logged into a node, cd to the local scratch directory for this job cd /lscratch/$SLURM_JOBID # see what files it contains ls -l # copy the input files required for this job to local scratch cp -r /data/$USER/hpc-classes/biowulf/freebayes/ . # load the freebayes module module load freebayes # run freebayes cd freebayes freebayes -f genome.fasta input.bam # see what files have been created ls -l # exit the interactive session exit
Answer
To save the output files, you would need to copy them to your /data area before the 'exit' command.
Answer
Answer
#!/bin/bash # this file is freebayes.sh cd /lscratch/$SLURM_JOBID # copy the input files required for this job to local scratch cp -r /data/$USER/hpc-classes/biowulf/freebayes/ . # load the freebayes module module load freebayes # run freebayes, writing the output into a file cd freebayes freebayes -f genome.fasta input.bam > freebayes.out # copy the output files back to your /data area cp freebayes.out /data/$USER/biowulf-class/freebayes/
This job would be submitted with
sbatch --gres=lscratch:10 freebayes.sh