Skip to content

BRAKER3 commands

Gemy George Kaithakottil edited this page Apr 22, 2026 · 3 revisions

BRAKER3 commands

Prediction with BRAKER3 and comparison with other gene prediction tools.

Go to the directory for this activity.

cd /home/train/Annotation_workshop/braker3

Activate the environment.

activate_braker3

Check out the options for BRAKER

braker.pl --help

Run BRAKER3 (This will take ~10 mins to run).

(
braker.pl  \
    --useexisting  \
    --AUGUSTUS_CONFIG_PATH=/home/train/data/config \
    --verbosity=4 \
    --workingdir=./output \
    --genome=Inputs/Genome/Athaliana_447_TAIR10.Chr3-264870-1664870.fa  \
    --species=arabidopsis \
    --gff3 \
    --threads 3 \
    --bam=Inputs/RNA/all_samples.bam \
    --prot_seq=Inputs/Proteins/close_related_organisms_proteins.faa \
    --nocleanup
)

⚠️ Windows users:

braker.pl --useexisting --AUGUSTUS_CONFIG_PATH=/home/train/data/config --verbosity=4 --workingdir=./output --genome=Inputs/Genome/Athaliana_447_TAIR10.Chr3-264870-1664870.fa --species=arabidopsis --gff3 --threads 3 --bam=Inputs/RNA/all_samples.bam --prot_seq=Inputs/Proteins/close_related_organisms_proteins.faa --nocleanup

If you prefer not to wait 10 minutes, the output of the above command can be found in /home/train/Annotation_workshop/braker3/Example_output/output. You can copy this directory into /home/train/Annotation_workshop/braker3 and then run the subsequent steps to generate the gene stats and compare against the reference annotation.

cp -r /home/train/Annotation_workshop/braker3/Example_output/output /home/train/Annotation_workshop/braker3

Correct annotation coordinates.

bash Scripts/offset_gff.sh output/braker.gff3 264869 > braker_corrected.gff

Filter GFF to match previous gene predictions.

bash Scripts/filter_gff_by_coordinates.sh braker_corrected.gff 1065466 1464870  >  braker_corrected_filtered.gff

Use Mikado to generate metrics for the annotation.

mkdir -p Mikado_stats; mikado util stats braker_corrected_filtered.gff Mikado_stats/braker.stats

Summarise the statistics generated by Mikado.

parse_mikado_stats Mikado_stats/braker.stats > Mikado_stats/braker.stats.summary

Visualise the final output.

cat Mikado_stats/braker.stats.summary
Number of genes                   117.00
Number of Transcripts             131.00
Transcripts per gene              1.12
Number of monoexonic genes        31.00
Monoexonic transcripts            33.00
Transcript mean size cDNA (bp)    1212.23
Transcript median size cDNA (bp)  1017.00
Min cDNA                          42.00
Max cDNA                          5112.00
Total exons                       784.00
Exons per transcript              5.98
Exon mean size (bp)               202.55
CDS mean size (bp)                202.55
Transcript mean size CDS (bp)     1212.23
Transcript median size CDS (bp)   1017.00
Min CDS                           42.00
Max CDS                           5112.00
Intron mean size (bp)             173.51
5'UTR mean size (bp)              0.00
3'UTR mean size (bp)              0.00

Compare with previously predicted annotations.

(
mkdir -p Mikado_compare
cp braker_corrected_filtered.gff Mikado_compare
cp Inputs/Annotations/* Mikado_compare
for f in Mikado_compare/*.{gff,gff3} ; do
    tag=$( basename $f | rev | cut -d . -f 2- | rev )
    mikado compare -eu \
        -r Inputs/Ref_annotation/Athaliana_447_Araport11.Chr3-1065466-1464870.gene_exons.gff3 \
        -p $f  \
        -o Mikado_compare/${tag}
done
)

⚠️ Windows users:

mkdir -p Mikado_compare; cp braker_corrected_filtered.gff Mikado_compare; cp Inputs/Annotations/* Mikado_compare; for f in Mikado_compare/*.{gff,gff3} ; do tag=$( basename $f | rev | cut -d . -f 2- | rev ); mikado compare -eu -r Inputs/Ref_annotation/Athaliana_447_Araport11.Chr3-1065466-1464870.gene_exons.gff3 -p $f -o Mikado_compare/${tag}; done

Summarise comparisons.

mikado util collect_compare -fmt tsv -l "all" -o Mikado_compare/Athaliana_braker Mikado_compare/*.stats

Visualise the F1 metrics of all the comparisons.

less -S  Mikado_compare/Athaliana_braker.f1.tsv

Commands to clean up, i.e. return to only the original files.

cd /home/train/Annotation_workshop/braker3
rm -rf -v !("Inputs"|"Scripts"|"commands.txt"|"Example_output")

⚠️ Windows users:

cd /home/train/Annotation_workshop/braker3 && rm -rf -v !("Inputs"|"Scripts"|"commands.txt"|"Example_output")

Deactivate the environment.

deactivate

Clone this wiki locally