biocommons/hgvs

Babelfish.hgvs_to_vcf tests against length_change signature not method result

Closed this issue · 1 comments

hgvs.posedit.PosEdit.length_change is a method, while hgvs.extras.babelfish.Babelfish.hgvs_to_vcf

performs a test against the signature:

if end_i - start_i == 1 and vleft.posedit.length_change == 0:

So this always fails. This makes a conversion wrong, eg one output is:

assert _h2v("NC_000006.12:g.49949407A>T") == ('6', 49949406, 'AA', 'AT', 'sub')

Fix is to basically add a method call, ie:

if end_i - start_i == 1 and vleft.posedit.length_change() == 0:

It's also hardcoded for GRCh38, ie doesn't use the passed assembly_name.

I'll make a pull request for these fixes shortly

Hi - I'm going to close this, and implement a pull request under #447