pub fn pretty(&self, aln: &Alignment, seq: &[u64]) -> String{
        let mut x_pretty = String::new();
        let mut y_pretty = String::new();
        let mut inb_pretty = String::new();

        if !aln.operations.is_empty() {
            let mut x_add = String::new();
            let mut y_add = String::new();
            let mut inb_add = String::new();

            let mut i: usize = aln.ystart;
            for op in aln.operations.iter() {
                match op {
                    AlignmentOperation::Match(None) => {
                        // I think it's the start of the alignment, as per the alignment() function
                        // that breaks here
                        i += 1;
                    },
                    AlignmentOperation::Match(Some((_, p))) => {
                        if seq[i] != self.graph.raw_nodes()[*p].weight {
                            x_add   = String::from("X");//x[i];
                            inb_add = String::from("_");
                            y_add   = String::from("X");//seq[i].to_string().clone();
                        }
                        else {
                            x_add   = String::from("M");//x[i];
                            inb_add = String::from("_");
                            y_add   = String::from("M");//seq[i].to_string().clone();
                        }
                        i += 1;
                    },
                    AlignmentOperation::Del(_)=> {
                        x_add   = String::from("-");
                        inb_add = String::from("_");
                        y_add   = String::from("D");//seq[i].to_string().clone();
                    },
                    AlignmentOperation::Ins(_) => {
                        x_add   = String::from("I");//x[i];
                        inb_add = String::from("_");
                        y_add   = String::from("-");
                        i += 1;
                    },
                    /*AlignmentOperation::Ins(Some(_)) => {
                        x_add   = String::from("i");//x[i];
                        inb_add = String::from("_");
                        y_add   = String::from("-");
                        i += 1;
                    }*/

                }

                x_pretty.push_str(&x_add);
                inb_pretty.push_str(&inb_add);
                y_pretty.push_str(&y_add);
            }
        }
        format!("{}\n{}\n{}", x_pretty, inb_pretty, y_pretty)

    }
/// Return a pretty formatted alignment, but it is a very rough approximation (we return a linear
/// representation but keep in mind the template is a graph)
/// interpretation:
/// M = match, X mismatch
/// D = deletion, I = insertion, i = some other strange kind of insertion
Return a pretty formatted alignment, but it is a very rough approximation (we return a linear
representation but keep in mind the template is a graph)
interpretation:
M = match, X mismatch
D = deletion, I = insertion, i = some other strange kind of insertion
Return a pretty formatted alignment but it is a very rough approximation ( we return a linear representation but keep in mind the template is a graph ) interpretation : M = match X mismatch D = deletion I = insertion i = some other strange kind of insertion
pub fn pretty(&self, aln: &Alignment, seq: &[u64]) -> String{
        let mut x_pretty = String::new();
        let mut y_pretty = String::new();
        let mut inb_pretty = String::new();
        if !aln.operations.is_empty() {
            let mut x_add = String::new();
            let mut y_add = String::new();
            let mut inb_add = String::new();
            let mut i: usize = aln.ystart;
            for op in aln.operations.iter() {
                match op {
                    AlignmentOperation::Match(None) => {
                        // I think it's the start of the alignment, as per the alignment() function
                        // that breaks here
                        i += 1;
                    },
                    AlignmentOperation::Match(Some((_, p))) => {
                        if seq[i] != self.graph.raw_nodes()[*p].weight {
                            x_add   = String::from("X");//x[i];
                            inb_add = String::from("_");
                            y_add   = String::from("X");//seq[i].to_string().clone();
                        }
                        else {
                            x_add   = String::from("M");//x[i];
                            inb_add = String::from("_");
                            y_add   = String::from("M");//seq[i].to_string().clone();
                        }
                        i += 1;
                    },
                    AlignmentOperation::Del(_)=> {
                        x_add   = String::from("-");
                        inb_add = String::from("_");
                        y_add   = String::from("D");//seq[i].to_string().clone();
                    },
                    AlignmentOperation::Ins(_) => {
                        x_add   = String::from("I");//x[i];
                        inb_add = String::from("_");
                        y_add   = String::from("-");
                        i += 1;
                    },
                    /*AlignmentOperation::Ins(Some(_)) => {
                        x_add   = String::from("i");//x[i];
                        inb_add = String::from("_");
                        y_add   = String::from("-");
                        i += 1;
                    }*/
                }
                x_pretty.push_str(&x_add);
                inb_pretty.push_str(&inb_add);
                y_pretty.push_str(&y_add);
            }
        }
        format!("{}\n{}\n{}", x_pretty, inb_pretty, y_pretty)
    }
pub fn pretty ( & self , aln : & Alignment , seq : & [ u64 ] ) -> String { let mut x_pretty = String :: new ( ) ; let mut y_pretty = String :: new ( ) ; let mut inb_pretty = String :: new ( ) ; if ! aln . operations . is_empty ( ) { let mut x_add = String :: new ( ) ; let mut y_add = String :: new ( ) ; let mut inb_add = String :: new ( ) ; let mut i : usize = aln . ystart ; for op in aln . operations . iter ( ) { match op { AlignmentOperation :: Match ( None ) => { // I think it's the start of the alignment, as per the alignment() function // that breaks here i += 1 ; } , AlignmentOperation :: Match ( Some ( ( _ , p ) ) ) => { if seq [ i ] != self . graph . raw_nodes ( ) [ * p ] . weight { x_add = String :: from ( " " ) ; //x[i]; inb_add = String :: from ( " " ) ; y_add = String :: from ( " " ) ; //seq[i].to_string().clone(); } else { x_add = String :: from ( " " ) ; //x[i]; inb_add = String :: from ( " " ) ; y_add = String :: from ( " " ) ; //seq[i].to_string().clone(); } i += 1 ; } , AlignmentOperation :: Del ( _ ) => { x_add = String :: from ( " " ) ; inb_add = String :: from ( " " ) ; y_add = String :: from ( " " ) ; //seq[i].to_string().clone(); } , AlignmentOperation :: Ins ( _ ) => { x_add = String :: from ( " " ) ; //x[i]; inb_add = String :: from ( " " ) ; y_add = String :: from ( " " ) ; i += 1 ; } , /*AlignmentOperation::Ins(Some(_)) => {
                        x_add   = String::from("i");//x[i];
                        inb_add = String::from("_");
                        y_add   = String::from("-");
                        i += 1;
                    }*/ } x_pretty . push_str ( & x_add ) ; inb_pretty . push_str ( & inb_add ) ; y_pretty . push_str ( & y_add ) ; } } format ! ( " \n \n " x_pretty inb_pretty y_pretty ) }
Return a pretty formatted alignment, but it is a very rough approximation (we return a linear
representation but keep in mind the template is a graph)
interpretation:
M = match, X mismatch
D = deletion, I = insertion, i = some other strange kind of insertion
Return a pretty formatted alignment but it is a very rough approximation ( we return a linear representation but keep in mind the template is a graph ) interpretation : M = match X mismatch D = deletion I = insertion i = some other strange kind of insertion
&self
aln
&Alignment
seq
&[u64]
&self
aln
&Alignment
seq
&[u64]