tmap_map_sams_t* tmap_map1_thread_map(void **data, tmap_seq_t **seqs, tmap_index_t *index, tmap_bwt_match_hash_t *hash, tmap_rand_t *rand, tmap_map_opt_t *opt) { int32_t seq_len = 0;; tmap_map_sams_t *sams = NULL; // sequence length seq_len = tmap_seq_get_bases_length(seqs[0]); // sequence length not in range if((0 < opt->min_seq_len && seq_len < opt->min_seq_len) || (0 < opt->max_seq_len && opt->max_seq_len < seq_len)) { return tmap_map_sams_init(NULL); } // not enough bases, ignore if(0 < opt->seed_length && seq_len < opt->seed_length){ return tmap_map_sams_init(NULL); } // core algorithm; use the reverse sams = tmap_map1_thread_map_core(data, seqs, seq_len, index, hash, opt); return sams; }
tmap_map_sams_t* tmap_map_vsw_thread_map(void **data, tmap_seq_t **seqs, tmap_index_t *index, tmap_map_stats_t *stat, tmap_rand_t *rand, tmap_bwt_match_hash_t *hash[2], tmap_map_opt_t *opt) { int32_t seq_len = 0;; tmap_seq_t *seqs_tmp[2]={NULL, NULL}; tmap_map_sams_t *sams = NULL; // sequence length seq_len = tmap_seq_get_bases_length(seqs[0]); // sequence length not in range if((0 < opt->min_seq_len && seq_len < opt->min_seq_len) || (0 < opt->max_seq_len && opt->max_seq_len < seq_len)) { return tmap_map_sams_init(NULL); } // clone the sequence seqs_tmp[0] = seqs[0]; seqs_tmp[1] = seqs[1]; // core algorithm sams = tmap_map_vsw_thread_map_core(data, seqs_tmp, seq_len, index, opt); return sams; }
// TODO: memory pools? tmap_map_sams_t * tmap_map3_aux_core(tmap_seq_t *seq, uint8_t *flow_order, int32_t flow_order_len, tmap_refseq_t *refseq, tmap_bwt_t *bwt, tmap_sa_t *sa, tmap_bwt_match_hash_t *hash, tmap_map_opt_t *opt) { int32_t i, j, n, seed_length, hp_diff = 0; int32_t seq_len; tmap_string_t *bases; uint8_t *query; uint8_t *flow=NULL; tmap_map3_aux_seed_t *seeds; int32_t m_seeds, n_seeds; tmap_map_sams_t *sams = NULL; if(0 < opt->hp_diff) { // set up the flow order to be used if(NULL == flow_order) { hp_diff = 0; } else { flow = tmap_malloc(sizeof(uint8_t)*flow_order_len, "flow[0]"); for(i=0;i<flow_order_len;i++) { flow[i] = flow_order[i]; // forward } } } // init sams = tmap_map_sams_init(NULL); // update the seed length based on the read length seed_length = opt->seed_length; if(0 == opt->seed_length_set) { i = tmap_seq_get_bases_length(seq); while(0 < i) { seed_length++; i >>= 1; // divide by two } }