Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'Seq' object has no attribute 'defined' #88

Open
sbassi opened this issue Aug 19, 2024 · 1 comment · May be fixed by #89
Open

AttributeError: 'Seq' object has no attribute 'defined' #88

sbassi opened this issue Aug 19, 2024 · 1 comment · May be fixed by #89

Comments

@sbassi
Copy link

sbassi commented Aug 19, 2024

Got this error:

Traceback (most recent call last):
  File "/opt/MitoHiFi/src/mitohifi.py", line 566, in <module>
    main()
  File "/opt/MitoHiFi/src/mitohifi.py", line 491, in main
    plot_annotation.plot_annotation("final_mitogenome.gb", "final_mitogenome.annotation.png")
  File "/opt/MitoHiFi/src/plot_annotation.py", line 38, in plot_annotation
    graphic_record = MyCustomTranslator().translate_record(in_gb)
  File "/usr/local/lib/python3.6/dist-packages/dna_features_viewer/BiopythonTranslator/BiopythonTranslatorBase.py", line 89, in translate_record
    sequence=str(record.seq) if record.seq.defined else None,
AttributeError: 'Seq' object has no attribute 'defined'

I did a modification to line 89 and it worked, so will commit my patch.

Changing:

sequence=str(record.seq) if record.seq.defined else None

To:

sequence=str(record.seq) if record.seq else None

Since I don't know about defined for Biopython Seq, maybe is something old?

sbassi added a commit to sbassi/DnaFeaturesViewer that referenced this issue Aug 19, 2024
@veghp
Copy link
Member

veghp commented Aug 29, 2024

Thank you, actually it's a new property: https://biopython.org/docs/1.81/api/Bio.Seq.html and has been addressed in #79

My solution would be to update Biopython (and Python as support for 3.6 ended a while ago).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants