Skip to content

UnboundLocalError for variable error_rate in assign_population_pcs from sample_qc.ancestry #450

@LindoNkambule

Description

@LindoNkambule

Hi,

I am trying to use the assign_population_pcs function and getting a UnboundLocalError: local variable 'error_rate' referenced before assignment error. Looking at the code, this error makes sense as I'm already supplying a fit, so error_rate is not set as the code block inside if not fit: is not evaluated. Then when it gets to if hail_input: it throws the error because error_rate isn't defined in my case.

This is the code that resulted in the error:

ht, rf_model = assign_population_pcs(
    ht,
    pc_cols=ht.scores,
    fit=fit,
)

@jkgoodrich @klaricch

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