Skip to content

Commit

Permalink
MErge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
David Jones committed Apr 12, 2019
2 parents bf2728d + f786864 commit f8617d9
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

* Making species and assembly required commandline arguments in the estep

## 1.13.15

* Add checks to sam_iter_next to ensure result is checked for errors

## 1.13.14

* Fix array length index, check loop length and error messages related to 1.13.13.
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CAVEMAN_VERSION=1.13.14
CAVEMAN_VERSION=1.13.15

TEST_REF?=""
#Compiler
Expand Down
13 changes: 9 additions & 4 deletions src/bam_access.c
Original file line number Diff line number Diff line change
Expand Up @@ -408,9 +408,7 @@ file_holder *bam_access_get_by_position_counts_stranded(char *norm_file, char *c
check(res==0,"Error running pileup callback");
}//End of while we have pileup reads
}
if(result != -1){
fprintf(stderr,"SAMTOOLS ERROR %d\n",result);
}
check(result >= -1, "Error detected (%d) when trying to iterate through region.",result);
bam_plp_push(buf,0); // finalize pileup
sam_itr_destroy(iter);
//Now for the pileup method
Expand Down Expand Up @@ -1243,7 +1241,7 @@ List *bam_access_get_sorted_reads_at_this_pos(char *chr_name, uint32_t start, ui
}

}//End of while iterator to populate pileup

check(result >= -1, "Error detected (%d) when trying to iterate through region.",result);
sam_itr_destroy(iter);
bam_plp_push(buf,0); // finalize pileup

Expand Down Expand Up @@ -1336,10 +1334,17 @@ int bam_access_get_count_with_bam(char *chr_name, uint32_t start, uint32_t stop,
counter++;

}//End of iteration through reads in this region
check(result >= -1, "Error detected (%d) when trying to iterate through region.",result);
sam_itr_destroy(iter);
bam_destroy1(b);
free(region);
return counter;

error:
if(iter) sam_itr_destroy(iter);
if(b) bam_destroy1(b);
if(region) free(region);
return -1;
}

void bam_access_include_sw(int inc){
Expand Down
4 changes: 4 additions & 0 deletions src/split.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ int split_main(int argc, char *argv[]){

while(curr_n_pos<=curr_t_pos && iter_n_status>=0 && iter_t_status>=0 && rd_count<=max_read_count){ //While the positions aren't equal and tumour has reads left. Normal jumps ahead
iter_n_status = sam_itr_next(sf_norm,iter_norm,norm_read);
check(iter_n_status>=-1,"Error detected (%d) when trying to iterate through region.",iter_n_status);
curr_n_pos = norm_read->core.pos;
if(iter_n_status>=0 && bam_access_check_bam_flags(norm_read) == 1 && ignore_reg_access_get_ign_reg_overlap(curr_n_pos,ignore_regs,ignore_reg_count) == NULL){
rd_count++;
Expand All @@ -286,6 +287,7 @@ int split_main(int argc, char *argv[]){

while(curr_t_pos<=curr_n_pos && iter_t_status>=0 && iter_n_status>=0){ //While the positions aren't equal and normal has reads left
iter_t_status = sam_itr_next(sf_tum,iter_tum,tum_read);
check(iter_t_status>=-1,"Error detected (%d) when trying to iterate through region.",iter_t_status);
curr_t_pos = tum_read->core.pos;
if(iter_t_status>=0 && bam_access_check_bam_flags(tum_read) == 1 && ignore_reg_access_get_ign_reg_overlap(curr_t_pos,ignore_regs,ignore_reg_count) == NULL){
rd_count++;
Expand All @@ -296,6 +298,7 @@ int split_main(int argc, char *argv[]){
if(iter_n_status<0 && iter_t_status>=0){ //No more normal reads
while(iter_t_status>=0 && rd_count<=max_read_count){
iter_t_status = sam_itr_next(sf_tum,iter_tum,tum_read);
check(iter_t_status>=-1,"Error detected (%d) when trying to iterate through region.",iter_t_status);
curr_t_pos = tum_read->core.pos;
if(iter_t_status>=0 && bam_access_check_bam_flags(tum_read) == 1 && ignore_reg_access_get_ign_reg_overlap(curr_t_pos,ignore_regs,ignore_reg_count) == NULL){
rd_count++;
Expand All @@ -306,6 +309,7 @@ int split_main(int argc, char *argv[]){
if(iter_t_status<0 && iter_n_status>=0){ //No more tumour reads
while(iter_n_status>=0 && rd_count<=max_read_count){
iter_n_status = sam_itr_next(sf_norm,iter_norm,norm_read);
check(iter_n_status>=-1,"Error detected (%d) when trying to iterate through region.",iter_n_status);
curr_n_pos = norm_read->core.pos;
if(iter_n_status>=0 && bam_access_check_bam_flags(norm_read) == 1 && ignore_reg_access_get_ign_reg_overlap(curr_n_pos,ignore_regs,ignore_reg_count) == NULL){
rd_count++;
Expand Down

0 comments on commit f8617d9

Please sign in to comment.