Porthmeus / MeMoMe

Metabolic Model Merging - a semiautomated way to merge genome scale metabolic models
Apache License 2.0
0 stars 0 forks source link

Properly implement 1toMany matching or the prevention of it #108

Closed Unaimend closed 3 months ago

Unaimend commented 3 months ago

Currently one metabolite from the left model can have multiple matches from the right model. Add a column that is called "one to many" or sth like that that signifies that this match was one to many

Unaimend commented 3 months ago

As a test case merge one of karlis models against itself. I still got one to many matches

Unaimend commented 3 months ago
    import time

    # Record the start time
    start_time = time.time()
    # test the comparison for metabolite matching
    mod_path = dat.joinpath("MYb11_iCEL1314/M1_MYb11.xml")
    mod_path2 = dat.joinpath("MYb11_iCEL1314/M2_iCEL1314.xml")
    mod = MeMoModel.fromPath(mod_path)
    mod2 = MeMoModel.fromPath(mod_path2)

    print(len(mod.cobra_model.metabolites))
    print(len(mod2.cobra_model.metabolites))

    # self comparison
    res = mod.match(mod)
    res.to_csv("stuff.csv")
    end_time = time.time()

    # Calculate the elapsed time
    elapsed_time = end_time - start_time

    print("Elapsed time:", elapsed_time, "seconds")

if __name__ == '__main__':
    test_MeMoModelCompare2()
Unaimend commented 3 months ago

image

Unaimend commented 3 months ago

There are still one to many matches