Skip to content

BRAKER3 commands

Mariano Olivera Fedi edited this page Apr 27, 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

Run BRAKER3.

braker.pl  --useexisting  --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

Correct annotation coordinates.

bash Scripts/offset_gff.sh output_small/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.

```console
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