fn make_3d_vector(heap: &mut BinaryHeap<GenomeAlignment>) -> Vec<Vec<Vec<GenomeAlignment>>> {
        let mut result: Vec<Vec<Vec<GenomeAlignment>>> = Vec::new();
        let mut cur_transposon_name = "".to_string();
        let mut cur_pos: u64 = std::u64::MAX;
        while let Some(alignment) = heap.pop() {
            let new_transposon_name = &alignment.te_name;
            let new_pos = alignment.get_boundary_nt();
            // if we are looking at the same transposon
            if new_transposon_name == &cur_transposon_name {
                // if we are looking at the same position
                if new_pos == cur_pos {
                    // add the transposon to the list of alignments at the current insertion
                    result
                        .last_mut()
                        .unwrap()
                        .last_mut()
                        .unwrap()
                        .push(alignment);
                }
                // if we are looking at a different position
                else {
                    cur_pos = new_pos;
                    result.last_mut().unwrap().push(vec![alignment]);
                }
            }
            // if we are looking at a different transposon
            else {
                cur_transposon_name = new_transposon_name.clone();
                cur_pos = new_pos;
                result.push(vec![vec![alignment]]);
            }
        }
        return result;
    }
// pull the genome alignments from a binary heap and store them in a 3D vector in sorted order
// outer dimension: which TE is it?
// middle dimension: which position is it? (note: all insertions in the heap are in the same chromosome)
// inner dimension: all of the reads at that specific TE insertion
pull the genome alignments from a binary heap and store them in a 3D vector in sorted order
outer dimension: which TE is it.
middle dimension: which position is it. (note: all insertions in the heap are in the same chromosome)
inner dimension: all of the reads at that specific TE insertion
pull the genome alignments from a binary heap and store them in a 3D vector in sorted order outer dimension : which TE is it . middle dimension : which position is it . ( note : all insertions in the heap are in the same chromosome ) inner dimension : all of the reads at that specific TE insertion
fn make_3d_vector(heap: &mut BinaryHeap<GenomeAlignment>) -> Vec<Vec<Vec<GenomeAlignment>>> {
        let mut result: Vec<Vec<Vec<GenomeAlignment>>> = Vec::new();
        let mut cur_transposon_name = "".to_string();
        let mut cur_pos: u64 = std::u64::MAX;
        while let Some(alignment) = heap.pop() {
            let new_transposon_name = &alignment.te_name;
            let new_pos = alignment.get_boundary_nt();
            // if we are looking at the same transposon
            if new_transposon_name == &cur_transposon_name {
                // if we are looking at the same position
                if new_pos == cur_pos {
                    // add the transposon to the list of alignments at the current insertion
                    result
                        .last_mut()
                        .unwrap()
                        .last_mut()
                        .unwrap()
                        .push(alignment);
                }
                // if we are looking at a different position
                else {
                    cur_pos = new_pos;
                    result.last_mut().unwrap().push(vec![alignment]);
                }
            }
            // if we are looking at a different transposon
            else {
                cur_transposon_name = new_transposon_name.clone();
                cur_pos = new_pos;
                result.push(vec![vec![alignment]]);
            }
        }
        return result;
    }
fn make_3d_vector ( heap : & mut BinaryHeap < GenomeAlignment > ) -> Vec < Vec < Vec < GenomeAlignment > > > { let mut result : Vec < Vec < Vec < GenomeAlignment > > > = Vec :: new ( ) ; let mut cur_transposon_name = " " . to_string ( ) ; let mut cur_pos : u64 = std :: u64 :: MAX ; while let Some ( alignment ) = heap . pop ( ) { let new_transposon_name = & alignment . te_name ; let new_pos = alignment . get_boundary_nt ( ) ; // if we are looking at the same transposon if new_transposon_name == & cur_transposon_name { // if we are looking at the same position if new_pos == cur_pos { // add the transposon to the list of alignments at the current insertion result . last_mut ( ) . unwrap ( ) . last_mut ( ) . unwrap ( ) . push ( alignment ) ; } // if we are looking at a different position else { cur_pos = new_pos ; result . last_mut ( ) . unwrap ( ) . push ( vec ! [ alignment ] ) ; } } // if we are looking at a different transposon else { cur_transposon_name = new_transposon_name . clone ( ) ; cur_pos = new_pos ; result . push ( vec ! [ vec [ alignment ] ] ) ; } } return result ; }
pull the genome alignments from a binary heap and store them in a 3D vector in sorted order
outer dimension: which TE is it?
pull the genome alignments from a binary heap and store them in a 3D vector in sorted order outer dimension : which TE is it?
heap
&mut BinaryHeap<GenomeAlignment>
heap
&mut BinaryHeap<GenomeAlignment>