Skip to content

Commit 0b8bac5

Browse files
committed
Contig stitcher: improve log messages
1 parent ebe1e9e commit 0b8bac5

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

micall/core/contig_stitcher.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,9 @@ def cut_reference(self, cut_point: float) -> Tuple['AlignedContig', 'AlignedCont
9090
left = replace(self, name=context.get().generate_new_name(), alignment=alignment_left)
9191
right = replace(self, name=context.get().generate_new_name(), alignment=alignment_right)
9292

93-
logger.debug("Created contigs %r at %s and %r at %s by cutting %r.",
94-
left.name, left.alignment, right.name, right.alignment, self.name)
93+
logger.debug("Created contigs %r at %s and %r at %s by cutting %r at %s at cut point = %s.",
94+
left.name, left.alignment, right.name, right.alignment,
95+
self.name, self.alignment, round(cut_point, 1))
9596
context.get().emit(events.Cut(self, left, right))
9697

9798
return (left, right)
@@ -107,9 +108,9 @@ def lstrip(self) -> 'AlignedContig':
107108
q_remainder, query = self.cut_query(alignment.q_st - 0.5)
108109
alignment = alignment.translate(0, -1 * alignment.q_st)
109110
result = AlignedContig.make(query, alignment, self.strand)
110-
logger.debug("Doing lstrip of %r resulted in %r, so %s (len %s) became %s (len %s)",
111-
self.name, result.name, self.alignment,
112-
len(self.seq), result.alignment, len(result.seq))
111+
logger.debug("Doing lstrip of %r at %s (len %s) resulted in %r at %s (len %s).",
112+
self.name, self.alignment, len(self.seq),
113+
result.name, result.alignment, len(result.seq))
113114
context.get().emit(events.LStrip(self, result))
114115
return result
115116

@@ -123,9 +124,9 @@ def rstrip(self) -> 'AlignedContig':
123124
alignment = self.alignment.rstrip_reference().rstrip_query()
124125
query, q_remainder = self.cut_query(alignment.q_ei + 0.5)
125126
result = AlignedContig.make(query, alignment, self.strand)
126-
logger.debug("Doing rstrip of %r resulted in %r, so %s (len %s) became %s (len %s)",
127-
self.name, result.name, self.alignment,
128-
len(self.seq), result.alignment, len(result.seq))
127+
logger.debug("Doing rstrip of %r at %s (len %s) resulted in %r at %s (len %s).",
128+
self.name, self.alignment, len(self.seq),
129+
result.name, result.alignment, len(result.seq))
129130
context.get().emit(events.RStrip(self, result))
130131
return result
131132

@@ -611,14 +612,13 @@ def try_split(contig):
611612
contigs.append(right_part)
612613
process_queue.put(right_part)
613614

614-
logger.debug("Split contig %r around its gap at [%s, %s]->[%s, %s]. "
615-
"Left part: %r at [%s, %s]->[%s, %s], "
616-
"right part: %r at [%s, %s]->[%s, %s].",
617-
contig.name, gap.q_st, gap.q_ei, gap.r_st, gap.r_ei,
618-
left_part.name, left_part.alignment.q_st, left_part.alignment.q_ei,
619-
left_part.alignment.r_st, left_part.alignment.r_ei,
620-
right_part.name, right_part.alignment.q_st, right_part.alignment.q_ei,
621-
right_part.alignment.r_st, right_part.alignment.r_ei)
615+
logger.debug("Split contig %r at %s around its gap at [%s, %s]->[%s, %s]. "
616+
"Left part: %r at %s, "
617+
"right part: %r at %s.",
618+
contig.name, contig.alignment,
619+
gap.q_st, gap.q_ei, gap.r_st, gap.r_ei,
620+
left_part.name, left_part.alignment,
621+
right_part.name, right_part.alignment)
622622
context.get().emit(events.SplitGap(contig, gap, left_part, right_part))
623623
return
624624

0 commit comments

Comments
 (0)