mirror of
https://github.com/lh3/minimap2.git
synced 2026-10-02 04:08:12 +08:00
r188: renamed bseq* to mm_bseq*
to avoid naming collisions between minimap2 and bwa/fermi-lite/etc
This commit is contained in:
@@ -7,43 +7,43 @@
|
||||
#include "kseq.h"
|
||||
KSEQ_INIT(gzFile, gzread)
|
||||
|
||||
struct bseq_file_s {
|
||||
struct mm_bseq_file_s {
|
||||
int is_eof;
|
||||
gzFile fp;
|
||||
kseq_t *ks;
|
||||
};
|
||||
|
||||
bseq_file_t *bseq_open(const char *fn)
|
||||
mm_bseq_file_t *mm_bseq_open(const char *fn)
|
||||
{
|
||||
bseq_file_t *fp;
|
||||
mm_bseq_file_t *fp;
|
||||
gzFile f;
|
||||
f = fn && strcmp(fn, "-")? gzopen(fn, "r") : gzdopen(fileno(stdin), "r");
|
||||
if (f == 0) return 0;
|
||||
fp = (bseq_file_t*)calloc(1, sizeof(bseq_file_t));
|
||||
fp = (mm_bseq_file_t*)calloc(1, sizeof(mm_bseq_file_t));
|
||||
fp->fp = f;
|
||||
fp->ks = kseq_init(fp->fp);
|
||||
return fp;
|
||||
}
|
||||
|
||||
void bseq_close(bseq_file_t *fp)
|
||||
void mm_bseq_close(mm_bseq_file_t *fp)
|
||||
{
|
||||
kseq_destroy(fp->ks);
|
||||
gzclose(fp->fp);
|
||||
free(fp);
|
||||
}
|
||||
|
||||
bseq1_t *bseq_read(bseq_file_t *fp, int chunk_size, int with_qual, int *n_)
|
||||
mm_bseq1_t *mm_bseq_read(mm_bseq_file_t *fp, int chunk_size, int with_qual, int *n_)
|
||||
{
|
||||
int size = 0, m, n;
|
||||
bseq1_t *seqs;
|
||||
mm_bseq1_t *seqs;
|
||||
kseq_t *ks = fp->ks;
|
||||
m = n = 0; seqs = 0;
|
||||
while (kseq_read(ks) >= 0) {
|
||||
bseq1_t *s;
|
||||
mm_bseq1_t *s;
|
||||
assert(ks->seq.l <= INT32_MAX);
|
||||
if (n >= m) {
|
||||
m = m? m<<1 : 256;
|
||||
seqs = (bseq1_t*)realloc(seqs, m * sizeof(bseq1_t));
|
||||
seqs = (mm_bseq1_t*)realloc(seqs, m * sizeof(mm_bseq1_t));
|
||||
}
|
||||
s = &seqs[n];
|
||||
s->name = strdup(ks->name.s);
|
||||
@@ -58,7 +58,7 @@ bseq1_t *bseq_read(bseq_file_t *fp, int chunk_size, int with_qual, int *n_)
|
||||
return seqs;
|
||||
}
|
||||
|
||||
int bseq_eof(bseq_file_t *fp)
|
||||
int mm_bseq_eof(mm_bseq_file_t *fp)
|
||||
{
|
||||
return fp->is_eof;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user