Skip to content

Commit

Permalink
increased buffer size globally and for fragment lines
Browse files Browse the repository at this point in the history
  • Loading branch information
pjedge committed Jan 31, 2020
1 parent 639a34e commit eecb8b9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions hapcut2-src/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
extern int QVoffset;
extern int MINQ;

#define MAXBUF 100000
#define MAXBUF 1000000

// given a=log10(x) and b=log10(y), returns log10(x+y)
#define addlogs(a, b) (((a) > (b)) ? ((a) + log10(1.0 + pow(10.0, (b) - (a)))) : ((b) + log10(1.0 + pow(10.0, (a) - (b)))))
Expand Down Expand Up @@ -39,7 +39,7 @@ struct fragment {
float htrans_prob; // probability of an h-trans interaction for this read
int mate2_ix; // snp index of second mate; -1 if this fragment has one mate
int isize; // approximate insert size

int PS; int PQ; char HP; // haplotype assignments for each fragment, HP= 0/1, PS = integer, PQ = probability that assignment of fragment is correct
};

Expand Down Expand Up @@ -98,7 +98,7 @@ struct SNPfrags {
float post_hap;
int pruned_discrete_heuristic; // for error analysis mode
float homozygous_prior; // prior probability of homozygousity. Based on GQ field of VCF.
float PGLL[5]; // phased genotype likelihoods, 00,01,10,11 and ./. (if variant is ignored)
float PGLL[5]; // phased genotype likelihoods, 00,01,10,11 and ./. (if variant is ignored)
};

int fprintf_time(FILE *stream, const char *format, ...);
Expand Down
5 changes: 2 additions & 3 deletions hapcut2-src/readinputfiles.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ int read_fragment_matrix(char* fragmentfile, struct fragment* Flist, int fragmen
int i = 0, j = 0, k = 0, t = 0, t1 = 0, done = 0;
int blocks = 0, type = 0, l = 0, biter = 0, offset = 0,dtype=0,isize = 0;
char buffer[MAXBUF];
char blockseq[500000];
char blockseq[5000000];
for (i=0;i<MAXBUF;i++) buffer[i] = 0;
for (i=0;i<500000;i++) blockseq[i] = 0;
for (i=0;i<5000000;i++) blockseq[i] = 0;
char ch;
int num_fields;
int expected_num_fields;
Expand Down Expand Up @@ -473,4 +473,3 @@ int read_htrans_file(char* htrans_file, float* htrans_probs, int num_bins) {

return 0;
}

0 comments on commit eecb8b9

Please sign in to comment.