bailey-lab / MIPTools

A suite of computational tools used for molecular inversion probe design, data processing, and analysis.
https://miptools.readthedocs.io
MIT License
6 stars 9 forks source link

Test data set analysis crashes #30

Open arisp99 opened 2 years ago

arisp99 commented 2 years ago

Bug Description

The current test analysis template found here is currently outdated. Due to changes in pandas, one of the code chunks in the call genotypes and prevalences section will crash:

mutant_index = targeted_prev.columns.droplevel(["Gene", "Mutation Name", "ExonicFunc"])
expected_freq = expected_freq.loc[mutant_index]
i_map = {(i[0], i[4]): i for i in targeted_prev.columns}
expected_freq.index = pd.MultiIndex.from_tuples(
    [i_map[i] for i in expected_freq.index],
    names=targeted_prev.columns.names)
expected_freq.fillna(0, inplace=True)

#> KeyError: "Passing list-likes to .loc or [] with any missing labels is no longer supported. See https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#deprecate-loc-reindex-listlike

Updating the Test Data Analysis

Comparing the analysis of test data set file with the current analysis template the files are quite different from one another. It may be worthwhile to update the test data analysis file using the provided template. This would go hand in hand with the efforts in 69ff95fed4510f7ea3eb456eed8af5eb3d6ae69a which provides improved documentation on analyzing the test data.