This is a test version of Biostars. For the public version, visit https://www.biostars.org.
adding features to gtf file using agat tool function (2026)

Hello! Thank you in advance for time spent and input on this issue.

I am working with the wonderfully accessible gff/gtf tool agat, specifically the agat_sq_add_attributes_from_tsv.pl script to add a new feature (item in column 9) to my gtf. This script requires an input gtf/gff file and a tsv (or csv) file with two columns.

From my understanding of the documentation, the first column must contain features present in column 9 of the gtf/gff (these would be strings like transcript_ids or gene_ids) and the second column would contain the annotation to be added. Importantly, the header of column 1 in the tsv MUST be present in the gtf/gff file to ground the tsv for addition of the new feature. For example, here are the first 5 lines from my two input files:

head -5 Es_geneext.gtf
Lachesis_group0__68_contigs__length_203855924   ESCBRAKER       gene    60      211906  .       +       .       gene_id "g1"
Lachesis_group0__68_contigs__length_203855924   ESCBRAKER       transcript      60      211906  .       +       .       gene_id "g1"; transcript_id "g1.t1"
Lachesis_group0__68_contigs__length_203855924   ESCBRAKER       exon    60      1177    .       +       .       gene_id "g1"; transcript_id "g1.t1"
Lachesis_group0__68_contigs__length_203855924   ESCBRAKER       exon    51143   51338   .       +       .       gene_id "g1"; transcript_id "g1.t1"
Lachesis_group0__68_contigs__length_203855924   ESCBRAKER       exon    54218   54325   .       +       .       gene_id "g1"; transcript_id "g1.t1"

head -5 swiss_prot_entap_annots.tsv
transcript_id   entap_swiss_prot_annot
cluster_21962   cluster_21962_NaN
cluster_28524   cluster_28524_NaN
cluster_20895   cluster_20895_NaN
cluster_16812   cluster_16812_NaN
cluster_17664   cluster_17664_NaN

I am trying to run the script on "transcript_id" feature and the script runs, however no annotations are added to the output gff, not even the new feature name of "entap_swiss_prot_annot". Any tips here?

The only discrepancy I can see between my inputs and the documentation is that the transcript_ids in the tsv are out of order relative to the gtf. Could this be the cause of the error and if so any recommendations on how to re-sort the tsv based on transcript_ids in gtf? Thanks again!

agat gtf

Yes the first column of your tsv file is used to identify which line has to be updated in the GTF. Is cluster_21962 a transcript_id in your gtf file? Because the sample you show looks like a Augustus/braker output and I never seen such labelling for transcript_id

Good eye! While the gtf does include genes from braker output we did from a second assembly run (traditionally g1, g2, g3...etc), the gtf also includes gene/exon/cds lines that were lifted from the first assembly as well (and these are cluster_1, cluster_2, etc). Additionally, we used gmap to align denovo assembled transcripts and so we have Trinity transcript_ids as well.

While the components of column 9 in my gtf are unorthodox, i hoped the script would run as long as I kept my naming conventions shared between gtf and tsv.

0 answers

No answers yet.

Log in to answer this question.