diff --git a/deeprvat/annotations/annotations.py b/deeprvat/annotations/annotations.py index 83c76e7d..f8894184 100644 --- a/deeprvat/annotations/annotations.py +++ b/deeprvat/annotations/annotations.py @@ -2031,7 +2031,10 @@ def create_gene_id_file(gtf_filepath: str, out_file: str): @click.argument("out_file", type=click.Path()) @click.option("--keep_unfilled", type=click.Path(), default=None) def select_rename_fill_annotations( - annotation_columns_yaml_file: str, annotations_path: str, out_file: str, keep_unfilled: str + annotation_columns_yaml_file: str, + annotations_path: str, + out_file: str, + keep_unfilled: str, ): """ Select, rename, and fill missing values in annotation columns based on a YAML configuration file. @@ -2054,7 +2057,8 @@ def select_rename_fill_annotations( annotations_path, columns=list(set(prior_names + key_cols)) ) anno_df.rename(columns=column_name_mapping, inplace=True) - if (keep_unfilled is not None): anno_df.to_parquet(keep_unfilled) + if keep_unfilled is not None: + anno_df.to_parquet(keep_unfilled) anno_df.fillna(fill_value_mapping, inplace=True) anno_df.to_parquet(out_file) diff --git a/tests/annotations/test_annotations.py b/tests/annotations/test_annotations.py index eb9d1d03..82dce87f 100644 --- a/tests/annotations/test_annotations.py +++ b/tests/annotations/test_annotations.py @@ -735,6 +735,7 @@ def test_select_rename_fill_annotations( written_results, expected_results[written_results.columns], check_exact=False ) + @pytest.mark.parametrize( "test_data_name_dir, yaml_file, annotations, expected, expected_unfilled", [ @@ -766,8 +767,7 @@ def test_select_rename_fill_annotations_unfilled( annotations_path.as_posix(), output_path.as_posix(), "--keep_unfilled", - unfilled_path - + unfilled_path, ] result = cli_runner.invoke(annotations_cli, cli_parameters, catch_exceptions=False) assert result.exit_code == 0 @@ -780,7 +780,9 @@ def test_select_rename_fill_annotations_unfilled( written_results, expected_results[written_results.columns], check_exact=False ) assert written_unfilled.shape == expected_unfilled.shape - assert_frame_equal(written_unfilled, expected_unfilled[written_unfilled.columns],check_exact=False) + assert_frame_equal( + written_unfilled, expected_unfilled[written_unfilled.columns], check_exact=False + ) @pytest.mark.parametrize(