Skip to content

Docs CSC now features an automatic Finnish translation. Click here for more information.

Warning!

Puhti and Mahti computing services have been decommissioned and no new jobs are accepted or executed on its compute nodes. Puhti and Mahti login nodes and storage services are planned to remain available until 15 October 2026. Clean up unnecessary files and move any data you need to keep by 31 August 2026. See the Roihu data migration guide for instructions on transferring your data to Roihu.

Freebayes

FreeBayes is a genetic variant detector designed to find small polymorphisms (SNPs, indels, MNPs and complex events).

FreeBayes is haplotype-based, in the sense that it calls variants based on the literal sequences of reads aligned to a particular target, not their precise alignment. This model is a straightforward generalization of previous ones (e.g. PolyBayes, samtools, GATK) which detect or report variants based on alignments. This method avoids one of the core problems with alignment-based variant detection, that identical sequences may have multiple possible alignments.

FreeBayes uses short-read alignments (BAM files) for any number of individuals from a population and a reference genome to determine the most-likely combination of genotypes for the population at each position in the reference. It reports positions which it finds putatively polymorphic in variant call file (VCF) format. It can also use an input set of variants (VCF) as a source of prior information, and a copy number variant map (BED) to define non-uniform ploidy variation across the samples under analysis.

License

Free to use and open source under MIT License.

Available

  • Roihu: 1.3.6, via the bio-apps module.

Usage

FreeBayes is part of the bio-apps collection on Roihu. Load the bio-apps module tree and then the FreeBayes module:

module load bio-apps/v202603
module load freebayes/1.3.6

After this you can launch FreeBayes. For example:

freebayes -f reference.fa input.bam > results.vcf

Note that FreeBayes requires a BAM file that is indexed. A BAM file can be indexed with the samtools index command (load the samtools module first):

module load samtools/1.21
samtools index input.bam

FreeBayes analysis jobs can be computationally heavy and should be run as batch jobs on Roihu. Below is a sample batch job script:

#!/bin/bash
#SBATCH --job-name=freebayes
#SBATCH --account=<project>
#SBATCH --output=output_%j.txt
#SBATCH --error=errors_%j.txt
#SBATCH --time=24:00:00
#SBATCH --partition=small
#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --mem-per-cpu=16000M

module load bio-apps/v202603
module load freebayes/1.3.6

freebayes -f reference.fa input.bam > results.vcf

Replace <project> with your CSC project (for example project_2001234).

You can submit the batch job file to the batch job system with the command:

sbatch batch_job_file.sh

See creating a batch job script for Roihu for more information about running batch jobs.

Support

CSC Service Desk

More information