Skip to content

Commit

Permalink
move inwards one at a time, remove gap extending, Bonferroni correction
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewjpage committed Mar 13, 2013
1 parent d6f5f43 commit 80ea76d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
24 changes: 15 additions & 9 deletions src/branch_sequences.c
Original file line number Diff line number Diff line change
Expand Up @@ -473,9 +473,15 @@ void get_likelihood_for_windows(char * child_sequence, int length_of_sequence, i
number_of_candidate_blocks++;
break;
}
// TODO need a more intelligent way to move inwards.
current_start++;
current_end--;

if(loop_counter %2 == 0)
{
current_start++;
}
else
{
current_end--;
}

if(loop_counter > 0)
{
Expand Down Expand Up @@ -590,11 +596,11 @@ int merge_adjacent_blocks(int ** block_coordinates, int number_of_blocks, char *
return number_of_blocks;
}

for(i=0; i < number_of_blocks; i++)
{
block_coordinates[0][i] = extend_end_of_block_left_over_gap( block_coordinates[0][i], branch_snp_sequence, number_of_bases, snp_site_coords);
block_coordinates[1][i] = extend_end_of_block_right_over_gap(block_coordinates[1][i], branch_snp_sequence, number_of_bases, snp_site_coords);
}
//for(i=0; i < number_of_blocks; i++)
//{
// block_coordinates[0][i] = extend_end_of_block_left_over_gap( block_coordinates[0][i], branch_snp_sequence, number_of_bases, snp_site_coords);
// block_coordinates[1][i] = extend_end_of_block_right_over_gap(block_coordinates[1][i], branch_snp_sequence, number_of_bases, snp_site_coords);
//}

merged_block_coordinates[0][current_merged_block] = block_coordinates[0][current_merged_block];
merged_block_coordinates[1][current_merged_block] = block_coordinates[1][current_merged_block];
Expand Down Expand Up @@ -760,7 +766,7 @@ int p_value_test(int branch_genome_size, int window_size, int num_branch_snps, i
return 0;
}

threshold = 0.05/branch_genome_size;
threshold = 0.05/num_branch_snps;

while( cutoff < block_snp_count)
{
Expand Down
2 changes: 1 addition & 1 deletion tests/check_branch_sequences.c
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ Suite * check_branch_sequences_suite (void)
tcase_add_test (tc_branch_sequences, check_merge_adjacent_blocks_near_each_other);
tcase_add_test (tc_branch_sequences, check_merge_adjacent_blocks_overlapping);
tcase_add_test (tc_branch_sequences, check_exclude_snp_sites_in_block);
tcase_add_test (tc_branch_sequences, check_merge_block_straddling_gap);
//tcase_add_test (tc_branch_sequences, check_merge_block_straddling_gap);
tcase_add_test (tc_branch_sequences, check_extend_end_of_block_right_over_gap);
tcase_add_test (tc_branch_sequences, check_dont_extend_right_if_gap_non_contiguous);
tcase_add_test (tc_branch_sequences, check_extend_right_over_multiple_gaps);
Expand Down

0 comments on commit 80ea76d

Please sign in to comment.