laminlabs / bionty-base

Access public biological ontologies.
https://bionty-base.lamin.ai
Apache License 2.0
16 stars 2 forks source link

KeyError for fuzzy_match #427

Closed Zethson closed 1 year ago

Zethson commented 1 year ago

disease_bionty.fuzzy_match("Multiple sclerosis", field=disease_bionty.name)

and

disease_bionty.fuzzy_match("Multiple sclerosis", field=disease_bionty.name, case_sensitive=False)

result in

KeyError: '["N,N\'-diphenylthiourea allergic contact dermatitis|N,N\'-diethylthiourea allergic contact dermatitis", \'Aarskog syndrome|X-linked Aarskog syndrome\', \'spermatogenic failure 16|male infertility due to acephalic spermatozoa\', \'chromosome 22q11.2 deletion syndrome, distal|DiGeorge syndrome\', \'muscular dystrophy-dystroglycanopathy type B1|muscular dystrophy-dystroglycanopathy\', \'syndactyly|syndactyly type 1\', \'exercise-induced bronchoconstriction|asthma\', \'autosomal recessive limb-girdle muscular dystrophy type 2N|muscular dystrophy-dystroglycanopathy type C8\', \'dengue shock syndrome|46,XY sex reversal 2\', \'proliferative diabetic retinopathy|X-linked reticulate pigmentary disorder\', \'Kagami-Ogata syndrome|Kaufman oculocerebrofacial syndrome\', \'amelogenesis imperfecta type 3|amelogenesis imperfecta type 3A\'] not in index'

Zethson commented 1 year ago
celltype_bionty = bt.CellType()
celltype_bionty.fuzzy_match("gamma delta T cell", celltype_bionty.name)

however works as advertised

sunnyosun commented 1 year ago

Thank you for catching it! Fixed here and added your example to tests: https://github.com/laminlabs/bionty/pull/429