NUStatBioinfo / DegNorm

Normalizing RNA degradation in RNA-seq data
https://nustatbioinfo.github.io/DegNorm/
3 stars 1 forks source link

Recurring error: UnboundLocalError: local variable 'augment' referenced before assignment #21

Closed BMBlobner closed 5 years ago

BMBlobner commented 5 years ago

I am running DegNorm 0.1.4 using Python 3.6 with .bam and accompanying .bai files as inputs. DegNorm repeatedly errors in the same place: File "/opt/anaconda3/envs/degnorm/lib/python3.6/site-packages/DegNorm-0.1.4-py3.6.egg/degnorm/reads.py", line 48, in cigar_segment_bounds if augment: which results in the UnboundLocalError: local variable 'augment' referenced before assignment. In line 48 of reads.py, it appears that the if statement should be referring to another variable, possibly segment[0] before assigning augment as False. Any guidance to correct this issue would be very much appreciated.

ffineis commented 5 years ago

Thanks for using! This error is due to the (probably erroneous) assumption that all CIGAR strings would lead with a matching section (e.g. "34M15I10D15M" or "100M"). I take it you have an alignment file with "hard clipping" (https://www.drive5.com/usearch/manual/cigar.html) so that an alignment can actually start with a missing chunk?

ffineis commented 5 years ago

Ok we have a hotfix on the hotfix/hard_clipping branch - hoping this fixes the issue. You can either reinstall from that branch:

pip uninstall degnorm
rm -rf DegNorm.egg-info build dist
git checkout -b hotfix/hard_clipping
git pull origin hard_clipping
./install

or I can just merge hotfix/hard_clipping into master and you can reinstall from master.

BMBlobner commented 5 years ago

Thank you. DegNorm is currently running for me after reinstalling with the fix. I will provide an update and close the issue once the run is complete.

ffineis commented 5 years ago

Excellent, thanks for the update.