mirror of
https://github.com/lh3/minimap2.git
synced 2026-09-15 13:07:55 +08:00
r301: separate introns from deletions
When an intron is adjacent to a deletion, the old code count both as introns, which lead to an inaccurate exon boundary.
This commit is contained in:
20
format.c
20
format.c
@@ -182,7 +182,7 @@ static inline void write_tags(kstring_t *s, const mm_reg1_t *r)
|
||||
}
|
||||
}
|
||||
|
||||
void mm_write_paf(kstring_t *s, const mm_idx_t *mi, const mm_bseq1_t *t, const mm_reg1_t *r, void *km, int opt_flag, int intron_thres)
|
||||
void mm_write_paf(kstring_t *s, const mm_idx_t *mi, const mm_bseq1_t *t, const mm_reg1_t *r, void *km, int opt_flag)
|
||||
{
|
||||
s->l = 0;
|
||||
mm_sprintf_lite(s, "%s\t%d\t%d\t%d\t%c\t", t->name, t->l_seq, r->qs, r->qe, "+-"[r->rev]);
|
||||
@@ -196,12 +196,8 @@ void mm_write_paf(kstring_t *s, const mm_idx_t *mi, const mm_bseq1_t *t, const m
|
||||
if (r->p && (opt_flag & MM_F_OUT_CG)) {
|
||||
uint32_t k;
|
||||
mm_sprintf_lite(s, "\tcg:Z:");
|
||||
for (k = 0; k < r->p->n_cigar; ++k) {
|
||||
int op = r->p->cigar[k]&0xf, len = r->p->cigar[k]>>4;
|
||||
if (intron_thres > 0 && op == 2 && len >= intron_thres)
|
||||
mm_sprintf_lite(s, "%dN", len);
|
||||
else mm_sprintf_lite(s, "%d%c", len, "MID"[op]);
|
||||
}
|
||||
for (k = 0; k < r->p->n_cigar; ++k)
|
||||
mm_sprintf_lite(s, "%d%c", r->p->cigar[k]>>4, "MIDN"[r->p->cigar[k]&0xf]);
|
||||
}
|
||||
if (r->p && (opt_flag & MM_F_OUT_CS))
|
||||
write_cs(km, s, mi, t, r);
|
||||
@@ -239,7 +235,7 @@ static void sam_write_sq(kstring_t *s, char *seq, int l, int rev, int comp)
|
||||
} else str_copy(s, seq, seq + l);
|
||||
}
|
||||
|
||||
void mm_write_sam(kstring_t *s, const mm_idx_t *mi, const mm_bseq1_t *t, const mm_reg1_t *r, int n_regs, const mm_reg1_t *regs, int intron_thres)
|
||||
void mm_write_sam(kstring_t *s, const mm_idx_t *mi, const mm_bseq1_t *t, const mm_reg1_t *r, int n_regs, const mm_reg1_t *regs)
|
||||
{
|
||||
int flag = 0;
|
||||
s->l = 0;
|
||||
@@ -258,12 +254,8 @@ void mm_write_sam(kstring_t *s, const mm_idx_t *mi, const mm_bseq1_t *t, const m
|
||||
uint32_t k, clip_len = r->rev? t->l_seq - r->qe : r->qs;
|
||||
int clip_char = (flag&0x800)? 'H' : 'S';
|
||||
if (clip_len) mm_sprintf_lite(s, "%d%c", clip_len, clip_char);
|
||||
for (k = 0; k < r->p->n_cigar; ++k) {
|
||||
int op = r->p->cigar[k]&0xf, len = r->p->cigar[k]>>4;
|
||||
if (intron_thres > 0 && op == 2 && len >= intron_thres)
|
||||
mm_sprintf_lite(s, "%dN", len);
|
||||
else mm_sprintf_lite(s, "%d%c", len, "MID"[op]);
|
||||
}
|
||||
for (k = 0; k < r->p->n_cigar; ++k)
|
||||
mm_sprintf_lite(s, "%d%c", r->p->cigar[k]>>4, "MIDN"[r->p->cigar[k]&0xf]);
|
||||
clip_len = r->rev? r->qs : t->l_seq - r->qe;
|
||||
if (clip_len) mm_sprintf_lite(s, "%d%c", clip_len, clip_char);
|
||||
} else mm_sprintf_lite(s, "*");
|
||||
|
||||
Reference in New Issue
Block a user