Running freebayes

Now we need to start calling more SNPs on the indiviudals that have been mapped to the reference genome. I’m breaking this up into groups of individuals (200-300) across many populations. I’m also submitting this via sbatch rather than spinning up a srun /bin/bash approach… Fingers crossed.


February 16, 2023

library( tidyverse )
── Attaching packages ─────────────────────────────────────── tidyverse 1.3.2 ──
✔ ggplot2 3.4.0      ✔ purrr   0.3.5 
✔ tibble  3.1.8      ✔ dplyr   1.0.10
✔ tidyr   1.2.1      ✔ stringr 1.4.1 
✔ readr   2.1.3      ✔ forcats 0.5.2 
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag()    masks stats::lag()
library( ggrepel )
theme_set( theme_minimal() )

As a first pass through the data, I split individual sequences into different groups to run bwa. This works on an individual-by-individual basis and with 5% of each individuals genome takes roughly 30 minutes per individual (*1419 individuals …). Doing it in smaller groups allows me to run multiple instances at the same time. See the table here for the groups and current status. At the time of this writing, this process is still waiting on the final 6 groups of samples to be processed.

For a subset of the data, I did call SNPs at the same time that

Batching freebayes

To batch these I made a new directory called snpcalling and linked the bam files from a set of indiviudals in several different populations to this folder.

for bam in ../samples/O/*.bam; do  
  ln -s $bam; 

I then made a small run file that would

ls *.bam > bam.fofn
freebayes --fasta-reference ${ref} --bam-list bam.fofn --vcf Output.vcf

I then made it executable

chmod +x

And made a slurm batch file freebayes.sub which contains

#SBATCH -n 36
#SBATCH -t 96:00:00
#SBATCH -J freebayesbaby
#SBATCH -o freebayes.o%j
#SBATCH -e freebayes.e%j
#SBATCH --mail-type=ALL
ulimit -s unlimited
scontrol show job $SLURM_JOB_ID

and then dumped it off for batch processing

sbatch freebayes.sub

After this, you can see that the batch job has been queued up (#34827) and waiting to go.

[rjdyer@huff snpcalling]$ squeue
  34827     basic freebaye   rjdyer PD       0:00      1 (Priority)
  34828     basic freebaye   rjdyer PD       0:00      1 (Priority)

So, now lets see if it actually works. This run has 293 samples and the next one (#34828) has 270.