NBISweden / AGAT

Another Gtf/Gff Analysis Toolkit
GNU General Public License v3.0
447 stars 55 forks source link

Can't call method "has_tag" on an undefined value at /home/students/q.abbas/perl5/lib/perl5/AGAT/OmniscientTool.pm line 1267. #352

Closed qussai96 closed 1 year ago

qussai96 commented 1 year ago

Hello Jacques,

Thanks for AGAT, it is amazing. I am having an issue with merging annotation files using the command "agat_sp_merge_annotations.pl". I am getting the following error message:

Can't call method "has_tag" on an undefined value at /home/students/q.abbas/perl5/lib/perl5/AGAT/OmniscientTool.pm line 1267.

I tried with different annotation files from different tools but still got the same error message. Can you please help me with that?

Here is the code I am running: agat_sp_merge_annotations.pl --gff augustus.hints.gtf --gff AT1_Helixer.gtf --out merged_default+helixer.gtf

and here the output:

> 
> Using standard /home/students/q.abbas/perl5/lib/perl5/auto/share/dist/AGAT/config.yaml file
> ********************************************************************************
> *                              - Start parsing -                               *
> ********************************************************************************
> -------------------------- parse options and metadata --------------------------
> => Accessing the feature_levels YAML file
> Using standard /home/students/q.abbas/perl5/lib/perl5/auto/share/dist/AGAT/feature_levels.yaml file
> => Attribute used to group features when no Parent/ID relationship exists (i.e common tag):
>         * locus_tag
>         * gene_id
> => merge_loci option deactivated
> => Machine information:
>         This script is being run by perl v5.32.1
>         Bioperl location being used: /home/students/q.abbas/anaconda3/envs/agat/lib/perl5/site_perl/Bio/
>         Operating system being used: linux 
> => Accessing Ontology
>         No ontology accessible from the gff file header!
>         We use the SOFA ontology distributed with AGAT:
>                 /home/students/q.abbas/perl5/lib/perl5/auto/share/dist/AGAT/so.obo
>         Read ontology /home/students/q.abbas/perl5/lib/perl5/auto/share/dist/AGAT/so.obo:
>                 4 root terms, and 2596 total terms, and 1516 leaf terms
>         Filtering ontology:
>                 We found 1861 terms that are sequence_feature or is_a child of it.
> --------------------------------- parsing file ---------------------------------
> => Number of line in file: 583541
> => Number of comment lines: 0
> => Fasta included: No
> => Number of features lines: 583541
> => Number of feature type (3rd column): 7
>         * Level1: 1 => gene
>         * level2: 1 => transcript
>         * level3: 5 => exon CDS stop_codon intron start_codon
>         * unknown: 0 => 
> There is a problem we found several formats in this file: 1,2
> Let's see what we can do...
> => Version of the Bioperl GFF parser selected by AGAT: 2
> WARNING level2: No Parent attribute found @ for the feature: Chr4       AUGUSTUS        transcript      1180    1763    1       -   .ID "g1.t1" 
> WARNING gff3 reader: Hmmm, be aware that your feature doesn't contain any Parent and locus tag. No worries, we will handle it by considering it as strictly sequential. If you disagree, please provide an ID or a comon tag by locus. @ the feature is:
> Chr4    AUGUSTUS        transcript      1180    1763    1       -       .       ID "g1.t1" 
> WARNING level2: No Parent attribute found @ for the feature: Chr4       AUGUSTUS        transcript      4107    10364   1       -   .ID "g2.t1" 
> WARNING gff3 reader: Hmmm, be aware that your feature doesn't contain any Parent and locus tag. No worries, we will handle it by considering it as strictly sequential. If you disagree, please provide an ID or a comon tag by locus. @ the feature is:
> Chr4    AUGUSTUS        transcript      4107    10364   1       -       .       ID "g2.t1" 
> WARNING level2: No Parent attribute found @ for the feature: Chr4       AUGUSTUS        transcript      11634   13285   0.9     -   .ID "g3.t1" 
> WARNING gff3 reader: Hmmm, be aware that your feature doesn't contain any Parent and locus tag. No worries, we will handle it by considering it as strictly sequential. If you disagree, please provide an ID or a comon tag by locus. @ the feature is:
> Chr4    AUGUSTUS        transcript      11634   13285   0.9     -       .       ID "g3.t1" 
> WARNING level2: No Parent attribute found @ for the feature: Chr4       AUGUSTUS        transcript      13565   14366   1       +   .ID "g4.t1" 
> WARNING gff3 reader: Hmmm, be aware that your feature doesn't contain any Parent and locus tag. No worries, we will handle it by considering it as strictly sequential. If you disagree, please provide an ID or a comon tag by locus. @ the feature is:
> Chr4    AUGUSTUS        transcript      13565   14366   1       +       .       ID "g4.t1" 
> WARNING level2: No Parent attribute found @ for the feature: Chr4       AUGUSTUS        transcript      14653   15897   1       +   .ID "g5.t1" 
> WARNING gff3 reader: Hmmm, be aware that your feature doesn't contain any Parent and locus tag. No worries, we will handle it by considering it as strictly sequential. If you disagree, please provide an ID or a comon tag by locus. @ the feature is:
> Chr4    AUGUSTUS        transcript      14653   15897   1       +       .       ID "g5.t1" 
> WARNING level2: No Parent attribute found @ for the feature: Chr4       AUGUSTUS        transcript      17863   19848   1       +   .ID "g6.t1" 
> WARNING gff3 reader: Hmmm, be aware that your feature doesn't contain any Parent and locus tag. No worries, we will handle it by considering it as strictly sequential. If you disagree, please provide an ID or a comon tag by locus. @ the feature is:
> Chr4    AUGUSTUS        transcript      17863   19848   1       +       .       ID "g6.t1" 
> WARNING level2: No Parent attribute found @ for the feature: Chr4       AUGUSTUS        transcript      21437   27996   1       +   .ID "g7.t1" 
> WARNING gff3 reader: Hmmm, be aware that your feature doesn't contain any Parent and locus tag. No worries, we will handle it by considering it as strictly sequential. If you disagree, please provide an ID or a comon tag by locus. @ the feature is:
> Chr4    AUGUSTUS        transcript      21437   27996   1       +       .       ID "g7.t1" 
> WARNING level2: No Parent attribute found @ for the feature: Chr4       AUGUSTUS        transcript      29366   30128   0.32    -   .ID "g8.t1" 
> WARNING gff3 reader: Hmmm, be aware that your feature doesn't contain any Parent and locus tag. No worries, we will handle it by considering it as strictly sequential. If you disagree, please provide an ID or a comon tag by locus. @ the feature is:
> Chr4    AUGUSTUS        transcript      29366   30128   0.32    -       .       ID "g8.t1" 
> WARNING level2: No Parent attribute found @ for the feature: Chr4       AUGUSTUS        transcript      32946   33575   1       +   .ID "g9.t1" 
> WARNING gff3 reader: Hmmm, be aware that your feature doesn't contain any Parent and locus tag. No worries, we will handle it by considering it as strictly sequential. If you disagree, please provide an ID or a comon tag by locus. @ the feature is:
> Chr4    AUGUSTUS        transcript      32946   33575   1       +       .       ID "g9.t1" 
> WARNING level2: No Parent attribute found @ for the feature: Chr4       AUGUSTUS        transcript      34234   36594   1       +   .ID "g10.t1" 
> WARNING level2: No Parent attribute found  ************** Too much WARNING message we skip the next **************
> WARNING gff3 reader: Hmmm, be aware that your feature doesn't contain any Parent and locus tag. No worries, we will handle it by considering it as strictly sequential. If you disagree, please provide an ID or a comon tag by locus. @ the feature is:
> Chr4    AUGUSTUS        transcript      34234   36594   1       +       .       ID "g10.t1" 
> WARNING gff3 reader: Hmmm, be aware that your feature doesn't contain any Parent and locus tag. No worries, we will handle it by considering it as strictly sequential. If you disagree, please provide an ID or a comon tag by locus.  ************** Too much WARNING message we skip the next **************
> 32387 warning messages: WARNING level2: No Parent attribute found 
> 32387 warning messages: WARNING gff3 reader: Hmmm, be aware that your feature doesn't contain any Parent and locus tag. No worries, we will handle it by considering it as strictly sequential. If you disagree, please provide an ID or a comon tag by locus. 
> ********************************************************************************
> *                               - End parsing -                                *
> *                              done in 55 seconds                              *
> ********************************************************************************
> 
> ********************************************************************************
> *                               - Start checks -                               *
> ********************************************************************************
> ---------------------------- Check1: feature types -----------------------------
> ----------------------------------- ontology -----------------------------------
> All feature types in agreement with the Ontology.
> ------------------------------------- agat -------------------------------------
> AGAT can deal with all the encountered feature types (3rd column)
> ------------------------------ done in 0 seconds -------------------------------
> 
> ------------------------------ Check2: duplicates ------------------------------
> None found
> ------------------------------ done in 0 seconds -------------------------------
> 
> -------------------------- Check3: sequential bucket ---------------------------
> Nothing to check as sequential bucket!
> ------------------------------ done in 0 seconds -------------------------------
> 
> --------------------------- Check4: l2 linked to l3 ----------------------------
> No problem found
> ------------------------------ done in 0 seconds -------------------------------
> 
> --------------------------- Check5: l1 linked to l2 ----------------------------
> No problem found
> ------------------------------ done in 0 seconds -------------------------------
> 
> --------------------------- Check6: remove orphan l1 ---------------------------
> We remove only those not supposed to be orphan
> None found
> ------------------------------ done in 1 seconds -------------------------------
> 
> ------------------------- Check7: all level3 locations -------------------------
> ------------------------------ done in 4 seconds -------------------------------
> 
> ------------------------------ Check8: check cds -------------------------------
> No problem found
> ------------------------------ done in 1 seconds -------------------------------
> 
> ----------------------------- Check9: check exons ------------------------------
> No exons created
> 1 exons locations modified that were wrong
> No supernumerary exons removed
> No level2 locations modified
> ------------------------------ done in 4 seconds -------------------------------
> 
> ----------------------------- Check10: check utrs ------------------------------
> 1 UTRs created that were missing
> No UTRs locations modified
> No supernumerary UTRs removed
> ------------------------------ done in 2 seconds -------------------------------
> 
> ------------------------ Check11: all level2 locations -------------------------
> No problem found
> ------------------------------ done in 5 seconds -------------------------------
> 
> ------------------------ Check12: all level1 locations -------------------------
> No problem found
> ------------------------------ done in 1 seconds -------------------------------
> 
> ---------------------- Check13: remove identical isoforms ----------------------
> None found
> ------------------------------ done in 0 seconds -------------------------------
> ********************************************************************************
> *                                - End checks -                                *
> *                              done in 18 seconds                              *
> ********************************************************************************
> 
> => OmniscientI total time: 73 seconds
> /home/students/q.abbas/+proj-q.abbas/AT/3-braker/1-default/1-default_w_ortho_wo_AT/augustus.hints.gtf GFF3 file parsed
> There is 130471 intron
> There is 32385 start_codon
> There is 32387 stop_codon
> There is 162857 cds
> There is 30197 gene
> There is 32387 transcript
> There is 162857 exon
> There is 1 five_prime_utr
> ********************************************************************************
> *                              - Start parsing -                               *
> ********************************************************************************
> -------------------------- parse options and metadata --------------------------
> => Accessing the feature_levels YAML file
> Using standard /home/students/q.abbas/perl5/lib/perl5/auto/share/dist/AGAT/feature_levels.yaml file
> => Attribute used to group features when no Parent/ID relationship exists (i.e common tag):
>         * locus_tag
>         * gene_id
> => merge_loci option deactivated
> => Machine information:
>         This script is being run by perl v5.32.1
>         Bioperl location being used: /home/students/q.abbas/anaconda3/envs/agat/lib/perl5/site_perl/Bio/
>         Operating system being used: linux 
> => Accessing Ontology
>         No ontology accessible from the gff file header!
>         We use the SOFA ontology distributed with AGAT:
>                 /home/students/q.abbas/perl5/lib/perl5/auto/share/dist/AGAT/so.obo
>         Read ontology /home/students/q.abbas/perl5/lib/perl5/auto/share/dist/AGAT/so.obo:
>                 4 root terms, and 2596 total terms, and 1516 leaf terms
>         Filtering ontology:
>                 We found 1861 terms that are sequence_feature or is_a child of it.
> --------------------------------- parsing file ---------------------------------
> => Number of line in file: 409257
> => Number of comment lines: 0
> => Fasta included: No
> => Number of features lines: 409257
> => Number of feature type (3rd column): 6
>         * Level1: 1 => gene
>         * level2: 1 => mRNA
>         * level3: 4 => five_prime_UTR exon three_prime_UTR CDS
>         * unknown: 0 => 
> => Version of the Bioperl GFF parser selected by AGAT: 3
> ********************************************************************************
> *                               - End parsing -                                *
> *                              done in 31 seconds                              *
> ********************************************************************************
> 
> ********************************************************************************
> *                               - Start checks -                               *
> ********************************************************************************
> ---------------------------- Check1: feature types -----------------------------
> ----------------------------------- ontology -----------------------------------
> All feature types in agreement with the Ontology.
> ------------------------------------- agat -------------------------------------
> AGAT can deal with all the encountered feature types (3rd column)
> ------------------------------ done in 0 seconds -------------------------------
> 
> ------------------------------ Check2: duplicates ------------------------------
> None found
> ------------------------------ done in 0 seconds -------------------------------
> 
> -------------------------- Check3: sequential bucket ---------------------------
> Nothing to check as sequential bucket!
> ------------------------------ done in 0 seconds -------------------------------
> 
> --------------------------- Check4: l2 linked to l3 ----------------------------
> No problem found
> ------------------------------ done in 0 seconds -------------------------------
> 
> --------------------------- Check5: l1 linked to l2 ----------------------------
> No problem found
> ------------------------------ done in 0 seconds -------------------------------
> 
> --------------------------- Check6: remove orphan l1 ---------------------------
> We remove only those not supposed to be orphan
> None found
> ------------------------------ done in 0 seconds -------------------------------
> 
> ------------------------- Check7: all level3 locations -------------------------
> ------------------------------ done in 3 seconds -------------------------------
> 
> ------------------------------ Check8: check cds -------------------------------
> No problem found
> ------------------------------ done in 0 seconds -------------------------------
> 
> ----------------------------- Check9: check exons ------------------------------
> No exons created
> No exons locations modified
> No supernumerary exons removed
> No level2 locations modified
> ------------------------------ done in 3 seconds -------------------------------
> 
> ----------------------------- Check10: check utrs ------------------------------
> No UTRs created
> No UTRs locations modified
> No supernumerary UTRs removed
> ------------------------------ done in 3 seconds -------------------------------
> 
> ------------------------ Check11: all level2 locations -------------------------
> No problem found
> ------------------------------ done in 3 seconds -------------------------------
> 
> ------------------------ Check12: all level1 locations -------------------------
> No problem found
> ------------------------------ done in 0 seconds -------------------------------
> 
> ---------------------- Check13: remove identical isoforms ----------------------
> None found
> ------------------------------ done in 0 seconds -------------------------------
> ********************************************************************************
> *                                - End checks -                                *
> *                              done in 12 seconds                              *
> ********************************************************************************
> 
> => OmniscientI total time: 43 seconds
> /home/students/q.abbas/+proj-q.abbas/AT/4-Helixer/AT1_Helixer.gtf GFF3 file parsed
> There is 28754 three_prime_utr
> There is 27111 mrna
> There is 143299 cds
> There is 27111 gene
> There is 32478 five_prime_utr
> There is 150504 exon
> 
> Total raw data of files together:
> There is 32385 start_codon
> There is 130471 intron
> There is 32387 stop_codon
> There is 28754 three_prime_utr
> There is 27111 mrna
> There is 306156 cds
> There is 57308 gene
> There is 32479 five_prime_utr
> There is 32387 transcript
> There is 313361 exon
> 
> Now merging overlaping loci, and removing identical isoforms:
> Can't call method "has_tag" on an undefined value at /home/students/q.abbas/perl5/lib/perl5/AGAT/OmniscientTool.pm line 1267.

Cheers, Qussai

Juke34 commented 1 year ago

What AGAT version are you using?

qussai96 commented 1 year ago

Version: v1.0.0

Juke34 commented 1 year ago

Would it be possible to get a sample file (or the whole file) which raise this issue?

qussai96 commented 1 year ago

Sure, here are two files that I couldn't merge. two_gtf.zip