forked from ANGSD/angsd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makeReadPool.h
38 lines (31 loc) · 989 Bytes
/
makeReadPool.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#pragma once
#include <cassert>
#include <cstdlib>
#include <htslib/hts.h>
#include <htslib/sam.h>
#include "pop1_read.h"
#include "argStruct.h"
typedef struct{
int l;//<- number of elements
int m;//<-maxnumber of elements
int *first;//first postition of read, relative to reference
int *last;//last position of read,relative to reference
bam1_t **reads;
int readIDstop;
int lowestStart;//the lowestStartacroos an array of sglPool
bam1_t *bufferedRead;//this is used for buffering a read, in the case of chromosome change
}readPool;
typedef struct{
htsFile *fp;
char *fn;
bam_hdr_t *hdr;
int isEOF;
int regionDone;
hts_idx_t *idx;
hts_itr_t *itr;
regs regions;
}bufReader;
readPool makePoolb(int l);
void dalloc (readPool *ret);
int collect_reads(bufReader *rd,int nFiles,int ¬Done,readPool *ret,int &readNlines,int ref,int &pickStop);
int collect_reads2(bufReader *rd,int nFiles,int ¬Done,readPool *ret,int &readNlines,int ref,int &pickStop);