52 #ifndef HTSLIB_SYNCED_BCF_READER_H
53 #define HTSLIB_SYNCED_BCF_READER_H
60 #define COLLAPSE_NONE 0 // require the exact same set of alleles in all files
61 #define COLLAPSE_SNPS 1 // allow different alleles, as long as they all are SNPs
62 #define COLLAPSE_INDELS 2 // the same as above, but with indels
63 #define COLLAPSE_ANY 4 // any combination of alleles can be returned by bcf_sr_next_line()
64 #define COLLAPSE_SOME 8 // at least some of the ALTs must match
65 #define COLLAPSE_BOTH (COLLAPSE_SNPS|COLLAPSE_INDELS)
183 #define bcf_sr_has_line(readers, i) (readers)->has_line[i]
184 #define bcf_sr_get_line(_readers, i) ((_readers)->has_line[i] ? ((_readers)->readers[i].buffer[0]) : NULL)
185 #define bcf_sr_region_done(_readers,i) (!(_readers)->has_line[i] && !(_readers)->readers[i].nbuffer ? 1 : 0)
186 #define bcf_sr_get_header(_readers, i) (_readers)->readers[i].header
187 #define bcf_sr_get_reader(_readers, i) &((_readers)->readers[i])
char * fname
Definition: synced_bcf_reader.h:74
htsFile * file
Definition: synced_bcf_reader.h:73
Definition: synced_bcf_reader.c:44
int targets_exclude
Definition: synced_bcf_reader.h:142
int is_file(char *fn)
Definition: files.c:57
int start
Definition: synced_bcf_reader.h:93
bcf1_t ** buffer
Definition: synced_bcf_reader.h:106
int bcf_sr_regions_next(bcf_sr_regions_t *reg)
Definition: synced_bcf_reader.c:1089
void * seq_hash
Definition: synced_bcf_reader.h:89
int require_index
Definition: synced_bcf_reader.h:129
int bcf_sr_set_samples(bcf_srs_t *readers, const char *samples, int is_file)
Definition: synced_bcf_reader.c:732
int streaming
Definition: synced_bcf_reader.h:137
char ** seq_names
Definition: synced_bcf_reader.h:90
int nals
Definition: synced_bcf_reader.h:78
int end
Definition: synced_bcf_reader.h:93
int nreaders
Definition: synced_bcf_reader.h:136
struct _region_t * regs
Definition: synced_bcf_reader.h:86
htsFile * file
Definition: synced_bcf_reader.h:100
Definition: synced_bcf_reader.h:115
bcf_sr_regions_t * bcf_sr_regions_init(const char *regions, int is_file, int chr, int from, int to)
Definition: synced_bcf_reader.c:977
Definition: synced_bcf_reader.h:67
bcf_sr_t * readers
Definition: synced_bcf_reader.h:135
hts_itr_t * itr
Definition: synced_bcf_reader.h:71
int collapse
Definition: synced_bcf_reader.h:123
Definition: synced_bcf_reader.h:115
Definition: synced_bcf_reader.h:115
int bcf_sr_regions_overlap(bcf_sr_regions_t *reg, const char *seq, int start, int end)
Definition: synced_bcf_reader.c:1223
int nfilter_ids
Definition: synced_bcf_reader.h:108
region1_t * regs
Definition: synced_bcf_reader.c:46
int bcf_sr_seek(bcf_srs_t *readers, const char *seq, int pos)
Definition: synced_bcf_reader.c:714
void(* missed_reg_handler)(struct _bcf_sr_regions_t *, void *)
Definition: synced_bcf_reader.h:82
int * has_line
Definition: synced_bcf_reader.h:131
void bcf_sr_regions_destroy(bcf_sr_regions_t *regions)
Definition: synced_bcf_reader.c:1044
int n_smpl
Definition: synced_bcf_reader.h:144
int nbuffer
Definition: synced_bcf_reader.h:107
int * samples
Definition: synced_bcf_reader.h:109
hts_itr_t * itr
Definition: synced_bcf_reader.h:104
Definition: synced_bcf_reader.h:98
int is_bin
Definition: synced_bcf_reader.h:75
int als_type
Definition: synced_bcf_reader.h:79
tbx_t * tbx
Definition: synced_bcf_reader.h:70
char ** samples
Definition: synced_bcf_reader.h:139
int bcf_sr_next_line(bcf_srs_t *readers)
Definition: synced_bcf_reader.c:677
int explicit_regs
Definition: synced_bcf_reader.h:138
bcf_sr_regions_t * targets
Definition: synced_bcf_reader.h:140
int prev_seq
Definition: synced_bcf_reader.h:94
struct _bcf_sr_regions_t bcf_sr_regions_t
Definition: synced_bcf_reader.h:116
void bcf_sr_destroy(bcf_srs_t *readers)
Definition: synced_bcf_reader.c:265
const char * fname
Definition: synced_bcf_reader.h:105
int bcf_sr_add_reader(bcf_srs_t *readers, const char *fname)
Definition: synced_bcf_reader.c:132
int iseq
Definition: synced_bcf_reader.h:92
bcf_srs_t * bcf_sr_init(void)
Definition: synced_bcf_reader.c:245
int targets_als
Definition: synced_bcf_reader.h:141
bcf_sr_error
Definition: synced_bcf_reader.h:113
kstring_t tmps
Definition: synced_bcf_reader.h:143
int bcf_sr_set_regions(bcf_srs_t *readers, const char *regions, int is_file)
Definition: synced_bcf_reader.c:104
bcf_hdr_t * header
Definition: synced_bcf_reader.h:103
char ** als
Definition: synced_bcf_reader.h:76
void bcf_sr_remove_reader(bcf_srs_t *files, int i)
Definition: synced_bcf_reader.c:280
void * missed_reg_data
Definition: synced_bcf_reader.h:83
Definition: synced_bcf_reader.h:120
bcf_sr_error errnum
Definition: synced_bcf_reader.h:132
int mals
Definition: synced_bcf_reader.h:78
int max_unpack
Definition: synced_bcf_reader.h:130
kstring_t line
Definition: synced_bcf_reader.h:72
tbx_t * tbx_idx
Definition: synced_bcf_reader.h:101
int prev_start
Definition: synced_bcf_reader.h:94
char * bcf_sr_strerror(int errnum)
Definition: synced_bcf_reader.c:55
Definition: synced_bcf_reader.h:115
int nseqs
Definition: synced_bcf_reader.h:91
char * apply_filters
Definition: synced_bcf_reader.h:124
Definition: synced_bcf_reader.h:115
int bcf_sr_regions_seek(bcf_sr_regions_t *regions, const char *chr)
Definition: synced_bcf_reader.c:1069
kstring_t als_str
Definition: synced_bcf_reader.h:77
int bcf_sr_set_targets(bcf_srs_t *readers, const char *targets, int is_file, int alleles)
Definition: synced_bcf_reader.c:118
hts_idx_t * bcf_idx
Definition: synced_bcf_reader.h:102
void bcf_sr_regions_flush(bcf_sr_regions_t *regs)
Definition: synced_bcf_reader.c:1251