def test_annotate_pheno_mismatching_counts(self): pheno_df = DataFrame() pheno_df['CellType'] = ["Microglia", "Macrophage"] pheno_df['Donor'] = ["Donor A", "Donor A"] exprs_data = parse_gct("test_data/ds/dummy/small.gct") with pytest.raises(ROGERUsageError): annotate_ds_pheno_data(exprs_data, pheno_df)
def test_annotate_pheno_with_no_pheno(self): expected_df = DataFrame() expected_df['SAMPLE'] = ["A", "B", "C"] exprs_data = parse_gct("test_data/ds/dummy/small.gct") annotated_pheno = annotate_ds_pheno_data(exprs_data) assert_frame_equal(annotated_pheno, expected_df)
def test_annotate_pheno_witn_simple_pheno(self): pheno_df = DataFrame() pheno_df['CellType'] = ["Microglia", "Macrophage", "Macrophage"] pheno_df['Donor'] = ["Donor A", "Donor A", "Donor A"] expected_df = DataFrame() expected_df['SAMPLE'] = ["A", "B", "C"] expected_df['CellType'] = ["Microglia", "Macrophage", "Macrophage"] expected_df['Donor'] = ["Donor A", "Donor A", "Donor A"] exprs_data = parse_gct("test_data/ds/dummy/small.gct") annotated_pheno = annotate_ds_pheno_data(exprs_data, pheno_df) assert_frame_equal(annotated_pheno, expected_df)