Skip to content

Commit

Permalink
remove logging
Browse files Browse the repository at this point in the history
  • Loading branch information
jodyphelan committed Oct 23, 2024
1 parent ca1c11d commit 0e11419
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scripts/realign_tandem_deletions.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ def check_coordinates(var: pysam.VariantRecord,refseq: pysam.FastaFile, directio
return original_tuple
nextseq = refseq.fetch(var.chrom, start-svlen, start-1)
if deleted_seq == nextseq:
logging.info((svlen,deleted_seq,nextseq))
logging.info(f"Deletion {var.chrom}:{start}-{end} is a tandem repeat")
logging.debug((svlen,deleted_seq,nextseq))
logging.debug(f"Deletion {var.chrom}:{start}-{end} is a tandem repeat")
if direction == "right":
last_del_nuc = deleted_seq[-1]
ref = last_del_nuc + deleted_seq
Expand All @@ -58,7 +58,7 @@ def check_coordinates(var: pysam.VariantRecord,refseq: pysam.FastaFile, directio
alt = first_del_nuc
return start-svlen+1, start, ref, (alt,)
else:
logging.info(f"Deletion {var.chrom}:{start}-{end} is not a tandem repeat")
logging.debug(f"Deletion {var.chrom}:{start}-{end} is not a tandem repeat")
return original_tuple

vcf_in = pysam.VariantFile(args.input)
Expand All @@ -82,7 +82,7 @@ def check_coordinates(var: pysam.VariantRecord,refseq: pysam.FastaFile, directio
gene_ends_list = gene_ends[var.chrom]
gene_end_index = bisect.bisect_left(gene_ends_list, var.start)
if gene_ends_list[gene_end_index] > var.start and gene_ends_list[gene_end_index] < var.stop:
logging.info(f"Variant overlaps with gene end {genes[gene_end_index].name}")
logging.debug(f"Variant overlaps with gene end {genes[gene_end_index].name}")
direction = "right" if genes[gene_end_index].strand == "+" else "left"
start,end,ref,alts = check_coordinates(var,refseq,direction)
var.start = start
Expand Down

0 comments on commit 0e11419

Please sign in to comment.