/// Determine rough positioning of qry to reference sequence by approximate seed matching
/// Returns vector of stripes, that is a band within which the alignment is expected to lie
Determine rough positioning of qry to reference sequence by approximate seed matching
Returns vector of stripes, that is a band within which the alignment is expected to lie
Determine rough positioning of qry to reference sequence by approximate seed matching Returns vector of stripes that is a band within which the alignment is expected to lie
pub fn seed_alignment<L: Letter<L>>(
  qry_seq: &[L],
  ref_seq: &[L],
  params: &AlignPairwiseParams,
) -> Result<Vec<Stripe>, Report> {
  let qry_len_u = qry_seq.len();
  let ref_len_u = ref_seq.len();
  let qry_len_i = qry_len_u as i32;
  let ref_len_i = ref_len_u as i32;
  // for very short sequences, use full square
  if ref_len_u + qry_len_u < (5 * params.seed_length) {
    let stripes = full_matrix(ref_len_u, qry_len_u);
    trace!("Band construction: Short qry&ref sequence (< 5*seed_length), thus using full matrix");
    return Ok(stripes);
  };
  // otherwise, determine seed matches roughly regularly spaced along the query sequence
  let (seed_matches, num_seeds) = get_seed_matches(qry_seq, ref_seq, params);
  let num_seed_matches = seed_matches.len();
  if num_seed_matches < 2 {
    return make_error!("Unable to align: no seed matches. Details: number of seed matches: {num_seed_matches}");
  }
  let match_rate = if num_seeds != 0 {
    (num_seed_matches as f64) / (num_seeds as f64)
  } else {
    0.0
  };
  if params.min_match_rate > match_rate  {
    return make_error!(
      "Unable to align: low seed matching rate. \
    Details: number of seeds: {num_seeds}, number of seed matches: {num_seed_matches}, \
    matching rate: {match_rate:5.3}, required matching rate: {:5.3}",
      params.min_match_rate
    );
  }
  let stripes = create_stripes(
    &seed_matches,
    qry_len_i,
    ref_len_i,
    params.terminal_bandwidth,
    params.excess_bandwidth,
    params.max_indel,
  );
  stripes
}
pub fn seed_alignment < L : Letter < L > > ( qry_seq : & [ L ] , ref_seq : & [ L ] , params : & AlignPairwiseParams , ) -> Result < Vec < Stripe > , Report > { let qry_len_u = qry_seq . len ( ) ; let ref_len_u = ref_seq . len ( ) ; let qry_len_i = qry_len_u as i32 ; let ref_len_i = ref_len_u as i32 ; // for very short sequences, use full square if ref_len_u + qry_len_u < ( 5 * params . seed_length ) { let stripes = full_matrix ( ref_len_u , qry_len_u ) ; trace ! ( " " ) ; return Ok ( stripes ) ; } ; // otherwise, determine seed matches roughly regularly spaced along the query sequence let ( seed_matches , num_seeds ) = get_seed_matches ( qry_seq , ref_seq , params ) ; let num_seed_matches = seed_matches . len ( ) ; if num_seed_matches < 2 { return make_error ! ( " " ) ; } let match_rate = if num_seeds != 0 { ( num_seed_matches as f64 ) / ( num_seeds as f64 ) } else { 0.0 } ; if params . min_match_rate > match_rate { return make_error ! ( " \
 \
 " params min_match_rate ) ; } let stripes = create_stripes ( & seed_matches , qry_len_i , ref_len_i , params . terminal_bandwidth , params . excess_bandwidth , params . max_indel , ) ; stripes }
Determine rough positioning of qry to reference sequence by approximate seed matching
Returns vector of stripes, that is a band within which the alignment is expected to lie
Determine rough positioning of qry to reference sequence by approximate seed matching Returns vector of stripes that is a band within which the alignment is expected to lie
qry_seq
&[L]
ref_seq
&[L]
params
&AlignPairwiseParams