Skip to content

UnboundLocalError: local variable 'region' referenced before assignment #6

@zkstewart

Description

@zkstewart

Trying to use the program returns the error in the title. The cause appears to be in genotype.py at line 40:

def main(Data,GC_hist,args):
    #get the coverage across the region

    coverage_list=[]
    len_list=[]
    gc_list=[]
    ref_list=[]
    total_bin_list=[]
    bin_count = 0
    used_bin_count = 0
    
    operations=[]
    if args.region:
        for line in open(args.region):
            mode,regions = retrieve_regions(line)
            operations.append({"mode": mode, "regions":regions,"command":line.strip()})
    else:
    
        chromosome=region.split(":")[0]

The chromosome=region.split(":")[0] line fails because it calls region (which has not been defined yet) rather than args.region as it's likely meant to.

Edit: It should be args.R not args.region.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions