static p_search_result setup_searcher_16_test( char * query_string, char * db_file, size_t hit_count ) { set_max_compute_capability( COMPUTE_ON_SSE2 ); mat_init_constant_scoring( 1, -1 ); init_symbol_translation( NUCLEOTIDE, FORWARD_STRAND, 3, 3 ); p_query query = query_read_from_string( query_string ); s_init( NEEDLEMAN_WUNSCH, BIT_WIDTH_16, query ); ssa_db_init( concat( "./tests/testdata/", db_file ) ); gapO = -1; gapE = -1; adp_init( hit_count ); p_search_result res = s_search( &hit_count ); minheap_sort( res->heap ); query_free( query ); return res; }
}END_TEST static p_search_result setup_BLOSUM62_test( int bit_width, int search_type, size_t hit_count ) { init_symbol_translation( AMINOACID, FORWARD_STRAND, 3, 3 ); mat_init_buildin( BLOSUM62 ); p_query query = query_read_from_string( "HPEVYILIIPGFGIISHVVSTYSKKPVFGEISMVYAMASIGLLGFLVWSHHMYIVGLDADTRAYFTSATMIIAIPTGIKI" ); s_init( search_type, bit_width, query ); ssa_db_init( concat( "./tests/testdata/", "short_AA.fas" ) ); gapO = -1; gapE = -1; adp_init( hit_count ); p_search_result res = s_search( &hit_count ); minheap_sort( res->heap ); query_free( query ); ck_assert_int_eq( hit_count, res->heap->count ); return res; }
}END_TEST static void test_searcher_overflow_to_64bit( int search_type ) { init_constant_scores( 127, -1 ); init_symbol_translation( AMINOACID, FORWARD_STRAND, 3, 3 ); p_query query = query_read_from_file( "./tests/testdata/NP_009305.1.fas" ); s_init( search_type, BIT_WIDTH_8, query ); ssa_db_init( "./tests/testdata/NP_009305.1.fas" ); gapO = -1; gapE = -1; size_t hit_count = 1; adp_init( hit_count ); p_search_result res = s_search( &hit_count ); minheap_sort( res->heap ); query_free( query ); ck_assert_int_eq( hit_count, res->heap->count ); ck_assert_int_eq( 1, res->overflow_8_bit_count ); ck_assert_int_eq( 1, res->overflow_16_bit_count ); int result[2] = { 67818, 0 }; test_result( res, result, 2 ); }
/** * \brief Initiate example. * */ static void adp_example_init(void) { adp_init(); /* Extension board ioport initial */ adp_example_ioport_init(); adp_example_adc_init(); while (adp_wait_for_handshake() != ADP_HANDSHAKE_ACCEPTED) { } adp_window_init(); adp_example_tc_init(); }
static p_search_result setup_searcher_test( int bit_width, int search_type, char * query_string, char * db_file, size_t hit_count, int symtype, int strands ) { init_symbol_translation( symtype, strands, 3, 3 ); mat_init_constant_scoring( 1, -1 ); p_query query = query_read_from_string( query_string ); s_init( search_type, bit_width, query ); ssa_db_init( concat( "./tests/testdata/", db_file ) ); gapO = -1; gapE = -1; adp_init( hit_count ); p_search_result res = s_search( &hit_count ); minheap_sort( res->heap ); query_free( query ); return res; }