FastSort/src/sort/sort_impl.h

30 lines
699 B
C
Raw Normal View History

2025-04-17 16:17:44 +08:00
#pragma once
#include <htslib/sam.h>
#include <stdio.h>
// Struct which contains the sorting key for TemplateCoordinate sort.
struct TemplateCoordinateKey {
int tid1;
int tid2;
hts_pos_t pos1;
hts_pos_t pos2;
bool neg1;
bool neg2;
const char *library;
char *mid;
char *name;
bool is_upper_of_pair;
};
// Struct which contains the a record, and the pointer to the sort tag (if any) or
// a combined ref / position / strand.
// Used to speed up sorts (coordinate, by-tag, and template-coordinate).
2025-04-17 18:29:12 +08:00
struct BamSortTag {
2025-04-17 16:17:44 +08:00
bam1_t *bam_record;
union {
const uint8_t *tag;
uint8_t pos_tid[12];
TemplateCoordinateKey *key;
} u;
};