question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AvoidPattern with biopython FeatureLocation raises AttributeError (in some specific parameters)

See original GitHub issue

Adding a simple DNA pattern TGAA as an AvoidPattern constraint causes an AttributeError, the stack trace is listed below

"/usr/local/lib/python3.8/site-packages/dnachisel/DnaOptimizationProblem/mixins/ConstraintsSolverMixin.py", line 357, in resolve_constraints
    self.resolve_constraint(constraint=constraint)
  File "/usr/local/lib/python3.8/site-packages/dnachisel/DnaOptimizationProblem/mixins/ConstraintsSolverMixin.py", line 251, in resolve_constraint
    evaluation = this_local_constraint.evaluate(self)
AttributeError: 'NoneType' object has no attribute 'evaluate'

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
Zulkocommented, Mar 30, 2021

I have to admit I have no clue what Biopython version supports what values 😦 . I think replacing None strands by 0 should be pretty safe (someone will scream if it isn’t 😄 )

1reaction
veghpcommented, Mar 30, 2021

Thanks for pointing out the problem; I’ll have to look into it to keep Biopython support for older version (as did with DNAalphabet). Alternatively we can drop support (?)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bio.SeqFeature module — Biopython 1.76 documentation
If the FeatureLocation is None, e.g. when parsing invalid locus locations in the GenBank parser, extract() will raise a ValueError. >>> from Bio.Seq...
Read more >
[Biopython] Edit feature's location
Assigning to feature.location.start raises > an AttributeError. ... goal is to move all features in a genbank file by some specific > number ......
Read more >
biopython FeatureLocation comparison - Stack Overflow
I am using biopython to complete a simple task: from a specific genebank fill, extract a gene ID and related information into a...
Read more >
Source code for dnachisel.biotools.genbank_operations
SeqFeature import SeqFeature, FeatureLocation from Bio. ... Parameters ----------- record A Biopython record. pattern A DnaChisel SequencePattern object ...
Read more >
Sequence annotation objects - Biopython - Read the Docs
SeqFeature import FeatureLocation from Bio.SeqRecord import SeqRecord ... SeqIO has been able to automatically assign a more specific alphabet: In [13]:.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found