Пример #1
0
unsigned char *seq_readnib(const char *fname, int32_t rbase, int32_t rlen, int32_t *slen)
{
	FILE *fp = ckopen(fname, "rb");
	unsigned char *s = seq_freadnib(fp, rbase, rlen, slen);
	fclose(fp);
	return s;
}
Пример #2
0
int seq_read_nib(SEQ *seq)
{
	int n;
	if (seq->header) ZFREE(seq->header);
	if (seq->seq) ZFREE(seq->seq);

	seq->offset = ftell(seq->fp);
	seq->seq = seq_freadnib(seq->fp, seq->from-1, seq->slen, &(seq->slen));

	if (seq->seq == 0) return 0;

	n = strlen(seq->fname)+1+22+1+22+1;
	seq->header = ckalloc(n);
	seq->hlen = snprintf(seq->header, n, "%s:%d-%d",
		seq->fname, seq->from, seq->from+seq->slen-1);

	seq->count++;
	return 1;
}