forked from daviddaiweizhang/fraposa
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Find a better way to handle this, the try/except patter seems to throw an error:
fraposa_pgsc/fraposa_pgsc/fraposa.py
Lines 523 to 529 in 4901a20
| try: | |
| variants: Variants = compare_variants(ref_variants=X_bim, study_variants=W_bim) | |
| except NameError: | |
| with open(ref_filepref + '_vars.dat', 'r') as infile: | |
| ref_vars = infile.read().strip().split('\n') | |
| stu_vars = bim_varlist(W_bim) | |
| variants: Variants = compare_variants(ref_variants=ref_vars, study_variants=stu_vars) |
Error:
Traceback (most recent call last):
File "/venv/lib/python3.10/site-packages/fraposa_pgsc/fraposa.py", line 524, in pca
variants: Variants = compare_variants(ref_variants=X_bim, study_variants=W_bim)
UnboundLocalError: local variable 'X_bim' referenced before assignment
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/venv/bin/fraposa", line 8, in <module>
sys.exit(main())
File "/venv/lib/python3.10/site-packages/fraposa_pgsc/fraposa_runner.py", line 56, in main
fp.pca(ref_filepref=ref_filepref, stu_filepref=stu_filepref, stu_filt_iid=stu_filt_iid, out_filepref=out_filepref,
File "/venv/lib/python3.10/site-packages/fraposa_pgsc/fraposa.py", line 529, in pca
variants: Variants = compare_variants(ref_variants=ref_vars, study_variants=stu_vars)
File "/venv/lib/python3.10/site-packages/fraposa_pgsc/fraposa.py", line 191, in compare_variants
stu_indexed: list[int] = [ref_indexed[variant] for variant in stu_vars]
File "/venv/lib/python3.10/site-packages/fraposa_pgsc/fraposa.py", line 191, in <listcomp>
stu_indexed: list[int] = [ref_indexed[variant] for variant in stu_vars]
KeyError: '1:255633:A:G'
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels