Skip to content

Helixer commands

Mariano Olivera Fedi edited this page Apr 24, 2024 · 19 revisions

Helixer commands

Pre-Processing

Go to the directory for this activity

cd /home/{user}/train/Annotation_workshop/Helixer

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

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

Analysis of model effect in the output.

Use all the models available to predict protein coding genes.

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 ${tag}_predictions.h5 ; done

Transform the predictions into a gff format file annotation.

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.

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 > Mikado_stats/${tag}.stats.summary ; done

Concat all the summary files into one general file.

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

Visualise the final output.

cat Mikado_stats/all_gff

Use Mikado to compare the annotations to the reference annotation.

for f in Model_analysis/Annotations/* ; do  tag=$(basename $f | rev | cut -f2- -d "." | rev) ; mikado compare -r Inputs/Annotation/Athaliana_447_Araport11.Chr3.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 Land_plant_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.

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_${tag}_land_plant_v0.3_a_0080.gff" ; done

Use Mikado to generate metrics for each annotation.

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.

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

Use Mikado to compare the annotations to the reference annotation.

for f in Land_plant_analysis/Annotations/* ; do  tag=$(basename $f | rev | cut -f2- -d "." | rev) ; mikado compare -r Inputs/Annotation/Athaliana_447_Araport11.Chr3.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