Ejemplo n.º 1
0
    def search_measures(self, study_wrapper, instrument, search_term):
        dbfile = self.get_pheno_dbfile(study_wrapper)
        db = DbManager(dbfile=dbfile)
        db.build()

        measures = db.search_measures(instrument, search_term)

        for m in measures:
            if m["values_domain"] is None:
                m["values_domain"] = ""
            m["measure_type"] = m["measure_type"].name

            m["regressions"] = []
            regressions = db.get_regression_values(m["measure_id"]) or []

            for reg in regressions:
                reg = dict(reg)
                if isnan(reg["pvalue_regression_male"]):
                    reg["pvalue_regression_male"] = "NaN"
                if isnan(reg["pvalue_regression_female"]):
                    reg["pvalue_regression_female"] = "NaN"
                m["regressions"].append(reg)

            yield {
                "measure": m,
            }
Ejemplo n.º 2
0
def test_search_measures_get_all(fake_phenotype_data_browser_dir):
    db = DbManager(fake_phenotype_data_browser_dir)
    assert db is not None
    db.build()
    assert len(list(db.search_measures())) == 15