Skip to content

Potential Bug in Infer Doublets #313

@hl-xue

Description

@hl-xue

Hello,

Thanks for the nice package!

I would like to report a potential bug in the pegasus.infer_doublets() method.

According to what I understood, before _run_scrublet is called, the identify_robust_genes, log_norm and highly_variable_features are required.
This works correctly if the channel_attr is given.

However, if the channel_attr is not given, it seems that the three required steps are skipped, as indicated below (extracted from here).

if channel_attr is None:
        if data.shape[0] >= min_cell:
            fig = _run_scrublet(data, raw_mat_key, expected_doublet_rate = expected_doublet_rate, sim_doublet_ratio = sim_doublet_ratio, \
                                n_prin_comps = n_prin_comps, k = k, n_jobs = n_jobs, random_state = random_state, plot_hist = if_plot, manual_correction = mancor.get('', None))
            if if_plot:
                fig.savefig(f"{plot_hist}.dbl.png")
        else:
            logger.warning(f"Data has {data.shape[0]} < {min_cell} cells and thus doublet score calculation is skipped!")
            data.obs["doublet_score"] = 0.0
            data.obs["pred_dbl"] = False
    else:
            #(omitted)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions