Skip to content

UnboundLocalError when running liftover despite providing valid input files #296

Description

@Mannyari

Hi,

I'm trying to perform a liftover using a PLINK map file, but I keep getting an error (regardless of whether I installed plinkliftover via pip or directly from GitHub):
UnboundLocalError: cannot access local variable 'lift_over_path' where it is not associated with a value.

My command is
plinkliftover liftover --prefix updated to_update.map hg38ToHg19.over.chain.gz
Both to_update.map and hg38ToHg19.over.chain.gz are in the folder.

I'm using Linux, and the Python version is 3.12.10.

Here's the error:
2025-07-30 16:59:57.266 | INFO | plinkliftover.map2bed:map2bed:17 - fin: to_update.map, fout: to_update.bed
Converting MAP file to_update.map file to UCSC BED file to_update.bed...
100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 8,153,588/8,153,588 [ 0:06:35 < 0:00:00 , 20,444 it/s ]
╭─────────────────────────────────────────────────────────────────────────────────── Traceback (most recent call last) ───────────────────────────────────────────────────────────────────────────────────╮
│ /dati/archivio_ricerca_2/anaconda/anaconda_arianna/envs/snakemake/lib/python3.12/site-packages/plinkliftover/main.py:88 in liftover │
│ │
│ 85 │ │ fin=oldbed, ╭────────────────────────── locals ──────────────────────────╮ │
│ 86 │ │ fout=newbed, │ chainfile = PosixPath('hg38ToHg19.over.chain.gz') │ │
│ 87 │ │ chainfile=chainfile, │ datfile = None │ │
│ ❱ 88 │ │ lift_over_path=lift_over_path, │ liftoverexecutable = None │ │
│ 89 │ ) │ lop = None │ │
│ 90 │ │ mapfile = PosixPath('to_update.map') │ │
│ 91 │ if lb_status: │ newbed = PosixPath('to_update.map.bed') │ │
│ │ oldbed = PosixPath('to_update.bed') │ │
│ │ pedfile = None │ │
│ │ prefix = 'updated' │ │
│ │ version = None │ │
│ ╰────────────────────────────────────────────────────────────╯ │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
UnboundLocalError: cannot access local variable 'lift_over_path' where it is not associated with a value

Could you help me?

Best,
A

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions