pub fn subsequences(
    a: &Sequence,
    b: &Sequence,
    limit: Option<usize>
) -> Vec<Vec<usize>>
Expand description

Get positions where bases from one genetic string occur in another genome as a subsequence

Within a DNA string, regions of significance are often scattered and interleaved by introns. It is therefore useful to obtain the positions, where relevant nuclea can be found.

Arguments

  • a - top-level sequence to search
  • b - subsequence to find in top-level sequence
  • limit - maximum number of position sets to generate

Example

use biogarden::processing::patterns::subsequences;
use biogarden::ds::sequence::Sequence;

let a = Sequence::from("ACGTACGTGACG");
let b = Sequence::from("GTA");
let limit = Some(4);

let reverses : Vec<Vec<usize>> = vec![
    vec![2, 3, 4],
    vec![2, 3, 9],
    vec![2, 7, 9],
    vec![6, 7, 9]
];
assert_eq!(subsequences(&a, &b, limit), reverses);