CSBiology / OBO.NET

An OBO file format parser, written in F#.
MIT License
3 stars 1 forks source link

[BUG] `OboTerm.GetChildOntologyAnnotations` does not return all children #8

Open omaus opened 1 year ago

omaus commented 1 year ago

Try this:

let testTerms = [
    OboTerm.Create("test:000", Name = "test0")
    OboTerm.Create("test:001", Name = "test1a", IsA = ["test:000"])
    OboTerm.Create("test:002", Name = "test2", IsA = ["test:001"])
    OboTerm.Create("test:003", Name = "test1b", IsA = ["test:000"])
]

let testOntology = OboOntology.create testTerms []

testOntology.GetChildOntologyAnnotations(testTerms.Head.Id)

(Looks like this in a tree diagram:)

     test0
    /     \
test1a    test1b
   |
 test2

It should return "test1a", "test2", and "test1b" but the last one is missing.

If used with a first depth, it works:

testOntology.GetChildOntologyAnnotations(testTerms.Head.Id, Depth = 1)

If used with depth one level deeper, it again fails:

testOntology.GetChildOntologyAnnotations(testTerms.Head.Id, Depth = 2)

Prolly cause the algorithm goes as deep as possible and stops there. It is not capable of going back, so to speak.

omaus commented 1 year ago

@HLWeil Might be more interesting for you than for me since ISA.NET might use this functionality. 😬

HLWeil commented 1 year ago

Yeah this is important for value querying. QueryModel in ISADotNet but not yet implemented in ARCtrl. Will get back to this Issue when I start working on that.