Skip to content

Helixer commands

Gemy Kaithakottil edited this page Feb 5, 2026 · 4 revisions

Helixer commands

First steps.

Go to the directory for this activity.

cd /home/train/Annotation_workshop/Helixer

Example run.

Helixer.py --fasta-path Inputs/Genome/Athaliana_447_TAIR10.Chr3-1065466-1464870.fa --gff-output-path test.gff --species Arabidopsis --temporary-dir /tmp --model-filepath Inputs/Models/land_plant_v0.3_a_0080.h5 --batch-size 32 --overlap-offset 53460 --overlap-core-length 80190  --subsequence-length 106920  --min-coding-length 60

Pre-Processing.

Reformat the fasta file with the genome to an h5 format to be used by Helixer.

mkdir -p Format_conversion ; fasta2h5.py --species A_thaliana --h5-output-path Format_conversion/A_thaliana.h5 --fasta-path Inputs/Genome/Athaliana_447_TAIR10.Chr3-1065466-1464870.fa --subsequence-length 106920

Analysis of model effect in the output.

Use all the models available to predict protein coding genes.

mkdir -p Predictions ; for f in Inputs/Models/* ; do tag=$(basename $f | rev | cut -f2- -d "." | rev) ; HybridModel.py --load-model-path $f --test-data Format_conversion/A_thaliana.h5  --overlap-offset 53460 --core-length 106920  --cpus 2 --overlap --val-test-batch-size 32 -v -p Predictions/${tag}_predictions.h5 ; done

Transform the predictions into a gff format file annotation.

mkdir -p Model_analysis/Annotations ; for f in Predictions/* ; do tag=$(basename $f | rev | cut -f2- -d "." | rev) ; helixer_post_bin Format_conversion/A_thaliana.h5 ${f} 100 0.1 0.8 60 Model_analysis/Annotations/A_thaliana.helixer_${tag}.gff ; done

Use Mikado to generate metrics for each annotation.

mkdir -p Model_analysis/Mikado_stats ; for f in Model_analysis/Annotations/* ; do tag=$(basename $f | rev | cut -f2- -d "." | rev) ; mikado util stats $f Model_analysis/Mikado_stats/${tag}.stats ; done

Sumarise the statistics generated by Mikado.

for f in Model_analysis/Annotations/* ; do tag=$(basename $f | rev | cut -f2- -d "." | rev) ; parse_mikado_stats Model_analysis/Mikado_stats/${tag}.stats > Model_analysis/Mikado_stats/${tag}.stats.summary ; done

Concat all the summary files into one general file.

Scripts/paste_mikado_summary_stats.sh Model_analysis/Mikado_stats/*stats.summary  > Model_analysis/Mikado_stats/all_gff.summary

Visualise the final output.

cat Model_analysis/Mikado_stats/all_gff.summary
	Model_analysis/Mikado_stats/A_thaliana.helixer_fungi_v0.3_a_0100_predictions.stats.summary	Model_analysis/Mikado_stats/A_thaliana.helixer_invertebrate_v0.3_m_0100_predictions.stats.summary	Model_analysis/Mikado_stats/A_thaliana.helixer_land_plant_v0.3_a_0080_predictions.stats.summary	Model_analysis/Mikado_stats/A_thaliana.helixer_vertebrate_v0.3_m_0080_predictions.stats.summary	
Number of genes                   143.00   125.00   124.00   75.00
Number of Transcripts             143.00   125.00   124.00   75.00
Transcripts per gene              1.00     1.00     1.00     1.00
Number of monoexonic genes        34.00    17.00    22.00    4.00
Monoexonic transcripts            34.00    17.00    22.00    4.00
Transcript mean size cDNA (bp)    1390.87  1584.72  1561.21  1645.15
Transcript median size cDNA (bp)  1286.00  1503.00  1386.00  1452.00
Min cDNA                          67.00    90.00    170.00   101.00
Max cDNA                          4435.00  5817.00  5537.00  5486.00
Total exons                       788.00   803.00   743.00   648.00
Exons per transcript              5.51     6.42     5.99     8.64
Exon mean size (bp)               252.40   246.69   260.55   190.41
CDS mean size (bp)                200.49   205.86   210.59   156.48
Transcript mean size CDS (bp)     1052.94  1193.98  1197.31  1262.25
Transcript median size CDS (bp)   888.00   1029.00  968.00   1077.00
Min CDS                           60.00    78.00    66.00    63.00
Max CDS                           3867.00  5112.00  5112.00  5112.00
Intron mean size (bp)             114.75   162.54   155.74   230.81
5'UTR mean size (bp)              147.93   139.81   140.50   148.99
3'UTR mean size (bp)              190.01   250.94   223.40   233.91

Correct the gff positions to match the original chromosome positions.

for f in Model_analysis/Annotations/A_thaliana.helixer_* ; do tag=$(basename $f | rev | cut -f2- -d "." | rev) ;  ./Scripts/offset_gff.sh $f 1065465 > Model_analysis/Annotations/${tag}_corrected.gff ; done

Use Mikado to compare the annotations to the reference annotation.

for f in Model_analysis/Annotations/*corrected* ; do  tag=$(basename $f | rev | cut -f2- -d "." | rev) ; mikado compare -r Inputs/Annotation/Athaliana_447_Araport11.Chr3-1065466-1464870.gene_exons.gff3 -p $f  -o Model_analysis/Mikado_Compare/${tag} ; done

Summarise all comparisions.

mikado util collect_compare -fmt tsv -l "all" -o Model_analysis/Mikado_Compare/Athaliana_helixer_models Model_analysis/Mikado_Compare/A_thaliana.helixer_*.stats

Visualise the the F1 metrics of all the comparisons.

less -S Model_analysis/Mikado_Compare/Athaliana_helixer_models.f1.tsv

Analyse the effect of post-bin parameter.

Generate multiple annotation files using a different peak-threshold parameter.

mkdir -p Land_plant_analysis/Annotations ; for f in {0.8,0.85,0.9,0.95,0.975} ; do  helixer_post_bin Format_conversion/A_thaliana.h5 Predictions/land_plant_v0.3_a_0080_predictions.h5 100 0.1 ${f} 60 Land_plant_analysis/Annotations/A_thaliana.helixer_${f}_land_plant_v0.3_a_0080.gff ; done

Use Mikado to generate metrics for each annotation.

mkdir -p Land_plant_analysis/Mikado_stats ; for f in Land_plant_analysis/Annotations/* ; do tag=$(basename $f | rev | cut -f2- -d "." | rev) ; mikado util stats $f Land_plant_analysis/Mikado_stats/${tag}.stats ; done

Sumarise the statistics generated by Mikado.

for f in Land_plant_analysis/Annotations/* ; do tag=$(basename $f | rev | cut -f2- -d "." | rev) ; parse_mikado_stats Land_plant_analysis/Mikado_stats/${tag}.stats > Land_plant_analysis/Mikado_stats/${tag}.stats.summary ; done

Concat all the summary files into one general file.

Scripts/paste_mikado_summary_stats.sh Land_plant_analysis/Mikado_stats/*stats.summary > Land_plant_analysis/Mikado_stats/all_gff.summary

Visualise the final output.

cat Land_plant_analysis/Mikado_stats/all_gff.summary
	Land_plant_analysis/Mikado_stats/A_thaliana.helixer_0.85_land_plant_v0.3_a_0080.stats.summary	Land_plant_analysis/Mikado_stats/A_thaliana.helixer_0.8_land_plant_v0.3_a_0080.stats.summary	Land_plant_analysis/Mikado_stats/A_thaliana.helixer_0.95_land_plant_v0.3_a_0080.stats.summary	Land_plant_analysis/Mikado_stats/A_thaliana.helixer_0.975_land_plant_v0.3_a_0080.stats.summary	Land_plant_analysis/Mikado_stats/A_thaliana.helixer_0.9_land_plant_v0.3_a_0080.stats.summary	
Number of genes                   123.00   124.00   120.00   116.00   122.00
Number of Transcripts             123.00   124.00   120.00   116.00   122.00
Transcripts per gene              1.00     1.00     1.00     1.00     1.00
Number of monoexonic genes        22.00    22.00    21.00    19.00    22.00
Monoexonic transcripts            22.00    22.00    21.00    19.00    22.00
Transcript mean size cDNA (bp)    1570.44  1561.21  1592.96  1625.78  1577.55
Transcript median size cDNA (bp)  1387.00  1386.00  1401.00  1426.00  1390.00
Min cDNA                          170.00   170.00   170.00   170.00   170.00
Max cDNA                          5537.00  5537.00  5537.00  5537.00  5537.00
Total exons                       741.00   743.00   734.00   728.00   739.00
Exons per transcript              6.02     5.99     6.12     6.28     6.06
Exon mean size (bp)               260.68   260.55   260.43   259.05   260.43
CDS mean size (bp)                210.77   210.59   210.84   210.29   210.95
Transcript mean size CDS (bp)     1204.66  1197.31  1222.85  1250.87  1212.10
Transcript median size CDS (bp)   975.00   968.00   1002.00  1023.00  984.00
Min CDS                           66.00    66.00    66.00    66.00    66.00
Max CDS                           5112.00  5112.00  5112.00  5112.00  5112.00
Intron mean size (bp)             155.69   155.74   155.88   155.78   155.58
5'UTR mean size (bp)              141.41   140.50   143.69   147.00   142.39
3'UTR mean size (bp)              224.37   223.40   226.42   227.91   223.07

Correct the gff positions to match the original chromosome positions.

for f in Land_plant_analysis/Annotations/A_thaliana.helixer_* ; do tag=$(basename $f | rev | cut -f2- -d "." | rev) ;  ./Scripts/offset_gff.sh $f 1065465 > Land_plant_analysis/Annotations/${tag}_corrected.gff ; done

Use Mikado to compare the annotations to the reference annotation.

for f in Land_plant_analysis/Annotations/*corrected* ; do  tag=$(basename $f | rev | cut -f2- -d "." | rev) ; mikado compare -r Inputs/Annotation/Athaliana_447_Araport11.Chr3-1065466-1464870.gene_exons.gff3 -p $f  -o Land_plant_analysis/Mikado_Compare/${tag} ; done

Summarise all comparisions.

mikado util collect_compare -fmt tsv -l "all" -o Land_plant_analysis/Mikado_Compare/Athaliana_helixer_models Land_plant_analysis/Mikado_Compare/A_thaliana.helixer_*.stats

Visualise the F1 metrics of all the comparisons.

less -S Land_plant_analysis/Mikado_Compare/Athaliana_helixer_models.f1.tsv

Clone this wiki locally