added reverse complement

This commit is contained in:
Heng Li
2018-02-20 09:41:25 -05:00
parent f434653432
commit 7dc7097208
4 changed files with 28 additions and 2 deletions

View File

@@ -101,4 +101,16 @@ static inline mm_reg1_t *mm_map_aux(const mm_idx_t *mi, const char *seq1, const
}
}
static inline uint8_t *mappy_revcomp(int len, uint8_t *seq)
{
int i;
for (i = 0; i < len>>1; ++i) {
uint8_t t = seq_comp_table[seq[i]];
seq[i] = seq_comp_table[seq[len - 1 - i]];
seq[len - 1 - i] = t;
}
if (len&1) seq[len>>1] = seq_comp_table[seq[len>>1]];
return seq;
}
#endif