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

Solving the issue of ZeroDivisionError #358

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/sniffles/consensus.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,9 @@ def novel_from_reads(best_lead,other_leads,klen,skip,skip_repetitive,debug=False
conseq_new.append("-"*len(buffer))
conseq="".join(conseq_new)

if span/float(len(best_lead.seq)) > minspan:
alignments.append(conseq)
if float(len(best_lead.seq))>0 :
if span/float(len(best_lead.seq)) > minspan:
alignments.append(conseq)

maxal=1
for i in range(len(best_lead.seq)):
Expand Down
14 changes: 8 additions & 6 deletions src/sniffles/postprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,15 +170,17 @@ def qc_sv(svcall,config):
if stdev_pos > config.qc_stdev_abs_max:
svcall.filter="STDEV_POS"
return False
if svcall.svtype!="BND" and stdev_pos / abs(svcall.svlen) > 2.0:
svcall.filter="STDEV_POS"
return False
if abs(svcall.svlen)>0:
if svcall.svtype!="BND" and stdev_pos / abs(svcall.svlen) > 2.0:
svcall.filter="STDEV_POS"
return False

stdev_len = svcall.get_info("STDEV_LEN")
if stdev_len != None:
if svcall.svtype != "BND" and stdev_len / abs(svcall.svlen) > 1.0:
svcall.filter="STDEV_LEN"
return False
if abs(svcall.svlen)>0:
if svcall.svtype != "BND" and stdev_len / abs(svcall.svlen) > 1.0:
svcall.filter="STDEV_LEN"
return False
if stdev_len > config.qc_stdev_abs_max:
svcall.filter="STDEV_LEN"
return False
Expand Down