示例#1
0
void update_seed_left(alig_out_t *alig_out, seed_t *seed, seed_cal_t *cal) {
  if (alig_out->match > 0) {

    // update seed
    seed->num_mismatches += alig_out->mismatch;
    seed->num_open_gaps += alig_out->gap_open;
    seed->num_extend_gaps += alig_out->gap_extend;
    
    seed->read_start -= alig_out->map_len1;
    seed->genome_start -= alig_out->map_len2;

    // update cigar with the sw output
    if (alig_out->cigar.num_ops > 0) {
      cigar_t cigar;
      cigar_init(&cigar);

      cigar_concat(&seed->cigar, &alig_out->cigar);
      cigar_init(&seed->cigar);
      cigar_copy(&seed->cigar, &alig_out->cigar);
    }    
  }
}
示例#2
0
void short_read_init(short_read_t* sr)
{
    str_init(&sr->id);
    str_init(&sr->seq);
    str_init(&sr->qual);
    str_init(&sr->seqname);
    str_init(&sr->mate_seqname);
    sr->aux = samopt_table_alloc();
    cigar_init(&sr->cigar);
    sr->flags    = BAM_FUNMAP;
    sr->strand   = 0;
    sr->pos      = 0;
    sr->map_qual = 255;
    sr->mate_pos = 0;
    sr->tlen     = 0;
}
示例#3
0
void extend_to_left(seed_t *seed, int max_length, 
		    seed_cal_t *cal, sa_index3_t *sa_index,
		    alig_out_t *alig_out) {
  cigar_init(&alig_out->cigar);

  int chrom = cal->chromosome_id;

  //size_t r_end = seed->read_start - 1;
  //size_t r_start = r_end - max_length;
  size_t r_len = max_length;
  char *r_seq = (cal->strand ? cal->read->revcomp : cal->read->sequence);
  
  size_t g_len = r_len + 10;
  size_t g_end = seed->genome_start - 1;
  size_t g_start = g_end - g_len;
  char *g_seq = &sa_index->genome->S[g_start + sa_index->genome->chrom_offsets[chrom] + 1];
  
  doscadfun_inv(r_seq, r_len, g_seq, g_len, MISMATCH_PERC,
		alig_out);
}