Skip to content

UnboundLocalError #18

@kzb193

Description

@kzb193

Hello Dr. Ma,

I want to apply CalicoST on a Visium sample, and I have annotations for the normal spots. I encountered errors in each of the following two cases.

  1. tumor purity estimation module (normalidx_file : None)
  2. infer CNAs and clones with the annotations (tumorprop_file : None)

Interestingly, the 'infer CNAs and clones' step finished successfully without estimating tumor proportions and without the annotations.
Here are some details on the errors.

Error message from case 1

Traceback (most recent call last):
File "/net/mulan/home/kalinsba/apps/CalicoST/src/calicost/estimate_tumor_proportion.py", line 120, in
main(args.configfile)
File "/net/mulan/home/kalinsba/apps/CalicoST/src/calicost/estimate_tumor_proportion.py", line 101, in main
loh_states, is_B_lost, rdr_values, clones_hightumor = identify_loh_per_clone(single_X, combined_assignment, combined_pred_cnv, combined_p_binom, normal_candidate, single_total_bb_RD)
File "/net/mulan/home/kalinsba/apps/CalicoST/src/calicost/utils_hmrf.py", line 623, in identify_loh_per_clone
return loh_states, is_B_lost, rdr_values[loh_states], clones_hightumor
UnboundLocalError: local variable 'loh_states' referenced before assignment

Error message from case 2

/net/mulan/home/kalinsba/apps/CalicoST/src/calicost/hmm_NB_BB_phaseswitch.py:650: RuntimeWarning: invalid value encountered in divide
lambd = np.sum(base_nb_mean, axis=1) / np.sum(base_nb_mean)
Traceback (most recent call last):
File "/net/mulan/home/kalinsba/apps/CalicoST/src/calicost/calicost_main.py", line 444, in
main(args.configfile)
File "/net/mulan/home/kalinsba/apps/CalicoST/src/calicost/calicost_main.py", line 138, in main
index_normal = np.where(normal_candidate)[0]
UnboundLocalError: local variable 'normal_candidate' referenced before assignment

Can you please help?

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