monarch-initiative / pheval.exomiser

Exomiser plugin for PhEval.
4 stars 1 forks source link

Avoid index usage in phenopackets_dir during batch file preparation #39

Closed souzadevinicius closed 1 year ago

souzadevinicius commented 1 year ago

This code in run.py file:

        phenopacket_dir=Path(testdata_dir).joinpath(
            [
                directory
                for directory in os.listdir(str(testdata_dir))
                if "phenopackets" in str(directory)
            ][0]
        ),

Raises an out-of-index error when there's no phenopackets folder inside passed by test_dir parameter. Following the pheval's new corpora directory structure, this scenario can be prevented by using a strategy similar to this one:

        phenopacket_dir=Path(testdata_dir).joinpath("phenopackets")