neherlab / ncov-simple

2 stars 1 forks source link

explicit_translation.py local only: `AttributeError: 'NoneType' object has no attribute 'find'` #25

Closed corneliusroemer closed 2 years ago

corneliusroemer commented 2 years ago

Bug when running explicit translation, but only locally, not on scicore. Not sure where the error is. Can you help @rneher ?

Error in rule translate:
    jobid: 21
    output: builds-test/global/aa_muts.json, builds-test/global/translations/aligned.gene.E_withInternalNodes.fasta, builds-test/global/translations/aligned.gene.M_withInternalNodes.fasta, builds-test/global/translations/aligned.gene.N_withInternalNodes.fasta, builds-test/global/translations/aligned.gene.ORF1a_withInternalNodes.fasta, builds-test/global/translations/aligned.gene.ORF1b_withInternalNodes.fasta, builds-test/global/translations/aligned.gene.ORF3a_withInternalNodes.fasta, builds-test/global/translations/aligned.gene.ORF6_withInternalNodes.fasta, builds-test/global/translations/aligned.gene.ORF7a_withInternalNodes.fasta, builds-test/global/translations/aligned.gene.ORF7b_withInternalNodes.fasta, builds-test/global/translations/aligned.gene.ORF8_withInternalNodes.fasta, builds-test/global/translations/aligned.gene.ORF9b_withInternalNodes.fasta, builds-test/global/translations/aligned.gene.S_withInternalNodes.fasta
    log: logs/aamuts_global.txt (check log file(s) for error message)
    shell:

        python3 scripts/explicit_translation.py             --tree builds-test/global/tree.nwk             --annotation defaults/annotation.gff             --reference defaults/reference_seq.fasta             --translations builds-test/global/translations/aligned.gene.E.fasta builds-test/global/translations/aligned.gene.M.fasta builds-test/global/translations/aligned.gene.N.fasta builds-test/global/translations/aligned.gene.ORF1a.fasta builds-test/global/translations/aligned.gene.ORF1b.fasta builds-test/global/translations/aligned.gene.ORF3a.fasta builds-test/global/translations/aligned.gene.ORF6.fasta builds-test/global/translations/aligned.gene.ORF7a.fasta builds-test/global/translations/aligned.gene.ORF7b.fasta builds-test/global/translations/aligned.gene.ORF8.fasta builds-test/global/translations/aligned.gene.ORF9b.fasta builds-test/global/translations/aligned.gene.S.fasta             --genes E M N ORF1a ORF1b ORF3a ORF6 ORF7a ORF7b ORF8 ORF9b S             --output builds-test/global/aa_muts.json 2>&1 | tee logs/aamuts_global.txt

        (one of the commands exited with non-zero exit code; note that snakemake uses bash strict mode!)
Logfile logs/aamuts_global.txt:
Traceback (most recent call last):
  File "scripts/explicit_translation.py", line 57, in <module>
    features = read_gff(args.annotation)
  File "scripts/explicit_translation.py", line 17, in read_gff
    for rec in GFF.parse(in_handle):
  File "/usr/local/Caskroom/mambaforge/base/envs/nextstrain/lib/python3.8/site-packages/BCBio/GFF/GFFParser.py", line 780, in parse
    for rec in parser.parse_in_parts(gff_files, base_dict, limit_info,
  File "/usr/local/Caskroom/mambaforge/base/envs/nextstrain/lib/python3.8/site-packages/BCBio/GFF/GFFParser.py", line 329, in parse_in_parts
    cur_dict = self._results_to_features(cur_dict, results)
  File "/usr/local/Caskroom/mambaforge/base/envs/nextstrain/lib/python3.8/site-packages/BCBio/GFF/GFFParser.py", line 367, in _results_to_features
    (_, base) = self._add_toplevel_feature(base, feature)
  File "/usr/local/Caskroom/mambaforge/base/envs/nextstrain/lib/python3.8/site-packages/BCBio/GFF/GFFParser.py", line 570, in _add_toplevel_feature
    rec, base = self._get_rec(base, feature_dict)
  File "/usr/local/Caskroom/mambaforge/base/envs/nextstrain/lib/python3.8/site-packages/BCBio/GFF/GFFParser.py", line 535, in _get_rec
    match_id = self._get_matching_record_id(base, info_dict['rec_id'])
  File "/usr/local/Caskroom/mambaforge/base/envs/nextstrain/lib/python3.8/site-packages/BCBio/GFF/GFFParser.py", line 409, in _get_matching_record_id
    elif find_id.find("|") > 0:
AttributeError: 'NoneType' object has no attribute 'find'
rneher commented 2 years ago

looks like a problem with your version of the GFF parser. But could be triggered by something in the genome annotation.

corneliusroemer commented 2 years ago

My local version is: bcbio-gff=0.6.8=pyh5e36f6f_0

Scicore version is: bcbio-gff=0.6.6

Looks like this is a new version of bcbio, so could indeed be regression bug, will downgrade and see if it persists. image

https://anaconda.org/bioconda/bcbio-gff/files

corneliusroemer commented 2 years ago

It's indeed a bug popping up in v0.6.8, downgrading to v0.6.7 fixes this error for me.

corneliusroemer commented 2 years ago

Bug has supposedly been fixedi n new bcbio-gff

corneliusroemer commented 2 years ago

Problem apparently still not fixed for us - I get an error when running with 0.6.9 will downgrade to 0.6.7 again