Skip to content

Error with low amount of variant sites #3

@pgcudahy

Description

@pgcudahy

I've been getting errors with a few samples saying

Traceback (most recent call last):
  File "/home/pgcudahy/ngs-tools/SplitStrains/splitStrains.py", line 925, in <module>
    writeResult(bamFilePath, LR , thresh, alpha_level, [1])
NameError: name 'LR' is not defined

I think this issue is that with low variation samples, writeResult is called with LR as a parameter, but LR isn't defined until after the call.

# call single strain if not enough variation is found
    if len(freqVec) < 5:
        logging.info(f'Not enough variant sites.')
        writeResult(bamFilePath, LR , thresh, alpha_level, [1])
        exit()

# test null and alt hypthesis
    thresh, LR = likelyhood_ratio_test(freqVec, alpha_level, upperLimit, num_iter, init_p, init_err)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions