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

bug in examples/creating-a-variant.ipynb #541

Open
reece opened this issue Dec 18, 2018 · 0 comments
Open

bug in examples/creating-a-variant.ipynb #541

reece opened this issue Dec 18, 2018 · 0 comments
Labels
bug Something isn't working

Comments

@reece
Copy link
Member

reece commented Dec 18, 2018

creating-a-variant.ipynb used to have:

var2 = copy.deepcopy(var)
var2.posedit.pos.end.uncertain=True
str(var2)

which resulted in

HGVSUnsupportedOperationError             Traceback (most recent call last)
<ipython-input-15-46125b6620a4> in <module>()
      1 var2 = copy.deepcopy(var)
      2 var2.posedit.pos.end.uncertain=True
----> 3 str(var2)

/home/reece/projects/biocommons/hgvs/hgvs/sequencevariant.py in format(self, conf)
     33         """
     34         if self.posedit is not None:
---> 35             posedit = self.posedit.format(conf)
     36         else:
     37             posedit = "?"

/home/reece/projects/biocommons/hgvs/hgvs/posedit.py in format(self, conf)
     27             rv = str(self.edit.format(conf))
     28         else:
---> 29             rv = "{pos}{edit}".format(pos=self.pos.format(conf), edit=self.edit.format(conf))
     30 
     31         if self.uncertain:

/home/reece/projects/biocommons/hgvs/hgvs/location.py in format(self, conf)
    313         if self.start is None:
    314             return ""
--> 315         if self.end is None or self.start == self.end:
    316             return self.start.format(conf)
    317         iv = self.start.format(conf) + "_" + self.end.format(conf)

/home/reece/projects/biocommons/hgvs/hgvs/location.py in __eq__(lhs, rhs)
    169         assert type(lhs) == type(rhs), "Cannot compare coordinates of different representations"
    170         if lhs.uncertain or rhs.uncertain:
--> 171             raise HGVSUnsupportedOperationError("Cannot compare coordinates of uncertain positions")
    172         return lhs.datum == rhs.datum and lhs.base == rhs.base and lhs.offset == rhs.offset
    173 

HGVSUnsupportedOperationError: Cannot compare coordinates of uncertain positions

Setting var2.posedit.pos.end.uncertain=True was removed in order to fix the notebook. We should restore it when the bug is fixed.

@reece reece added the bug Something isn't working label Jun 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant