pub fn from_string(scoring: Scoring<F>, seq: &[u64], seq_str: Option<&String>, seq_minim_pos: Option<&Vec<usize>>) -> Self {
        let mut graph: POAGraph =
            Graph::with_capacity(seq.len(), seq.len() - 1);
        let mut prev: NodeIndex<usize> = graph.add_node(seq[0]);
        let mut node: NodeIndex<usize>;
        let mut i = 1;
        for base in seq.iter().skip(1) {
            node = graph.add_node(*base);

            // adding sequence between minimizers to graph edges
            let seq_minim_pos = seq_minim_pos.unwrap();
            let between_minims = &seq_str.unwrap()[seq_minim_pos[i-1] as usize..seq_minim_pos[i] as usize];

            graph.add_edge(prev, node, (1,String::from(between_minims)));
            //let edge = graph.find_edge(prev, node).unwrap();
            prev = node;
            i += 1;
        }

        Poa { scoring, graph }
    }
/// Create a new POA graph from an initial reference sequence and alignment penalties.
///
/// # Arguments
///
/// * `scoring` - the score struct
/// * `reference` - a reference TextSlice to populate the initial reference graph
///
Create a new POA graph from an initial reference sequence and alignment penalties.
Create a new POA graph from an initial reference sequence and alignment penalties .
pub fn from_string(scoring: Scoring<F>, seq: &[u64], seq_str: Option<&String>, seq_minim_pos: Option<&Vec<usize>>) -> Self {
        let mut graph: POAGraph =
            Graph::with_capacity(seq.len(), seq.len() - 1);
        let mut prev: NodeIndex<usize> = graph.add_node(seq[0]);
        let mut node: NodeIndex<usize>;
        let mut i = 1;
        for base in seq.iter().skip(1) {
            node = graph.add_node(*base);
            // adding sequence between minimizers to graph edges
            let seq_minim_pos = seq_minim_pos.unwrap();
            let between_minims = &seq_str.unwrap()[seq_minim_pos[i-1] as usize..seq_minim_pos[i] as usize];
            graph.add_edge(prev, node, (1,String::from(between_minims)));
            //let edge = graph.find_edge(prev, node).unwrap();
            prev = node;
            i += 1;
        }
        Poa { scoring, graph }
    }
pub fn from_string ( scoring : Scoring < F > , seq : & [ u64 ] , seq_str : Option < & String > , seq_minim_pos : Option < & Vec < usize > > ) -> Self { let mut graph : POAGraph = Graph :: with_capacity ( seq . len ( ) , seq . len ( ) - 1 ) ; let mut prev : NodeIndex < usize > = graph . add_node ( seq [ 0 ] ) ; let mut node : NodeIndex < usize > ; let mut i = 1 ; for base in seq . iter ( ) . skip ( 1 ) { node = graph . add_node ( * base ) ; // adding sequence between minimizers to graph edges let seq_minim_pos = seq_minim_pos . unwrap ( ) ; let between_minims = & seq_str . unwrap ( ) [ seq_minim_pos [ i - 1 ] as usize .. seq_minim_pos [ i ] as usize ] ; graph . add_edge ( prev , node , ( 1 , String :: from ( between_minims ) ) ) ; //let edge = graph.find_edge(prev, node).unwrap(); prev = node ; i += 1 ; } Poa { scoring , graph } }
Create a new POA graph from an initial reference sequence and alignment penalties.
Create a new POA graph from an initial reference sequence and alignment penalties .
scoring
Scoring<F>
seq
&[u64]
seq_str
Option<&String>
seq_minim_pos
Option<&Vec<usize>>
scoring
Scoring<F>
seq
&[u64]
seq_str
Option<&String>
seq_minim_pos
Option<&Vec<usize>>