broadinstitute / pooled-cell-painting-profiling-recipe

:woman_cook: Recipe repository for image-based profiling of Pooled Cell Painting experiments
BSD 3-Clause "New" or "Revised" License
6 stars 4 forks source link

Error message for missing control_barcodes in 1.process-spots #12

Closed ErinWeisbart closed 4 years ago

ErinWeisbart commented 4 years ago

In 1.process-spots at this point:

    # Number of non-targetting controls
    num_nt = passed_gene_df.query(
        f"{gene_cols[0]} in @control_barcodes"
    ).Cell_Count_Per_Gene.values[0]

it will error if there are no non-targeting controls at a site. This can happen because 1) biologically, the site actually doesn't contain control_barcodes, or 2) the barcodes you have listed in your config file don't match what is used in the experiment for control_barcodes.

Add in an error message to explain this, ideally parsing between the conditions.

gwaybio commented 4 years ago

Amazing find! Thanks for documenting this. One thing that would amp the value of this issue up is to also include the error message you received that led you to discover the bug. (no need to do now, I just fixed this)

gwaybio commented 4 years ago

btw, the solution in bc6dbae2a12b34522e45e3c475b1f042a5714642 also solves the problem of counting NT barcodes when there are more than one kind