Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot access local variable 'leftcheck' where it is not associated with a value #28

Closed
xiekunwhy opened this issue Nov 12, 2024 · 3 comments · Fixed by #29
Closed

cannot access local variable 'leftcheck' where it is not associated with a value #28

xiekunwhy opened this issue Nov 12, 2024 · 3 comments · Fixed by #29

Comments

@xiekunwhy
Copy link

Describe the bug
v0.0.5 error

/public2/home/sl_qybio/sl_qybio/miniforge3/envs/samtools/bin/samtools view -@ 10 -h -F 0x100 /public2/home/sl_qybio/sl_qybio/project/2024/QY240622GA064_GangLiu_T2T/QY240622GA064_std_2_assemble/t2t/03.telomere/hifisplit/Chr01.sortn.bam|/public2/home/sl_qybio/sl_qybio/miniforge3/envs/teloclip/bin/teloclip --motifs CCCTAAA --refIdx /public2/home/sl_qybio/sl_qybio/project/2024/QY240622GA064_GangLiu_T2T/QY240622GA064_std_2_assemble/t2t/03.telomere/pse.gapfill.fa.fai|/public2/home/sl_qybio/sl_qybio/miniforge3/envs/samtools/bin/samtools sort > /public2/home/sl_qybio/sl_qybio/project/2024/QY240622GA064_GangLiu_T2T/QY240622GA064_std_2_assemble/t2t/03.telomere/hifisoftclip/Chr01.overhangs.bam
Traceback (most recent call last):
  File "/public2/home/sl_qybio/sl_qybio/miniforge3/envs/teloclip/bin/teloclip", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/public2/home/sl_qybio/sl_qybio/miniforge3/envs/teloclip/lib/python3.12/site-packages/teloclip/app.py", line 138, in main
    processSamlines(
  File "/public2/home/sl_qybio/sl_qybio/miniforge3/envs/teloclip/lib/python3.12/site-packages/teloclip/samops.py", line 105, in processSamlines
    if isMotifInClip(
       ^^^^^^^^^^^^^^
  File "/public2/home/sl_qybio/sl_qybio/miniforge3/envs/teloclip/lib/python3.12/site-packages/teloclip/seqops.py", line 152, in isMotifInClip
    return any(leftcheck, rightcheck)
               ^^^^^^^^^
UnboundLocalError: cannot access local variable 'leftcheck' where it is not associated with a value

but v0.0.4 run successfully.

/public2/home/sl_qybio/sl_qybio/miniforge3/envs/samtools/bin/samtools view -@ 10 -h -F 0x100 /public2/home/sl_qybio/sl_qybio/project/2024/QY240622GA064_GangLiu_T2T/QY240622GA064_std_2_assemble/t2t/03.telomere/hifisplit/Chr01.sortn.bam|/public2/home/sl_qybio/sl_qybio/miniforge3/envs/teloclip/bin/teloclip --motifs CCCTAAA --refIdx /public2/home/sl_qybio/sl_qybio/project/2024/QY240622GA064_GangLiu_T2T/QY240622GA064_std_2_assemble/t2t/03.telomere/pse.gapfill.fa.fai|/public2/home/sl_qybio/sl_qybio/miniforge3/envs/samtools/bin/samtools sort > /public2/home/sl_qybio/sl_qybio/project/2024/QY240622GA064_GangLiu_T2T/QY240622GA064_std_2_assemble/t2t/03.telomere/hifisoftclip/Chr01.overhangs.bam
Processed 243435 SAM records.
Found 1 alignments soft-clipped at contig ends.
Output 1 alignments containing motif matches.
Discarded 170105 terminal alignments after filtering.

Best,
Kun

@Adamtaranto
Copy link
Owner

Hi Kun,

Thanks for reporting this. I'll look into it!

If you could provide a single contig with associated reads in sam/bam format that reproduces this error that would be useful for debugging.

@Adamtaranto
Copy link
Owner

@xiekunwhy, can you please re-install teloclip from the patch branch and let me know if it runs AND if it gives you the same output as for v0.0.4 ?

# Uninstall current version
pip uninstall teloclip

# Install from patch branch
pip install git+https://github.com/adamtaranto/teloclip.git@patch_missing_overhangs

@xiekunwhy
Copy link
Author

Yes, it works.

/public2/home/sl_qybio/sl_qybio/miniforge3/envs/samtools/bin/samtools view -@ 10 -h -F 0x100 hifisplit/Chr01.sortn.bam |/public2/home/sl_qybio/sl_qybio/miniforge3/envs/teloclip/bin/teloclip --motifs CCCTAAA --refIdx ../pse.gapfill.fa.fai |/public2/home/sl_qybio/sl_qybio/miniforge3/envs/samtools/bin/samtools sort > hifisoftclip/Chr01.overhangs.bam
2024-11-13 09:33:11,112 | INFO | samops:122:processSamlines() | Processed 243435 SAM records.
Found 1 alignments soft-clipped at contig ends.
Output 1 alignments containing motif matches.
Discarded 170105 terminal alignments after filtering.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants