Skip to content

BRAKER3 commands

swarbred edited this page May 1, 2024 · 10 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

Check out the options for BRAKER

braker.pl --help

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

braker.pl  --useexisting  --AUGUSTUS_CONFIG_PATH=/opt/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 15 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

Sumarise 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

Summarise comparisions.

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

Visualise the the F1 metrics of all the comparisons.

less -S  Mikado_compare/Athaliana_braker.f1.tsv
Clone this wiki locally