Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/dwgsim.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ double ran_normal()
}
}

void unreachable(char *message) {
void unreachable_exit(char *message) {
fprintf(stderr, "\n[dwgsim_core] Error: %s\n", message);
exit(1);
}
Expand Down Expand Up @@ -713,7 +713,7 @@ void dwgsim_core(dwgsim_opt_t * opt)
case 0: strand[0] = (drand48() < 0.5) ? 1 : 0; break;
case 1: strand[0] = 0; break;
case 2: strand[0] = 1; break;
default: unreachable("read strand was not between 0-2");
default: unreachable_exit("read strand was not between 0-2");
}

// set read two's strand
Expand All @@ -723,12 +723,12 @@ void dwgsim_core(dwgsim_opt_t * opt)
case ILLUMINA: strand[1] = 1 - strand[0]; break; // paired end for Illumina (opposite strand)
case SOLID:
case IONTORRENT: strand[1] = strand[0]; break; // mate pair for SOLiD and IonTorrent (same strand)
default: unreachable("data type was not between 0-2");
default: unreachable_exit("data type was not between 0-2");
}
break;
case 1: strand[1] = strand[0]; break; // mate pair (same strand)
case 2: strand[1] = 1 - strand[0]; break; // paired end (opposite strand)
default: unreachable("strandedness was not between 0-2");
default: unreachable_exit("strandedness was not between 0-2");
}

// generate the reads in base space
Expand Down Expand Up @@ -901,7 +901,7 @@ void dwgsim_core(dwgsim_opt_t * opt)
}
qstr[i] = 0;
// BWA
FILE *fpo = (0 == j) ? opt->fp_bwa1: opt->fp_bwa2;
gzFile fpo = (0 == j) ? opt->fp_bwa1: opt->fp_bwa2;
if (NULL != fpo) {
if(ILLUMINA == opt->data_type || IONTORRENT == opt->data_type) {
gzprintf(fpo, "@%s%s%s_%u_%u_%1u_%1u_%1u_%1u_%d:%d:%d_%d:%d:%d_%llx/%d\n",
Expand Down Expand Up @@ -1009,7 +1009,7 @@ void dwgsim_core(dwgsim_opt_t * opt)
}
}
// BWA
FILE *fpo = (0 == j) ? opt->fp_bwa1: opt->fp_bwa2;
gzFile fpo = (0 == j) ? opt->fp_bwa1: opt->fp_bwa2;
if (NULL != fpo) {
if(ILLUMINA == opt->data_type || IONTORRENT == opt->data_type) {
gzprintf(fpo, "@%s%s%s_%u_%u_%1u_%1u_%1u_%1u_%d:%d:%d_%d:%d:%d_%llx/%d\n",
Expand Down
6 changes: 3 additions & 3 deletions src/dwgsim_opt.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ typedef struct {
char *fn_regions_bed;
FILE *fp_mut;
FILE *fp_vcf;
gzFile *fp_bfast;
gzFile *fp_bwa1;
gzFile *fp_bwa2;
gzFile fp_bfast;
gzFile fp_bwa1;
gzFile fp_bwa2;
FILE *fp_fa;
FILE *fp_fai;
char *read_prefix;
Expand Down
4 changes: 2 additions & 2 deletions src/mut.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ mutseq_init();
void
mutseq_destroy(mutseq_t *seq);

inline int32_t
int32_t
mut_get_ins_bytes(int32_t n);

inline uint8_t*
uint8_t*
mut_get_ins_long_n(uint8_t *ins, uint32_t *n);

mut_t
Expand Down