r1236: support paired-end short-read RNA-seq

This commit is contained in:
Heng Li
2025-03-30 19:30:19 -04:00
parent ce30004e02
commit 4b8b4418df
3 changed files with 18 additions and 3 deletions

14
map.c
View File

@@ -224,7 +224,7 @@ static mm_reg1_t *align_regs(const mm_mapopt_t *opt, const mm_idx_t *mi, void *k
return regs;
}
void mm_map_frag(const mm_idx_t *mi, int n_segs, const int *qlens, const char **seqs, int *n_regs, mm_reg1_t **regs, mm_tbuf_t *b, const mm_mapopt_t *opt, const char *qname)
void mm_map_frag_core(const mm_idx_t *mi, int n_segs, const int *qlens, const char **seqs, int *n_regs, mm_reg1_t **regs, mm_tbuf_t *b, const mm_mapopt_t *opt, const char *qname)
{
int i, j, rep_len, qlen_sum, n_regs0, n_mini_pos;
int max_chain_gap_qry, max_chain_gap_ref, is_splice = !!(opt->flag & MM_F_SPLICE), is_sr = !!(opt->flag & MM_F_SR);
@@ -373,6 +373,18 @@ void mm_map_frag(const mm_idx_t *mi, int n_segs, const int *qlens, const char **
}
}
void mm_map_frag(const mm_idx_t *mi, int n_segs, const int *qlens, const char **seqs, int *n_regs, mm_reg1_t **regs, mm_tbuf_t *b, const mm_mapopt_t *opt, const char *qname)
{
if ((opt->flag & MM_F_PE_IND) && n_segs == 2 && opt->pe_ori >= 0 && (opt->flag&MM_F_CIGAR)) {
int i;
for (i = 0; i < n_segs; ++i)
mm_map_frag_core(mi, 1, &qlens[i], &seqs[i], &n_regs[i], &regs[i], b, opt, qname);
mm_pair(b->km, opt->max_gap_ref, opt->pe_bonus, opt->a * 2 + opt->b, opt->a, qlens, n_regs, regs);
} else {
mm_map_frag_core(mi, n_segs, qlens, seqs, n_regs, regs, b, opt, qname);
}
}
mm_reg1_t *mm_map(const mm_idx_t *mi, int qlen, const char *seq, int *n_regs, mm_tbuf_t *b, const mm_mapopt_t *opt, const char *qname)
{
mm_reg1_t *regs;

View File

@@ -5,7 +5,7 @@
#include <stdio.h>
#include <sys/types.h>
#define MM_VERSION "2.28-r1235-dirty"
#define MM_VERSION "2.28-r1236-dirty"
#define MM_F_NO_DIAG (0x001LL) // no exact diagonal hit
#define MM_F_NO_DUAL (0x002LL) // skip pairs where query name is lexicographically larger than target name
@@ -45,6 +45,7 @@
#define MM_F_SPLICE_OLD (0x800000000LL)
#define MM_F_SECONDARY_SEQ (0x1000000000LL) //output SEQ field for seqondary alignments using hard clipping
#define MM_F_OUT_DS (0x2000000000LL)
#define MM_F_PE_IND (0x4000000000LL)
#define MM_I_HPC 0x1
#define MM_I_NO_SEQ 0x2

View File

@@ -177,10 +177,12 @@ int mm_set_opt(const char *preset, mm_idxopt_t *io, mm_mapopt_t *mo)
if (strcmp(preset, "splice:hq") == 0) {
mo->noncan = 5, mo->b = 4, mo->q = 6, mo->q2 = 24;
} else if (strcmp(preset, "splice:sr") == 0) {
mo->flag |= MM_F_NO_PRINT_2ND | MM_F_2_IO_THREADS | MM_F_HEAP_SORT;
mo->flag |= MM_F_NO_PRINT_2ND | MM_F_2_IO_THREADS | MM_F_HEAP_SORT | MM_F_FRAG_MODE | MM_F_PE_IND;
mo->noncan = 5, mo->b = 4, mo->q = 6, mo->q2 = 24;
mo->end_bonus = 10;
mo->mini_batch_size = 50000000;
mo->pe_ori = 0<<1|1; // FR
mo->best_n = 10;
}
} else return -1;
return 0;