Skip to content

create-screen writes identical data to edits and X_bcmatch layers when both -e and -b are provided #50

Description

@Shisheng-Huang

Hi BEAN developers,
I think I found a possible issue with bean create-screen after the recent addition of -b/--X-bcmatch.
When I run:

bean create-screen
-e edit.counts.csv
-b var_mini_counts.csv
var_mini_guides.csv
sample_list_survival.csv
var_mini_counts.csv

the generated .h5ad contains both edits and X_bcmatch layers, but both layers appear to contain the same data from var_mini_counts.csv.

I suspect the issue is in perturb_tools/_readwrite/_funcs/_read_screen_from_csvs.py, inside read_csvs(). When layers_filenames_dict contains multiple layer files, the code appears to read each file in a loop but stores the result in the same variable, layer_df. Later, when constructing the final layers_dict, this last layer_df may be reused for all layer keys. As a result, if both "edits" and "X_bcmatch" are provided, both layers end up containing the data from the last loaded file, which in my case is X_bcmatch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions