h->text = (char*)calloc(h->l_text + 1, 1);
memcpy(h->text, h0->text, h->l_text);
h->target_len = (uint32_t*)calloc(h->n_targets, 4);
h->text = (char*)calloc(h->l_text + 1, 1);
memcpy(h->text, h0->text, h->l_text);
h->target_len = (uint32_t*)calloc(h->n_targets, 4);
if (aux) { // check if aux is present
bam_header_t *textheader = fp->header;
fp->header = sam_header_read2((const char*)aux);
if (aux) { // check if aux is present
bam_header_t *textheader = fp->header;
fp->header = sam_header_read2((const char*)aux);
append_header_text(fp->header, textheader->text, textheader->l_text);
bam_header_destroy(textheader);
}
append_header_text(fp->header, textheader->text, textheader->l_text);
bam_header_destroy(textheader);
}
fprintf(stderr, "[samopen] no @SQ lines in the header.\n");
} else fprintf(stderr, "[samopen] SAM header is present: %d sequences.\n", fp->header->n_targets);
}
fprintf(stderr, "[samopen] no @SQ lines in the header.\n");
} else fprintf(stderr, "[samopen] SAM header is present: %d sequences.\n", fp->header->n_targets);
}
} else if (mode[0] == 'w') { // write
fp->header = bam_header_dup((const bam_header_t*)aux);
if (mode[1] == 'b') { // binary
} else if (mode[0] == 'w') { // write
fp->header = bam_header_dup((const bam_header_t*)aux);
if (mode[1] == 'b') { // binary