rust_htslib/bam/
ext.rs

1//// Copyright 2019 Johannes Köster and Florian Finkernagel.
2// Licensed under the MIT license (http://opensource.org/licenses/MIT)
3// This file may not be copied, modified, or distributed
4// except according to those terms.
5
6//! Extensions for BAM records beyond htslib
7
8use crate::bam;
9use crate::bam::record::Cigar;
10use crate::htslib;
11use std::collections::HashMap;
12
13pub struct IterAlignedBlockPairs {
14    genome_pos: i64,
15    read_pos: i64,
16    cigar_index: usize,
17    cigar: Vec<Cigar>,
18}
19
20impl Iterator for IterAlignedBlockPairs {
21    type Item = ([i64; 2], [i64; 2]);
22    fn next(&mut self) -> Option<Self::Item> {
23        while self.cigar_index < self.cigar.len() {
24            let entry = self.cigar[self.cigar_index];
25            match entry {
26                Cigar::Match(len) | Cigar::Equal(len) | Cigar::Diff(len) => {
27                    let qstart = self.read_pos;
28                    let qend = qstart + len as i64;
29                    let rstart = self.genome_pos;
30                    let rend = self.genome_pos + len as i64;
31                    self.read_pos += len as i64;
32                    self.genome_pos += len as i64;
33                    self.cigar_index += 1;
34                    return Some(([qstart, qend], [rstart, rend]));
35                }
36                Cigar::Ins(len) | Cigar::SoftClip(len) => {
37                    self.read_pos += len as i64;
38                }
39                Cigar::Del(len) | Cigar::RefSkip(len) => {
40                    self.genome_pos += len as i64;
41                }
42                Cigar::HardClip(_) => {} // no advance
43                Cigar::Pad(_) => panic!("Padding (Cigar::Pad) is not supported."), //padding is only used for multiple sequence alignment
44            }
45            self.cigar_index += 1;
46        }
47        None
48    }
49}
50
51pub struct IterAlignedBlocks {
52    pos: i64,
53    cigar_index: usize,
54    cigar: Vec<Cigar>,
55}
56
57impl Iterator for IterAlignedBlocks {
58    type Item = [i64; 2];
59    fn next(&mut self) -> Option<Self::Item> {
60        while self.cigar_index < self.cigar.len() {
61            let entry = self.cigar[self.cigar_index];
62            match entry {
63                Cigar::Match(len) | Cigar::Equal(len) | Cigar::Diff(len) => {
64                    let out_pos = self.pos;
65                    //result.push([pos, pos + *len as i64]);
66                    self.pos += len as i64;
67                    self.cigar_index += 1;
68                    return Some([out_pos, out_pos + len as i64]);
69                }
70                Cigar::Del(len) => self.pos += len as i64,
71                Cigar::RefSkip(len) => self.pos += len as i64,
72                _ => (),
73            }
74            self.cigar_index += 1;
75        }
76        None
77    }
78}
79
80pub struct IterIntrons {
81    pos: i64,
82    cigar_index: usize,
83    cigar: Vec<Cigar>,
84}
85
86impl Iterator for IterIntrons {
87    type Item = [i64; 2];
88    fn next(&mut self) -> Option<Self::Item> {
89        while self.cigar_index < self.cigar.len() {
90            let entry = self.cigar[self.cigar_index];
91            match entry {
92                Cigar::Match(len) | Cigar::Equal(len) | Cigar::Diff(len) | Cigar::Del(len) => {
93                    self.pos += len as i64
94                }
95                Cigar::RefSkip(len) => {
96                    let junc_start = self.pos;
97                    self.pos += len as i64;
98                    self.cigar_index += 1;
99                    return Some([junc_start, self.pos]); //self.pos is  junc_start + len
100                }
101                _ => {}
102            }
103            self.cigar_index += 1;
104        }
105        None
106    }
107}
108
109pub struct IterAlignedPairs {
110    genome_pos: i64,
111    read_pos: i64,
112    cigar: Vec<Cigar>,
113    remaining_match_bp: u32,
114    cigar_index: usize,
115}
116
117impl Iterator for IterAlignedPairs {
118    type Item = [i64; 2];
119    fn next(&mut self) -> Option<Self::Item> {
120        if self.remaining_match_bp > 0 {
121            self.remaining_match_bp -= 1;
122            self.genome_pos += 1;
123            self.read_pos += 1;
124            return Some([self.read_pos - 1, self.genome_pos - 1]);
125        }
126
127        while self.cigar_index < self.cigar.len() {
128            let entry = self.cigar[self.cigar_index];
129            match entry {
130                Cigar::Match(len) | Cigar::Equal(len) | Cigar::Diff(len) => {
131                    self.genome_pos += 1;
132                    self.read_pos += 1;
133                    self.remaining_match_bp = len - 1;
134                    self.cigar_index += 1;
135                    return Some([self.read_pos - 1, self.genome_pos - 1]);
136                }
137                Cigar::Ins(len) | Cigar::SoftClip(len) => {
138                    self.read_pos += len as i64;
139                }
140                Cigar::Del(len) | Cigar::RefSkip(len) => {
141                    self.genome_pos += len as i64;
142                }
143                Cigar::HardClip(_) => {} // no advance
144                Cigar::Pad(_) => panic!("Padding (Cigar::Pad) is not supported."), //padding is only used for multiple sequence alignment
145            }
146            self.cigar_index += 1;
147        }
148        None
149    }
150}
151
152pub struct IterAlignedPairsFull {
153    genome_pos: i64,
154    read_pos: i64,
155    cigar: Vec<Cigar>,
156    remaining_match_bp: u32,
157    remaining_ins_bp: u32,
158    remaining_del_bp: u32,
159    cigar_index: usize,
160}
161
162impl Iterator for IterAlignedPairsFull {
163    type Item = [Option<i64>; 2];
164    fn next(&mut self) -> Option<Self::Item> {
165        if self.remaining_match_bp > 0 {
166            self.remaining_match_bp -= 1;
167            self.genome_pos += 1;
168            self.read_pos += 1;
169            return Some([Some(self.read_pos - 1), Some(self.genome_pos - 1)]);
170        }
171        if self.remaining_ins_bp > 0 {
172            self.remaining_ins_bp -= 1;
173            self.read_pos += 1;
174            return Some([Some(self.read_pos - 1), None]);
175        }
176        if self.remaining_del_bp > 0 {
177            self.remaining_del_bp -= 1;
178            self.genome_pos += 1;
179            return Some([None, Some(self.genome_pos - 1)]);
180        }
181
182        while self.cigar_index < self.cigar.len() {
183            let entry = self.cigar[self.cigar_index];
184            match entry {
185                Cigar::Match(len) | Cigar::Equal(len) | Cigar::Diff(len) => {
186                    self.genome_pos += 1;
187                    self.read_pos += 1;
188                    self.remaining_match_bp = len - 1;
189                    self.cigar_index += 1;
190                    return Some([Some(self.read_pos - 1), Some(self.genome_pos - 1)]);
191                }
192                Cigar::Ins(len) | Cigar::SoftClip(len) => {
193                    self.read_pos += 1;
194                    self.remaining_ins_bp = len - 1;
195                    self.cigar_index += 1;
196                    return Some([Some(self.read_pos - 1), None]);
197                }
198                Cigar::Del(len) | Cigar::RefSkip(len) => {
199                    self.genome_pos += 1;
200                    self.remaining_del_bp = len - 1;
201                    self.cigar_index += 1;
202                    return Some([None, Some(self.genome_pos - 1)]);
203                }
204                Cigar::HardClip(_) => {
205                    // no advance
206                }
207                Cigar::Pad(_) => panic!("Padding (Cigar::Pad) is not supported."), //padding is only used for multiple sequence alignment
208            }
209            self.cigar_index += 1;
210        }
211        None
212    }
213}
214
215/// Extra functionality for BAM records
216///
217/// Inspired by pysam
218pub trait BamRecordExtensions {
219    /// iterator over start and end positions of aligned gapless blocks
220    ///
221    /// The start and end positions are in genomic coordinates.
222    /// There is not necessarily a gap between blocks on the genome,
223    /// this happens on insertions.
224    ///
225    /// pysam: blocks
226    /// See also: [aligned_block_pairs](#tymethod.aligned_block_pairs) if you need
227    /// the read coordinates as well.
228    fn aligned_blocks(&self) -> IterAlignedBlocks;
229
230    ///Iter over <([read_start, read_stop], [genome_start, genome_stop]) blocks
231    ///of continously aligned reads.
232    ///
233    ///In contrast to [aligned_blocks](#tymethod.aligned_blocks), this returns
234    ///read and genome coordinates.
235    ///In contrast to aligned_pairs, this returns just the start-stop
236    ///coordinates of each block.
237    ///
238    ///There is not necessarily a gap between blocks in either coordinate space
239    ///(this happens in in-dels).
240    fn aligned_block_pairs(&self) -> IterAlignedBlockPairs;
241
242    /// This scans the CIGAR for reference skips
243    /// and reports their positions.
244    /// It does not inspect the reported regions
245    /// for actual splice sites.
246    /// pysam: get_introns
247    fn introns(&self) -> IterIntrons;
248
249    /// iter aligned read and reference positions on a basepair level
250    ///
251    /// No entry for insertions, deletions or skipped pairs
252    ///
253    /// pysam: get_aligned_pairs(matches_only = True)
254    ///
255    /// See also [aligned_block_pairs](#tymethod.aligned_block_pairs)
256    /// if you just need start&end coordinates of each block.
257    /// That way you can allocate less memory for the same
258    /// informational content.
259    fn aligned_pairs(&self) -> IterAlignedPairs;
260
261    /// iter list of read and reference positions on a basepair level.
262    ///
263    /// Unlike `aligned_pairs` this returns None in
264    /// either the read positions or the reference position
265    /// for insertions, deletions or skipped pairs
266    ///
267    /// pysam: aligned_pairs(matches_only = False)
268    fn aligned_pairs_full(&self) -> IterAlignedPairsFull;
269
270    /// the number of nucleotides covered by each Cigar::* variant.
271    ///
272    /// Result is a Hashmap Cigar::*(0) => covered nucleotides
273    ///
274    /// pysam: first result from get_cigar_stats
275    fn cigar_stats_nucleotides(&self) -> HashMap<Cigar, i32>;
276
277    /// the number of occurrences of each each Cigar::* variant
278    ///
279    /// Result is a Hashmap Cigar::*(0) => number of times this Cigar::
280    /// appeared
281    ///
282    /// pysam: second result from get_cigar_stats
283    fn cigar_stats_blocks(&self) -> HashMap<Cigar, i32>;
284
285    /// iter over  reference positions that this read aligns to
286    ///
287    /// only returns positions that are aligned, excluding any soft-clipped
288    /// or unaligned positions within the read
289    ///
290    /// pysam: get_reference_positions(full_length=False)
291    fn reference_positions(&self) -> Box<dyn Iterator<Item = i64>>;
292
293    ///
294    /// iter over reference positions that this read aligns to
295    ///
296    /// include soft-clipped or skipped positions as None
297    ///
298    /// pysam: get_reference_positions(full_length=True)
299    fn reference_positions_full(&self) -> Box<dyn Iterator<Item = Option<i64>>>;
300
301    /// left most aligned reference position of the read on the reference genome.
302    fn reference_start(&self) -> i64;
303
304    /// right most aligned reference position of the read on the reference genome.
305    fn reference_end(&self) -> i64;
306
307    /// infer the query length from the cigar string, optionally include hard clipped bases
308    ///
309    /// Contrast with record::seq_len which returns the length of the sequence stored
310    /// in the BAM file, and as such is 0 if the BAM file omits sequences
311    ///
312    /// pysam: infer_query_length / infer_read_length
313    fn seq_len_from_cigar(&self, include_hard_clip: bool) -> usize;
314}
315
316impl BamRecordExtensions for bam::Record {
317    fn aligned_blocks(&self) -> IterAlignedBlocks {
318        IterAlignedBlocks {
319            pos: self.pos(),
320            cigar: self.cigar().take().0,
321            cigar_index: 0,
322        }
323    }
324
325    fn introns(&self) -> IterIntrons {
326        IterIntrons {
327            pos: self.pos(),
328            cigar: self.cigar().take().0,
329            cigar_index: 0,
330        }
331    }
332
333    fn aligned_block_pairs(&self) -> IterAlignedBlockPairs {
334        IterAlignedBlockPairs {
335            genome_pos: self.pos(),
336            read_pos: 0,
337            cigar: self.cigar().take().0,
338            cigar_index: 0,
339        }
340    }
341
342    fn aligned_pairs(&self) -> IterAlignedPairs {
343        IterAlignedPairs {
344            genome_pos: self.pos(),
345            read_pos: 0,
346            cigar: self.cigar().take().0,
347            remaining_match_bp: 0,
348            cigar_index: 0,
349        }
350    }
351
352    fn aligned_pairs_full(&self) -> IterAlignedPairsFull {
353        IterAlignedPairsFull {
354            genome_pos: self.pos(),
355            read_pos: 0,
356            cigar: self.cigar().take().0,
357            remaining_match_bp: 0,
358            remaining_ins_bp: 0,
359            remaining_del_bp: 0,
360            cigar_index: 0,
361        }
362    }
363
364    fn cigar_stats_nucleotides(&self) -> HashMap<Cigar, i32> {
365        let mut result = HashMap::new();
366        result.insert(Cigar::Match(0), 0); // M
367        result.insert(Cigar::Ins(0), 0); // I
368        result.insert(Cigar::Del(0), 0); // D
369        result.insert(Cigar::RefSkip(0), 0); // N
370        result.insert(Cigar::SoftClip(0), 0); // S
371        result.insert(Cigar::HardClip(0), 0); // H
372        result.insert(Cigar::Pad(0), 0); // P
373        result.insert(Cigar::Equal(0), 0); // =
374        result.insert(Cigar::Diff(0), 0); // X
375        for entry in self.cigar().iter() {
376            match entry {
377                Cigar::Match(len) => *result.get_mut(&Cigar::Match(0)).unwrap() += *len as i32, // M
378                Cigar::Ins(len) => *result.get_mut(&Cigar::Ins(0)).unwrap() += *len as i32,     // I
379                Cigar::Del(len) => *result.get_mut(&Cigar::Del(0)).unwrap() += *len as i32,     // D
380                Cigar::RefSkip(len) => *result.get_mut(&Cigar::RefSkip(0)).unwrap() += *len as i32, // N
381                Cigar::SoftClip(len) => {
382                    *result.get_mut(&Cigar::SoftClip(0)).unwrap() += *len as i32
383                } // S
384                Cigar::HardClip(len) => {
385                    *result.get_mut(&Cigar::HardClip(0)).unwrap() += *len as i32
386                } // H
387                Cigar::Pad(len) => *result.get_mut(&Cigar::Pad(0)).unwrap() += *len as i32, // P
388                Cigar::Equal(len) => *result.get_mut(&Cigar::Equal(0)).unwrap() += *len as i32, // =
389                Cigar::Diff(len) => *result.get_mut(&Cigar::Diff(0)).unwrap() += *len as i32, // X
390            }
391        }
392        result
393    }
394
395    fn cigar_stats_blocks(&self) -> HashMap<Cigar, i32> {
396        let mut result = HashMap::new();
397        result.insert(Cigar::Match(0), 0); // M
398        result.insert(Cigar::Ins(0), 0); // I
399        result.insert(Cigar::Del(0), 0); // D
400        result.insert(Cigar::RefSkip(0), 0); // N
401        result.insert(Cigar::SoftClip(0), 0); // S
402        result.insert(Cigar::HardClip(0), 0); // H
403        result.insert(Cigar::Pad(0), 0); // P
404        result.insert(Cigar::Equal(0), 0); // =
405        result.insert(Cigar::Diff(0), 0); // X
406        for entry in self.cigar().iter() {
407            match entry {
408                Cigar::Match(_) => *result.get_mut(&Cigar::Match(0)).unwrap() += 1, // M
409                Cigar::Ins(_) => *result.get_mut(&Cigar::Ins(0)).unwrap() += 1,     // I
410                Cigar::Del(_) => *result.get_mut(&Cigar::Del(0)).unwrap() += 1,     // D
411                Cigar::RefSkip(_) => *result.get_mut(&Cigar::RefSkip(0)).unwrap() += 1, // N
412                Cigar::SoftClip(_) => *result.get_mut(&Cigar::SoftClip(0)).unwrap() += 1, // S
413                Cigar::HardClip(_) => *result.get_mut(&Cigar::HardClip(0)).unwrap() += 1, // H
414                Cigar::Pad(_) => *result.get_mut(&Cigar::Pad(0)).unwrap() += 1,     // P
415                Cigar::Equal(_) => *result.get_mut(&Cigar::Equal(0)).unwrap() += 1, // =
416                Cigar::Diff(_) => *result.get_mut(&Cigar::Diff(0)).unwrap() += 1,   // X
417            }
418        }
419        result
420    }
421
422    fn reference_positions(&self) -> Box<dyn Iterator<Item = i64>> {
423        Box::new(self.aligned_pairs().map(|x| x[1]))
424    }
425
426    fn reference_positions_full(&self) -> Box<dyn Iterator<Item = Option<i64>>> {
427        Box::new(
428            self.aligned_pairs_full()
429                .filter(|x| x[0].is_some())
430                .map(|x| x[1]),
431        )
432    }
433
434    fn reference_start(&self) -> i64 {
435        self.pos()
436    }
437
438    /// Calculate the rightmost base position of an alignment on the reference genome.
439    /// Returns the coordinate of the first base after the alignment (0-based).
440    fn reference_end(&self) -> i64 {
441        unsafe { htslib::bam_endpos(self.inner_ptr()) }
442    }
443
444    fn seq_len_from_cigar(&self, include_hard_clip: bool) -> usize {
445        let mut result = 0;
446        for entry in self.cigar().iter() {
447            match entry {
448                Cigar::Match(len)
449                | Cigar::Ins(len)
450                | Cigar::SoftClip(len)
451                | Cigar::Equal(len)
452                | Cigar::Diff(len) => {
453                    result += len;
454                }
455                Cigar::HardClip(len) => {
456                    if include_hard_clip {
457                        result += len;
458                    }
459                }
460                _ => {}
461            }
462        }
463        result as usize
464    }
465}
466
467#[cfg(test)]
468mod tests {
469    use crate::bam;
470    use crate::bam::ext::BamRecordExtensions;
471    use crate::bam::record::{Cigar, CigarString};
472    use crate::bam::Read;
473    use std::collections::HashMap;
474
475    #[test]
476    fn spliced_reads() {
477        let mut bam = bam::Reader::from_path("./test/test_spliced_reads.bam").unwrap();
478        let mut it = bam.records();
479        let blocks: Vec<_> = it.next().expect("iter").unwrap().aligned_blocks().collect();
480        //6S45M - 0
481        assert!(blocks[0] == [16050676, 16050721]);
482
483        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
484        //7M2D44M - 1
485        assert!(blocks[0] == [16096878, 16096885]);
486        //7M2D44M - 1
487        assert!(blocks[1] == [16096887, 16096931]);
488
489        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
490        //29M2D22M - 2
491        assert!(blocks[0] == [16097145, 16097174]);
492        //29M2D22M - 2
493        assert!(blocks[1] == [16097176, 16097198]);
494
495        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
496        //51M - 3
497        assert!(blocks[0] == [16117350, 16117401]);
498
499        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
500        //51M - 4
501        assert!(blocks[0] == [16118483, 16118534]);
502
503        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
504        //51M - 5
505        assert!(blocks[0] == [16118499, 16118550]);
506
507        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
508        //51M - 6
509        assert!(blocks[0] == [16118499, 16118550]);
510
511        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
512        //51M - 7
513        assert!(blocks[0] == [16118499, 16118550]);
514
515        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
516        //51M - 8
517        assert!(blocks[0] == [16123411, 16123462]);
518
519        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
520        //6S45M - 9
521        assert!(blocks[0] == [16123417, 16123462]);
522
523        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
524        //41M10S - 10
525        assert!(blocks[0] == [16165860, 16165901]);
526
527        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
528        //51M - 11
529        assert!(blocks[0] == [16180871, 16180922]);
530
531        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
532        //51M - 12
533        assert!(blocks[0] == [16189705, 16189756]);
534
535        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
536        //51M - 13
537        assert!(blocks[0] == [16231271, 16231322]);
538
539        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
540        //51M - 14
541        assert!(blocks[0] == [16237657, 16237708]);
542
543        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
544        //9S42M - 15
545        assert!(blocks[0] == [16255012, 16255054]);
546
547        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
548        //51M - 16
549        assert!(blocks[0] == [16255391, 16255442]);
550
551        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
552        //50M1S - 17
553        assert!(blocks[0] == [16255392, 16255442]);
554
555        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
556        //45M6S - 18
557        assert!(blocks[0] == [16256084, 16256129]);
558
559        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
560        //3S48M - 19
561        assert!(blocks[0] == [16256224, 16256272]);
562
563        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
564        //42M9S - 20
565        assert!(blocks[0] == [16325199, 16325241]);
566
567        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
568        //13S38M - 21
569        assert!(blocks[0] == [16352865, 16352903]);
570
571        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
572        //44M7S - 22
573        assert!(blocks[0] == [16352968, 16353012]);
574
575        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
576        //5S46M - 23
577        assert!(blocks[0] == [16414998, 16415044]);
578
579        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
580        //23M4I24M - 24
581        assert!(blocks[0] == [17031591, 17031614]);
582        //23M4I24M - 24
583        assert!(blocks[1] == [17031614, 17031638]);
584
585        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
586        //18M1I32M - 25
587        assert!(blocks[0] == [17057382, 17057400]);
588        //18M1I32M - 25
589        assert!(blocks[1] == [17057400, 17057432]);
590
591        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
592        //17M2183N34M - 26
593        assert!(blocks[0] == [17092766, 17092783]);
594        //17M2183N34M - 26
595        assert!(blocks[1] == [17094966, 17095000]);
596
597        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
598        //1M2183N50M - 27
599        assert!(blocks[0] == [17092782, 17092783]);
600        //1M2183N50M - 27
601        assert!(blocks[1] == [17094966, 17095016]);
602
603        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
604        //1M2183N50M - 28
605        assert!(blocks[0] == [17092782, 17092783]);
606        //1M2183N50M - 28
607        assert!(blocks[1] == [17094966, 17095016]);
608
609        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
610        //9S33M9S - 29
611        assert!(blocks[0] == [17137287, 17137320]);
612
613        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
614        //2S48M1S - 30
615        assert!(blocks[0] == [17306238, 17306286]);
616
617        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
618        //4S45M2S - 31
619        assert!(blocks[0] == [17561868, 17561913]);
620
621        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
622        //41M11832N10M - 32
623        assert!(blocks[0] == [17566078, 17566119]);
624        //41M11832N10M - 32
625        assert!(blocks[1] == [17577951, 17577961]);
626
627        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
628        //11M11832N25M710N15M - 33
629        assert!(blocks[0] == [17566108, 17566119]);
630        //11M11832N25M710N15M - 33
631        assert!(blocks[1] == [17577951, 17577976]);
632        //11M11832N25M710N15M - 33
633        assert!(blocks[2] == [17578686, 17578701]);
634
635        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
636        //8M11832N25M710N18M - 34
637        assert!(blocks[0] == [17566111, 17566119]);
638        //8M11832N25M710N18M - 34
639        assert!(blocks[1] == [17577951, 17577976]);
640        //8M11832N25M710N18M - 34
641        assert!(blocks[2] == [17578686, 17578704]);
642
643        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
644        //8M11832N25M710N18M - 35
645        assert!(blocks[0] == [17566111, 17566119]);
646        //8M11832N25M710N18M - 35
647        assert!(blocks[1] == [17577951, 17577976]);
648        //8M11832N25M710N18M - 35
649        assert!(blocks[2] == [17578686, 17578704]);
650
651        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
652        //8M11832N25M710N18M - 36
653        assert!(blocks[0] == [17566111, 17566119]);
654        //8M11832N25M710N18M - 36
655        assert!(blocks[1] == [17577951, 17577976]);
656        //8M11832N25M710N18M - 36
657        assert!(blocks[2] == [17578686, 17578704]);
658
659        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
660        //8M11832N25M710N18M - 37
661        assert!(blocks[0] == [17566111, 17566119]);
662        //8M11832N25M710N18M - 37
663        assert!(blocks[1] == [17577951, 17577976]);
664        //8M11832N25M710N18M - 37
665        assert!(blocks[2] == [17578686, 17578704]);
666
667        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
668        //7M11832N25M710N19M - 38
669        assert!(blocks[0] == [17566112, 17566119]);
670        //7M11832N25M710N19M - 38
671        assert!(blocks[1] == [17577951, 17577976]);
672        //7M11832N25M710N19M - 38
673        assert!(blocks[2] == [17578686, 17578705]);
674
675        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
676        //6M11832N25M710N20M - 39
677        assert!(blocks[0] == [17566113, 17566119]);
678        //6M11832N25M710N20M - 39
679        assert!(blocks[1] == [17577951, 17577976]);
680        //6M11832N25M710N20M - 39
681        assert!(blocks[2] == [17578686, 17578706]);
682
683        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
684        //6M11832N25M710N20M - 40
685        assert!(blocks[0] == [17566113, 17566119]);
686        //6M11832N25M710N20M - 40
687        assert!(blocks[1] == [17577951, 17577976]);
688        //6M11832N25M710N20M - 40
689        assert!(blocks[2] == [17578686, 17578706]);
690
691        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
692        //1S44M1467N6M - 41
693        assert!(blocks[0] == [17579733, 17579777]);
694        //1S44M1467N6M - 41
695        assert!(blocks[1] == [17581244, 17581250]);
696
697        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
698        //2M1514N48M95N1M - 42
699        assert!(blocks[0] == [17581369, 17581371]);
700        //2M1514N48M95N1M - 42
701        assert!(blocks[1] == [17582885, 17582933]);
702        //2M1514N48M95N1M - 42
703        assert!(blocks[2] == [17583028, 17583029]);
704
705        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
706        //1M1514N48M95N2M - 43
707        assert!(blocks[0] == [17581370, 17581371]);
708        //1M1514N48M95N2M - 43
709        assert!(blocks[1] == [17582885, 17582933]);
710        //1M1514N48M95N2M - 43
711        assert!(blocks[2] == [17583028, 17583030]);
712
713        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
714        //1M1514N48M95N2M - 44
715        assert!(blocks[0] == [17581370, 17581371]);
716        //1M1514N48M95N2M - 44
717        assert!(blocks[1] == [17582885, 17582933]);
718        //1M1514N48M95N2M - 44
719        assert!(blocks[2] == [17583028, 17583030]);
720
721        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
722        //1S22M95N28M - 45
723        assert!(blocks[0] == [17582911, 17582933]);
724        //1S22M95N28M - 45
725        assert!(blocks[1] == [17583028, 17583056]);
726
727        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
728        //37M538N13M1S - 46
729        assert!(blocks[0] == [17588621, 17588658]);
730        //37M538N13M1S - 46
731        assert!(blocks[1] == [17589196, 17589209]);
732
733        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
734        //37M538N13M1S - 47
735        assert!(blocks[0] == [17588621, 17588658]);
736        //37M538N13M1S - 47
737        assert!(blocks[1] == [17589196, 17589209]);
738
739        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
740        //37M538N13M1S - 48
741        assert!(blocks[0] == [17588621, 17588658]);
742        //37M538N13M1S - 48
743        assert!(blocks[1] == [17589196, 17589209]);
744
745        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
746        //1S25M1D25M - 49
747        assert!(blocks[0] == [17591770, 17591795]);
748        //1S25M1D25M - 49
749        assert!(blocks[1] == [17591796, 17591821]);
750
751        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
752        //24M1D24M3S - 50
753        assert!(blocks[0] == [17593855, 17593879]);
754        //24M1D24M3S - 50
755        assert!(blocks[1] == [17593880, 17593904]);
756
757        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
758        //16M1D28M7S - 51
759        assert!(blocks[0] == [17593863, 17593879]);
760        //16M1D28M7S - 51
761        assert!(blocks[1] == [17593880, 17593908]);
762
763        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
764        //11S7M1I32M - 52
765        assert!(blocks[0] == [17596476, 17596483]);
766        //11S7M1I32M - 52
767        assert!(blocks[1] == [17596483, 17596515]);
768
769        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
770        //5S9M1892N37M - 53
771        assert!(blocks[0] == [17624012, 17624021]);
772        //5S9M1892N37M - 53
773        assert!(blocks[1] == [17625913, 17625950]);
774
775        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
776        //2S9M1892N40M - 54
777        assert!(blocks[0] == [17624012, 17624021]);
778        //2S9M1892N40M - 54
779        assert!(blocks[1] == [17625913, 17625953]);
780
781        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
782        //1S7M3D19M2285N24M - 55
783        assert!(blocks[0] == [31796700, 31796707]);
784        //1S7M3D19M2285N24M - 55
785        assert!(blocks[1] == [31796710, 31796729]);
786        //1S7M3D19M2285N24M - 55
787        assert!(blocks[2] == [31799014, 31799038]);
788
789        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
790        //14M799N28M13881N7M2S - 56
791        assert!(blocks[0] == [36722692, 36722706]);
792        //14M799N28M13881N7M2S - 56
793        assert!(blocks[1] == [36723505, 36723533]);
794        //14M799N28M13881N7M2S - 56
795        assert!(blocks[2] == [36737414, 36737421]);
796
797        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
798        //4S21M1696N23M2331N3M - 57
799        assert!(blocks[0] == [44587963, 44587984]);
800        //4S21M1696N23M2331N3M - 57
801        assert!(blocks[1] == [44589680, 44589703]);
802        //4S21M1696N23M2331N3M - 57
803        assert!(blocks[2] == [44592034, 44592037]);
804    }
805
806    #[test]
807    fn test_introns() {
808        let mut bam = bam::Reader::from_path("./test/test_spliced_reads.bam").unwrap();
809        let mut it = bam.records();
810
811        //6S45M - 0
812        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
813        assert_eq!(introns.len(), 0);
814        //7M2D44M - 1
815        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
816        assert_eq!(introns.len(), 0);
817        //29M2D22M - 2
818        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
819        assert_eq!(introns.len(), 0);
820        //51M - 3
821        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
822        assert_eq!(introns.len(), 0);
823        //51M - 4
824        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
825        assert_eq!(introns.len(), 0);
826        //51M - 5
827        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
828        assert_eq!(introns.len(), 0);
829        //51M - 6
830        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
831        assert_eq!(introns.len(), 0);
832        //51M - 7
833        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
834        assert_eq!(introns.len(), 0);
835        //51M - 8
836        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
837        assert_eq!(introns.len(), 0);
838        //6S45M - 9
839        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
840        assert_eq!(introns.len(), 0);
841        //41M10S - 10
842        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
843        assert_eq!(introns.len(), 0);
844        //51M - 11
845        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
846        assert_eq!(introns.len(), 0);
847        //51M - 12
848        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
849        assert_eq!(introns.len(), 0);
850        //51M - 13
851        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
852        assert_eq!(introns.len(), 0);
853        //51M - 14
854        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
855        assert_eq!(introns.len(), 0);
856        //9S42M - 15
857        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
858        assert_eq!(introns.len(), 0);
859        //51M - 16
860        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
861        assert_eq!(introns.len(), 0);
862        //50M1S - 17
863        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
864        assert_eq!(introns.len(), 0);
865        //45M6S - 18
866        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
867        assert_eq!(introns.len(), 0);
868        //3S48M - 19
869        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
870        assert_eq!(introns.len(), 0);
871        //42M9S - 20
872        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
873        assert_eq!(introns.len(), 0);
874        //13S38M - 21
875        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
876        assert_eq!(introns.len(), 0);
877        //44M7S - 22
878        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
879        assert_eq!(introns.len(), 0);
880        //5S46M - 23
881        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
882        assert_eq!(introns.len(), 0);
883        //23M4I24M - 24
884        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
885        assert_eq!(introns.len(), 0);
886        //18M1I32M - 25
887        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
888        assert_eq!(introns.len(), 0);
889        //17M2183N34M - 26
890        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
891        assert_eq!(introns.len(), 1);
892        assert_eq!(introns[0], [17092783, 17094966]);
893        //1M2183N50M - 27
894        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
895        assert_eq!(introns.len(), 1);
896        assert_eq!(introns[0], [17092783, 17094966]);
897        //1M2183N50M - 28
898        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
899        assert_eq!(introns.len(), 1);
900        assert_eq!(introns[0], [17092783, 17094966]);
901        //9S33M9S - 29
902        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
903        assert_eq!(introns.len(), 0);
904        //2S48M1S - 30
905        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
906        assert_eq!(introns.len(), 0);
907        //4S45M2S - 31
908        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
909        assert_eq!(introns.len(), 0);
910        //41M11832N10M - 32
911        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
912        assert_eq!(introns.len(), 1);
913        assert_eq!(introns[0], [17566119, 17577951]);
914        //11M11832N25M710N15M - 33
915        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
916        assert_eq!(introns.len(), 2);
917        assert_eq!(introns[0], [17566119, 17577951]);
918        assert_eq!(introns[1], [17577976, 17578686]);
919        //8M11832N25M710N18M - 34
920        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
921        assert_eq!(introns.len(), 2);
922        assert_eq!(introns[0], [17566119, 17577951]);
923        assert_eq!(introns[1], [17577976, 17578686]);
924        //8M11832N25M710N18M - 35
925        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
926        assert_eq!(introns.len(), 2);
927        assert_eq!(introns[0], [17566119, 17577951]);
928        assert_eq!(introns[1], [17577976, 17578686]);
929        //8M11832N25M710N18M - 36
930        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
931        assert_eq!(introns.len(), 2);
932        assert_eq!(introns[0], [17566119, 17577951]);
933        assert_eq!(introns[1], [17577976, 17578686]);
934        //8M11832N25M710N18M - 37
935        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
936        assert_eq!(introns.len(), 2);
937        assert_eq!(introns[0], [17566119, 17577951]);
938        assert_eq!(introns[1], [17577976, 17578686]);
939        //7M11832N25M710N19M - 38
940        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
941        assert_eq!(introns.len(), 2);
942        assert_eq!(introns[0], [17566119, 17577951]);
943        assert_eq!(introns[1], [17577976, 17578686]);
944        //6M11832N25M710N20M - 39
945        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
946        assert_eq!(introns.len(), 2);
947        assert_eq!(introns[0], [17566119, 17577951]);
948        assert_eq!(introns[1], [17577976, 17578686]);
949        //6M11832N25M710N20M - 40
950        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
951        assert_eq!(introns.len(), 2);
952        assert_eq!(introns[0], [17566119, 17577951]);
953        assert_eq!(introns[1], [17577976, 17578686]);
954        //1S44M1467N6M - 41
955        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
956        assert_eq!(introns.len(), 1);
957        assert_eq!(introns[0], [17579777, 17581244]);
958        //2M1514N48M95N1M - 42
959        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
960        assert_eq!(introns.len(), 2);
961        assert_eq!(introns[0], [17581371, 17582885]);
962        assert_eq!(introns[1], [17582933, 17583028]);
963        //1M1514N48M95N2M - 43
964        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
965        assert_eq!(introns.len(), 2);
966        assert_eq!(introns[0], [17581371, 17582885]);
967        assert_eq!(introns[1], [17582933, 17583028]);
968        //1M1514N48M95N2M - 44
969        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
970        assert_eq!(introns.len(), 2);
971        assert_eq!(introns[0], [17581371, 17582885]);
972        assert_eq!(introns[1], [17582933, 17583028]);
973        //1S22M95N28M - 45
974        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
975        assert_eq!(introns.len(), 1);
976        assert_eq!(introns[0], [17582933, 17583028]);
977        //37M538N13M1S - 46
978        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
979        assert_eq!(introns.len(), 1);
980        assert_eq!(introns[0], [17588658, 17589196]);
981        //37M538N13M1S - 47
982        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
983        assert_eq!(introns.len(), 1);
984        assert_eq!(introns[0], [17588658, 17589196]);
985        //37M538N13M1S - 48
986        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
987        assert_eq!(introns.len(), 1);
988        assert_eq!(introns[0], [17588658, 17589196]);
989        //1S25M1D25M - 49
990        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
991        assert_eq!(introns.len(), 0);
992        //24M1D24M3S - 50
993        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
994        assert_eq!(introns.len(), 0);
995        //16M1D28M7S - 51
996        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
997        assert_eq!(introns.len(), 0);
998        //11S7M1I32M - 52
999        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
1000        assert_eq!(introns.len(), 0);
1001        //5S9M1892N37M - 53
1002        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
1003        assert_eq!(introns.len(), 1);
1004        assert_eq!(introns[0], [17624021, 17625913]);
1005        //2S9M1892N40M - 54
1006        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
1007        assert_eq!(introns.len(), 1);
1008        assert_eq!(introns[0], [17624021, 17625913]);
1009        //1S7M3D19M2285N24M - 55
1010        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
1011        assert_eq!(introns.len(), 1);
1012        assert_eq!(introns[0], [31796729, 31799014]);
1013        //14M799N28M13881N7M2S - 56
1014        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
1015        assert_eq!(introns.len(), 2);
1016        assert_eq!(introns[0], [36722706, 36723505]);
1017        assert_eq!(introns[1], [36723533, 36737414]);
1018        //4S21M1696N23M2331N3M - 57
1019        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
1020        assert_eq!(introns.len(), 2);
1021        assert_eq!(introns[0], [44587984, 44589680]);
1022        assert_eq!(introns[1], [44589703, 44592034]);
1023    }
1024
1025    #[test]
1026    fn test_aligned_pairs() {
1027        let mut bam = bam::Reader::from_path("./test/test_spliced_reads.bam").unwrap();
1028        let mut it = bam.records();
1029
1030        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
1031        assert_eq!(
1032            pairs,
1033            vec![
1034                [6, 16050676],
1035                [7, 16050677],
1036                [8, 16050678],
1037                [9, 16050679],
1038                [10, 16050680],
1039                [11, 16050681],
1040                [12, 16050682],
1041                [13, 16050683],
1042                [14, 16050684],
1043                [15, 16050685],
1044                [16, 16050686],
1045                [17, 16050687],
1046                [18, 16050688],
1047                [19, 16050689],
1048                [20, 16050690],
1049                [21, 16050691],
1050                [22, 16050692],
1051                [23, 16050693],
1052                [24, 16050694],
1053                [25, 16050695],
1054                [26, 16050696],
1055                [27, 16050697],
1056                [28, 16050698],
1057                [29, 16050699],
1058                [30, 16050700],
1059                [31, 16050701],
1060                [32, 16050702],
1061                [33, 16050703],
1062                [34, 16050704],
1063                [35, 16050705],
1064                [36, 16050706],
1065                [37, 16050707],
1066                [38, 16050708],
1067                [39, 16050709],
1068                [40, 16050710],
1069                [41, 16050711],
1070                [42, 16050712],
1071                [43, 16050713],
1072                [44, 16050714],
1073                [45, 16050715],
1074                [46, 16050716],
1075                [47, 16050717],
1076                [48, 16050718],
1077                [49, 16050719],
1078                [50, 16050720]
1079            ]
1080        );
1081        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
1082        assert_eq!(
1083            pairs,
1084            vec![
1085                [0, 16096878],
1086                [1, 16096879],
1087                [2, 16096880],
1088                [3, 16096881],
1089                [4, 16096882],
1090                [5, 16096883],
1091                [6, 16096884],
1092                [7, 16096887],
1093                [8, 16096888],
1094                [9, 16096889],
1095                [10, 16096890],
1096                [11, 16096891],
1097                [12, 16096892],
1098                [13, 16096893],
1099                [14, 16096894],
1100                [15, 16096895],
1101                [16, 16096896],
1102                [17, 16096897],
1103                [18, 16096898],
1104                [19, 16096899],
1105                [20, 16096900],
1106                [21, 16096901],
1107                [22, 16096902],
1108                [23, 16096903],
1109                [24, 16096904],
1110                [25, 16096905],
1111                [26, 16096906],
1112                [27, 16096907],
1113                [28, 16096908],
1114                [29, 16096909],
1115                [30, 16096910],
1116                [31, 16096911],
1117                [32, 16096912],
1118                [33, 16096913],
1119                [34, 16096914],
1120                [35, 16096915],
1121                [36, 16096916],
1122                [37, 16096917],
1123                [38, 16096918],
1124                [39, 16096919],
1125                [40, 16096920],
1126                [41, 16096921],
1127                [42, 16096922],
1128                [43, 16096923],
1129                [44, 16096924],
1130                [45, 16096925],
1131                [46, 16096926],
1132                [47, 16096927],
1133                [48, 16096928],
1134                [49, 16096929],
1135                [50, 16096930]
1136            ]
1137        );
1138        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
1139        assert_eq!(
1140            pairs,
1141            vec![
1142                [0, 16097145],
1143                [1, 16097146],
1144                [2, 16097147],
1145                [3, 16097148],
1146                [4, 16097149],
1147                [5, 16097150],
1148                [6, 16097151],
1149                [7, 16097152],
1150                [8, 16097153],
1151                [9, 16097154],
1152                [10, 16097155],
1153                [11, 16097156],
1154                [12, 16097157],
1155                [13, 16097158],
1156                [14, 16097159],
1157                [15, 16097160],
1158                [16, 16097161],
1159                [17, 16097162],
1160                [18, 16097163],
1161                [19, 16097164],
1162                [20, 16097165],
1163                [21, 16097166],
1164                [22, 16097167],
1165                [23, 16097168],
1166                [24, 16097169],
1167                [25, 16097170],
1168                [26, 16097171],
1169                [27, 16097172],
1170                [28, 16097173],
1171                [29, 16097176],
1172                [30, 16097177],
1173                [31, 16097178],
1174                [32, 16097179],
1175                [33, 16097180],
1176                [34, 16097181],
1177                [35, 16097182],
1178                [36, 16097183],
1179                [37, 16097184],
1180                [38, 16097185],
1181                [39, 16097186],
1182                [40, 16097187],
1183                [41, 16097188],
1184                [42, 16097189],
1185                [43, 16097190],
1186                [44, 16097191],
1187                [45, 16097192],
1188                [46, 16097193],
1189                [47, 16097194],
1190                [48, 16097195],
1191                [49, 16097196],
1192                [50, 16097197]
1193            ]
1194        );
1195        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
1196        assert_eq!(
1197            pairs,
1198            vec![
1199                [0, 16117350],
1200                [1, 16117351],
1201                [2, 16117352],
1202                [3, 16117353],
1203                [4, 16117354],
1204                [5, 16117355],
1205                [6, 16117356],
1206                [7, 16117357],
1207                [8, 16117358],
1208                [9, 16117359],
1209                [10, 16117360],
1210                [11, 16117361],
1211                [12, 16117362],
1212                [13, 16117363],
1213                [14, 16117364],
1214                [15, 16117365],
1215                [16, 16117366],
1216                [17, 16117367],
1217                [18, 16117368],
1218                [19, 16117369],
1219                [20, 16117370],
1220                [21, 16117371],
1221                [22, 16117372],
1222                [23, 16117373],
1223                [24, 16117374],
1224                [25, 16117375],
1225                [26, 16117376],
1226                [27, 16117377],
1227                [28, 16117378],
1228                [29, 16117379],
1229                [30, 16117380],
1230                [31, 16117381],
1231                [32, 16117382],
1232                [33, 16117383],
1233                [34, 16117384],
1234                [35, 16117385],
1235                [36, 16117386],
1236                [37, 16117387],
1237                [38, 16117388],
1238                [39, 16117389],
1239                [40, 16117390],
1240                [41, 16117391],
1241                [42, 16117392],
1242                [43, 16117393],
1243                [44, 16117394],
1244                [45, 16117395],
1245                [46, 16117396],
1246                [47, 16117397],
1247                [48, 16117398],
1248                [49, 16117399],
1249                [50, 16117400]
1250            ]
1251        );
1252        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
1253        assert_eq!(
1254            pairs,
1255            vec![
1256                [0, 16118483],
1257                [1, 16118484],
1258                [2, 16118485],
1259                [3, 16118486],
1260                [4, 16118487],
1261                [5, 16118488],
1262                [6, 16118489],
1263                [7, 16118490],
1264                [8, 16118491],
1265                [9, 16118492],
1266                [10, 16118493],
1267                [11, 16118494],
1268                [12, 16118495],
1269                [13, 16118496],
1270                [14, 16118497],
1271                [15, 16118498],
1272                [16, 16118499],
1273                [17, 16118500],
1274                [18, 16118501],
1275                [19, 16118502],
1276                [20, 16118503],
1277                [21, 16118504],
1278                [22, 16118505],
1279                [23, 16118506],
1280                [24, 16118507],
1281                [25, 16118508],
1282                [26, 16118509],
1283                [27, 16118510],
1284                [28, 16118511],
1285                [29, 16118512],
1286                [30, 16118513],
1287                [31, 16118514],
1288                [32, 16118515],
1289                [33, 16118516],
1290                [34, 16118517],
1291                [35, 16118518],
1292                [36, 16118519],
1293                [37, 16118520],
1294                [38, 16118521],
1295                [39, 16118522],
1296                [40, 16118523],
1297                [41, 16118524],
1298                [42, 16118525],
1299                [43, 16118526],
1300                [44, 16118527],
1301                [45, 16118528],
1302                [46, 16118529],
1303                [47, 16118530],
1304                [48, 16118531],
1305                [49, 16118532],
1306                [50, 16118533]
1307            ]
1308        );
1309        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
1310        assert_eq!(
1311            pairs,
1312            vec![
1313                [0, 16118499],
1314                [1, 16118500],
1315                [2, 16118501],
1316                [3, 16118502],
1317                [4, 16118503],
1318                [5, 16118504],
1319                [6, 16118505],
1320                [7, 16118506],
1321                [8, 16118507],
1322                [9, 16118508],
1323                [10, 16118509],
1324                [11, 16118510],
1325                [12, 16118511],
1326                [13, 16118512],
1327                [14, 16118513],
1328                [15, 16118514],
1329                [16, 16118515],
1330                [17, 16118516],
1331                [18, 16118517],
1332                [19, 16118518],
1333                [20, 16118519],
1334                [21, 16118520],
1335                [22, 16118521],
1336                [23, 16118522],
1337                [24, 16118523],
1338                [25, 16118524],
1339                [26, 16118525],
1340                [27, 16118526],
1341                [28, 16118527],
1342                [29, 16118528],
1343                [30, 16118529],
1344                [31, 16118530],
1345                [32, 16118531],
1346                [33, 16118532],
1347                [34, 16118533],
1348                [35, 16118534],
1349                [36, 16118535],
1350                [37, 16118536],
1351                [38, 16118537],
1352                [39, 16118538],
1353                [40, 16118539],
1354                [41, 16118540],
1355                [42, 16118541],
1356                [43, 16118542],
1357                [44, 16118543],
1358                [45, 16118544],
1359                [46, 16118545],
1360                [47, 16118546],
1361                [48, 16118547],
1362                [49, 16118548],
1363                [50, 16118549]
1364            ]
1365        );
1366        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
1367        assert_eq!(
1368            pairs,
1369            vec![
1370                [0, 16118499],
1371                [1, 16118500],
1372                [2, 16118501],
1373                [3, 16118502],
1374                [4, 16118503],
1375                [5, 16118504],
1376                [6, 16118505],
1377                [7, 16118506],
1378                [8, 16118507],
1379                [9, 16118508],
1380                [10, 16118509],
1381                [11, 16118510],
1382                [12, 16118511],
1383                [13, 16118512],
1384                [14, 16118513],
1385                [15, 16118514],
1386                [16, 16118515],
1387                [17, 16118516],
1388                [18, 16118517],
1389                [19, 16118518],
1390                [20, 16118519],
1391                [21, 16118520],
1392                [22, 16118521],
1393                [23, 16118522],
1394                [24, 16118523],
1395                [25, 16118524],
1396                [26, 16118525],
1397                [27, 16118526],
1398                [28, 16118527],
1399                [29, 16118528],
1400                [30, 16118529],
1401                [31, 16118530],
1402                [32, 16118531],
1403                [33, 16118532],
1404                [34, 16118533],
1405                [35, 16118534],
1406                [36, 16118535],
1407                [37, 16118536],
1408                [38, 16118537],
1409                [39, 16118538],
1410                [40, 16118539],
1411                [41, 16118540],
1412                [42, 16118541],
1413                [43, 16118542],
1414                [44, 16118543],
1415                [45, 16118544],
1416                [46, 16118545],
1417                [47, 16118546],
1418                [48, 16118547],
1419                [49, 16118548],
1420                [50, 16118549]
1421            ]
1422        );
1423        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
1424        assert_eq!(
1425            pairs,
1426            vec![
1427                [0, 16118499],
1428                [1, 16118500],
1429                [2, 16118501],
1430                [3, 16118502],
1431                [4, 16118503],
1432                [5, 16118504],
1433                [6, 16118505],
1434                [7, 16118506],
1435                [8, 16118507],
1436                [9, 16118508],
1437                [10, 16118509],
1438                [11, 16118510],
1439                [12, 16118511],
1440                [13, 16118512],
1441                [14, 16118513],
1442                [15, 16118514],
1443                [16, 16118515],
1444                [17, 16118516],
1445                [18, 16118517],
1446                [19, 16118518],
1447                [20, 16118519],
1448                [21, 16118520],
1449                [22, 16118521],
1450                [23, 16118522],
1451                [24, 16118523],
1452                [25, 16118524],
1453                [26, 16118525],
1454                [27, 16118526],
1455                [28, 16118527],
1456                [29, 16118528],
1457                [30, 16118529],
1458                [31, 16118530],
1459                [32, 16118531],
1460                [33, 16118532],
1461                [34, 16118533],
1462                [35, 16118534],
1463                [36, 16118535],
1464                [37, 16118536],
1465                [38, 16118537],
1466                [39, 16118538],
1467                [40, 16118539],
1468                [41, 16118540],
1469                [42, 16118541],
1470                [43, 16118542],
1471                [44, 16118543],
1472                [45, 16118544],
1473                [46, 16118545],
1474                [47, 16118546],
1475                [48, 16118547],
1476                [49, 16118548],
1477                [50, 16118549]
1478            ]
1479        );
1480        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
1481        assert_eq!(
1482            pairs,
1483            vec![
1484                [0, 16123411],
1485                [1, 16123412],
1486                [2, 16123413],
1487                [3, 16123414],
1488                [4, 16123415],
1489                [5, 16123416],
1490                [6, 16123417],
1491                [7, 16123418],
1492                [8, 16123419],
1493                [9, 16123420],
1494                [10, 16123421],
1495                [11, 16123422],
1496                [12, 16123423],
1497                [13, 16123424],
1498                [14, 16123425],
1499                [15, 16123426],
1500                [16, 16123427],
1501                [17, 16123428],
1502                [18, 16123429],
1503                [19, 16123430],
1504                [20, 16123431],
1505                [21, 16123432],
1506                [22, 16123433],
1507                [23, 16123434],
1508                [24, 16123435],
1509                [25, 16123436],
1510                [26, 16123437],
1511                [27, 16123438],
1512                [28, 16123439],
1513                [29, 16123440],
1514                [30, 16123441],
1515                [31, 16123442],
1516                [32, 16123443],
1517                [33, 16123444],
1518                [34, 16123445],
1519                [35, 16123446],
1520                [36, 16123447],
1521                [37, 16123448],
1522                [38, 16123449],
1523                [39, 16123450],
1524                [40, 16123451],
1525                [41, 16123452],
1526                [42, 16123453],
1527                [43, 16123454],
1528                [44, 16123455],
1529                [45, 16123456],
1530                [46, 16123457],
1531                [47, 16123458],
1532                [48, 16123459],
1533                [49, 16123460],
1534                [50, 16123461]
1535            ]
1536        );
1537        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
1538        assert_eq!(
1539            pairs,
1540            vec![
1541                [6, 16123417],
1542                [7, 16123418],
1543                [8, 16123419],
1544                [9, 16123420],
1545                [10, 16123421],
1546                [11, 16123422],
1547                [12, 16123423],
1548                [13, 16123424],
1549                [14, 16123425],
1550                [15, 16123426],
1551                [16, 16123427],
1552                [17, 16123428],
1553                [18, 16123429],
1554                [19, 16123430],
1555                [20, 16123431],
1556                [21, 16123432],
1557                [22, 16123433],
1558                [23, 16123434],
1559                [24, 16123435],
1560                [25, 16123436],
1561                [26, 16123437],
1562                [27, 16123438],
1563                [28, 16123439],
1564                [29, 16123440],
1565                [30, 16123441],
1566                [31, 16123442],
1567                [32, 16123443],
1568                [33, 16123444],
1569                [34, 16123445],
1570                [35, 16123446],
1571                [36, 16123447],
1572                [37, 16123448],
1573                [38, 16123449],
1574                [39, 16123450],
1575                [40, 16123451],
1576                [41, 16123452],
1577                [42, 16123453],
1578                [43, 16123454],
1579                [44, 16123455],
1580                [45, 16123456],
1581                [46, 16123457],
1582                [47, 16123458],
1583                [48, 16123459],
1584                [49, 16123460],
1585                [50, 16123461]
1586            ]
1587        );
1588        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
1589        assert_eq!(
1590            pairs,
1591            vec![
1592                [0, 16165860],
1593                [1, 16165861],
1594                [2, 16165862],
1595                [3, 16165863],
1596                [4, 16165864],
1597                [5, 16165865],
1598                [6, 16165866],
1599                [7, 16165867],
1600                [8, 16165868],
1601                [9, 16165869],
1602                [10, 16165870],
1603                [11, 16165871],
1604                [12, 16165872],
1605                [13, 16165873],
1606                [14, 16165874],
1607                [15, 16165875],
1608                [16, 16165876],
1609                [17, 16165877],
1610                [18, 16165878],
1611                [19, 16165879],
1612                [20, 16165880],
1613                [21, 16165881],
1614                [22, 16165882],
1615                [23, 16165883],
1616                [24, 16165884],
1617                [25, 16165885],
1618                [26, 16165886],
1619                [27, 16165887],
1620                [28, 16165888],
1621                [29, 16165889],
1622                [30, 16165890],
1623                [31, 16165891],
1624                [32, 16165892],
1625                [33, 16165893],
1626                [34, 16165894],
1627                [35, 16165895],
1628                [36, 16165896],
1629                [37, 16165897],
1630                [38, 16165898],
1631                [39, 16165899],
1632                [40, 16165900]
1633            ]
1634        );
1635        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
1636        assert_eq!(
1637            pairs,
1638            vec![
1639                [0, 16180871],
1640                [1, 16180872],
1641                [2, 16180873],
1642                [3, 16180874],
1643                [4, 16180875],
1644                [5, 16180876],
1645                [6, 16180877],
1646                [7, 16180878],
1647                [8, 16180879],
1648                [9, 16180880],
1649                [10, 16180881],
1650                [11, 16180882],
1651                [12, 16180883],
1652                [13, 16180884],
1653                [14, 16180885],
1654                [15, 16180886],
1655                [16, 16180887],
1656                [17, 16180888],
1657                [18, 16180889],
1658                [19, 16180890],
1659                [20, 16180891],
1660                [21, 16180892],
1661                [22, 16180893],
1662                [23, 16180894],
1663                [24, 16180895],
1664                [25, 16180896],
1665                [26, 16180897],
1666                [27, 16180898],
1667                [28, 16180899],
1668                [29, 16180900],
1669                [30, 16180901],
1670                [31, 16180902],
1671                [32, 16180903],
1672                [33, 16180904],
1673                [34, 16180905],
1674                [35, 16180906],
1675                [36, 16180907],
1676                [37, 16180908],
1677                [38, 16180909],
1678                [39, 16180910],
1679                [40, 16180911],
1680                [41, 16180912],
1681                [42, 16180913],
1682                [43, 16180914],
1683                [44, 16180915],
1684                [45, 16180916],
1685                [46, 16180917],
1686                [47, 16180918],
1687                [48, 16180919],
1688                [49, 16180920],
1689                [50, 16180921]
1690            ]
1691        );
1692        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
1693        assert_eq!(
1694            pairs,
1695            vec![
1696                [0, 16189705],
1697                [1, 16189706],
1698                [2, 16189707],
1699                [3, 16189708],
1700                [4, 16189709],
1701                [5, 16189710],
1702                [6, 16189711],
1703                [7, 16189712],
1704                [8, 16189713],
1705                [9, 16189714],
1706                [10, 16189715],
1707                [11, 16189716],
1708                [12, 16189717],
1709                [13, 16189718],
1710                [14, 16189719],
1711                [15, 16189720],
1712                [16, 16189721],
1713                [17, 16189722],
1714                [18, 16189723],
1715                [19, 16189724],
1716                [20, 16189725],
1717                [21, 16189726],
1718                [22, 16189727],
1719                [23, 16189728],
1720                [24, 16189729],
1721                [25, 16189730],
1722                [26, 16189731],
1723                [27, 16189732],
1724                [28, 16189733],
1725                [29, 16189734],
1726                [30, 16189735],
1727                [31, 16189736],
1728                [32, 16189737],
1729                [33, 16189738],
1730                [34, 16189739],
1731                [35, 16189740],
1732                [36, 16189741],
1733                [37, 16189742],
1734                [38, 16189743],
1735                [39, 16189744],
1736                [40, 16189745],
1737                [41, 16189746],
1738                [42, 16189747],
1739                [43, 16189748],
1740                [44, 16189749],
1741                [45, 16189750],
1742                [46, 16189751],
1743                [47, 16189752],
1744                [48, 16189753],
1745                [49, 16189754],
1746                [50, 16189755]
1747            ]
1748        );
1749        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
1750        assert_eq!(
1751            pairs,
1752            vec![
1753                [0, 16231271],
1754                [1, 16231272],
1755                [2, 16231273],
1756                [3, 16231274],
1757                [4, 16231275],
1758                [5, 16231276],
1759                [6, 16231277],
1760                [7, 16231278],
1761                [8, 16231279],
1762                [9, 16231280],
1763                [10, 16231281],
1764                [11, 16231282],
1765                [12, 16231283],
1766                [13, 16231284],
1767                [14, 16231285],
1768                [15, 16231286],
1769                [16, 16231287],
1770                [17, 16231288],
1771                [18, 16231289],
1772                [19, 16231290],
1773                [20, 16231291],
1774                [21, 16231292],
1775                [22, 16231293],
1776                [23, 16231294],
1777                [24, 16231295],
1778                [25, 16231296],
1779                [26, 16231297],
1780                [27, 16231298],
1781                [28, 16231299],
1782                [29, 16231300],
1783                [30, 16231301],
1784                [31, 16231302],
1785                [32, 16231303],
1786                [33, 16231304],
1787                [34, 16231305],
1788                [35, 16231306],
1789                [36, 16231307],
1790                [37, 16231308],
1791                [38, 16231309],
1792                [39, 16231310],
1793                [40, 16231311],
1794                [41, 16231312],
1795                [42, 16231313],
1796                [43, 16231314],
1797                [44, 16231315],
1798                [45, 16231316],
1799                [46, 16231317],
1800                [47, 16231318],
1801                [48, 16231319],
1802                [49, 16231320],
1803                [50, 16231321]
1804            ]
1805        );
1806        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
1807        assert_eq!(
1808            pairs,
1809            vec![
1810                [0, 16237657],
1811                [1, 16237658],
1812                [2, 16237659],
1813                [3, 16237660],
1814                [4, 16237661],
1815                [5, 16237662],
1816                [6, 16237663],
1817                [7, 16237664],
1818                [8, 16237665],
1819                [9, 16237666],
1820                [10, 16237667],
1821                [11, 16237668],
1822                [12, 16237669],
1823                [13, 16237670],
1824                [14, 16237671],
1825                [15, 16237672],
1826                [16, 16237673],
1827                [17, 16237674],
1828                [18, 16237675],
1829                [19, 16237676],
1830                [20, 16237677],
1831                [21, 16237678],
1832                [22, 16237679],
1833                [23, 16237680],
1834                [24, 16237681],
1835                [25, 16237682],
1836                [26, 16237683],
1837                [27, 16237684],
1838                [28, 16237685],
1839                [29, 16237686],
1840                [30, 16237687],
1841                [31, 16237688],
1842                [32, 16237689],
1843                [33, 16237690],
1844                [34, 16237691],
1845                [35, 16237692],
1846                [36, 16237693],
1847                [37, 16237694],
1848                [38, 16237695],
1849                [39, 16237696],
1850                [40, 16237697],
1851                [41, 16237698],
1852                [42, 16237699],
1853                [43, 16237700],
1854                [44, 16237701],
1855                [45, 16237702],
1856                [46, 16237703],
1857                [47, 16237704],
1858                [48, 16237705],
1859                [49, 16237706],
1860                [50, 16237707]
1861            ]
1862        );
1863        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
1864        assert_eq!(
1865            pairs,
1866            vec![
1867                [9, 16255012],
1868                [10, 16255013],
1869                [11, 16255014],
1870                [12, 16255015],
1871                [13, 16255016],
1872                [14, 16255017],
1873                [15, 16255018],
1874                [16, 16255019],
1875                [17, 16255020],
1876                [18, 16255021],
1877                [19, 16255022],
1878                [20, 16255023],
1879                [21, 16255024],
1880                [22, 16255025],
1881                [23, 16255026],
1882                [24, 16255027],
1883                [25, 16255028],
1884                [26, 16255029],
1885                [27, 16255030],
1886                [28, 16255031],
1887                [29, 16255032],
1888                [30, 16255033],
1889                [31, 16255034],
1890                [32, 16255035],
1891                [33, 16255036],
1892                [34, 16255037],
1893                [35, 16255038],
1894                [36, 16255039],
1895                [37, 16255040],
1896                [38, 16255041],
1897                [39, 16255042],
1898                [40, 16255043],
1899                [41, 16255044],
1900                [42, 16255045],
1901                [43, 16255046],
1902                [44, 16255047],
1903                [45, 16255048],
1904                [46, 16255049],
1905                [47, 16255050],
1906                [48, 16255051],
1907                [49, 16255052],
1908                [50, 16255053]
1909            ]
1910        );
1911        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
1912        assert_eq!(
1913            pairs,
1914            vec![
1915                [0, 16255391],
1916                [1, 16255392],
1917                [2, 16255393],
1918                [3, 16255394],
1919                [4, 16255395],
1920                [5, 16255396],
1921                [6, 16255397],
1922                [7, 16255398],
1923                [8, 16255399],
1924                [9, 16255400],
1925                [10, 16255401],
1926                [11, 16255402],
1927                [12, 16255403],
1928                [13, 16255404],
1929                [14, 16255405],
1930                [15, 16255406],
1931                [16, 16255407],
1932                [17, 16255408],
1933                [18, 16255409],
1934                [19, 16255410],
1935                [20, 16255411],
1936                [21, 16255412],
1937                [22, 16255413],
1938                [23, 16255414],
1939                [24, 16255415],
1940                [25, 16255416],
1941                [26, 16255417],
1942                [27, 16255418],
1943                [28, 16255419],
1944                [29, 16255420],
1945                [30, 16255421],
1946                [31, 16255422],
1947                [32, 16255423],
1948                [33, 16255424],
1949                [34, 16255425],
1950                [35, 16255426],
1951                [36, 16255427],
1952                [37, 16255428],
1953                [38, 16255429],
1954                [39, 16255430],
1955                [40, 16255431],
1956                [41, 16255432],
1957                [42, 16255433],
1958                [43, 16255434],
1959                [44, 16255435],
1960                [45, 16255436],
1961                [46, 16255437],
1962                [47, 16255438],
1963                [48, 16255439],
1964                [49, 16255440],
1965                [50, 16255441]
1966            ]
1967        );
1968        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
1969        assert_eq!(
1970            pairs,
1971            vec![
1972                [0, 16255392],
1973                [1, 16255393],
1974                [2, 16255394],
1975                [3, 16255395],
1976                [4, 16255396],
1977                [5, 16255397],
1978                [6, 16255398],
1979                [7, 16255399],
1980                [8, 16255400],
1981                [9, 16255401],
1982                [10, 16255402],
1983                [11, 16255403],
1984                [12, 16255404],
1985                [13, 16255405],
1986                [14, 16255406],
1987                [15, 16255407],
1988                [16, 16255408],
1989                [17, 16255409],
1990                [18, 16255410],
1991                [19, 16255411],
1992                [20, 16255412],
1993                [21, 16255413],
1994                [22, 16255414],
1995                [23, 16255415],
1996                [24, 16255416],
1997                [25, 16255417],
1998                [26, 16255418],
1999                [27, 16255419],
2000                [28, 16255420],
2001                [29, 16255421],
2002                [30, 16255422],
2003                [31, 16255423],
2004                [32, 16255424],
2005                [33, 16255425],
2006                [34, 16255426],
2007                [35, 16255427],
2008                [36, 16255428],
2009                [37, 16255429],
2010                [38, 16255430],
2011                [39, 16255431],
2012                [40, 16255432],
2013                [41, 16255433],
2014                [42, 16255434],
2015                [43, 16255435],
2016                [44, 16255436],
2017                [45, 16255437],
2018                [46, 16255438],
2019                [47, 16255439],
2020                [48, 16255440],
2021                [49, 16255441]
2022            ]
2023        );
2024        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
2025        assert_eq!(
2026            pairs,
2027            vec![
2028                [0, 16256084],
2029                [1, 16256085],
2030                [2, 16256086],
2031                [3, 16256087],
2032                [4, 16256088],
2033                [5, 16256089],
2034                [6, 16256090],
2035                [7, 16256091],
2036                [8, 16256092],
2037                [9, 16256093],
2038                [10, 16256094],
2039                [11, 16256095],
2040                [12, 16256096],
2041                [13, 16256097],
2042                [14, 16256098],
2043                [15, 16256099],
2044                [16, 16256100],
2045                [17, 16256101],
2046                [18, 16256102],
2047                [19, 16256103],
2048                [20, 16256104],
2049                [21, 16256105],
2050                [22, 16256106],
2051                [23, 16256107],
2052                [24, 16256108],
2053                [25, 16256109],
2054                [26, 16256110],
2055                [27, 16256111],
2056                [28, 16256112],
2057                [29, 16256113],
2058                [30, 16256114],
2059                [31, 16256115],
2060                [32, 16256116],
2061                [33, 16256117],
2062                [34, 16256118],
2063                [35, 16256119],
2064                [36, 16256120],
2065                [37, 16256121],
2066                [38, 16256122],
2067                [39, 16256123],
2068                [40, 16256124],
2069                [41, 16256125],
2070                [42, 16256126],
2071                [43, 16256127],
2072                [44, 16256128]
2073            ]
2074        );
2075        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
2076        assert_eq!(
2077            pairs,
2078            vec![
2079                [3, 16256224],
2080                [4, 16256225],
2081                [5, 16256226],
2082                [6, 16256227],
2083                [7, 16256228],
2084                [8, 16256229],
2085                [9, 16256230],
2086                [10, 16256231],
2087                [11, 16256232],
2088                [12, 16256233],
2089                [13, 16256234],
2090                [14, 16256235],
2091                [15, 16256236],
2092                [16, 16256237],
2093                [17, 16256238],
2094                [18, 16256239],
2095                [19, 16256240],
2096                [20, 16256241],
2097                [21, 16256242],
2098                [22, 16256243],
2099                [23, 16256244],
2100                [24, 16256245],
2101                [25, 16256246],
2102                [26, 16256247],
2103                [27, 16256248],
2104                [28, 16256249],
2105                [29, 16256250],
2106                [30, 16256251],
2107                [31, 16256252],
2108                [32, 16256253],
2109                [33, 16256254],
2110                [34, 16256255],
2111                [35, 16256256],
2112                [36, 16256257],
2113                [37, 16256258],
2114                [38, 16256259],
2115                [39, 16256260],
2116                [40, 16256261],
2117                [41, 16256262],
2118                [42, 16256263],
2119                [43, 16256264],
2120                [44, 16256265],
2121                [45, 16256266],
2122                [46, 16256267],
2123                [47, 16256268],
2124                [48, 16256269],
2125                [49, 16256270],
2126                [50, 16256271]
2127            ]
2128        );
2129        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
2130        assert_eq!(
2131            pairs,
2132            vec![
2133                [0, 16325199],
2134                [1, 16325200],
2135                [2, 16325201],
2136                [3, 16325202],
2137                [4, 16325203],
2138                [5, 16325204],
2139                [6, 16325205],
2140                [7, 16325206],
2141                [8, 16325207],
2142                [9, 16325208],
2143                [10, 16325209],
2144                [11, 16325210],
2145                [12, 16325211],
2146                [13, 16325212],
2147                [14, 16325213],
2148                [15, 16325214],
2149                [16, 16325215],
2150                [17, 16325216],
2151                [18, 16325217],
2152                [19, 16325218],
2153                [20, 16325219],
2154                [21, 16325220],
2155                [22, 16325221],
2156                [23, 16325222],
2157                [24, 16325223],
2158                [25, 16325224],
2159                [26, 16325225],
2160                [27, 16325226],
2161                [28, 16325227],
2162                [29, 16325228],
2163                [30, 16325229],
2164                [31, 16325230],
2165                [32, 16325231],
2166                [33, 16325232],
2167                [34, 16325233],
2168                [35, 16325234],
2169                [36, 16325235],
2170                [37, 16325236],
2171                [38, 16325237],
2172                [39, 16325238],
2173                [40, 16325239],
2174                [41, 16325240]
2175            ]
2176        );
2177        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
2178        assert_eq!(
2179            pairs,
2180            vec![
2181                [13, 16352865],
2182                [14, 16352866],
2183                [15, 16352867],
2184                [16, 16352868],
2185                [17, 16352869],
2186                [18, 16352870],
2187                [19, 16352871],
2188                [20, 16352872],
2189                [21, 16352873],
2190                [22, 16352874],
2191                [23, 16352875],
2192                [24, 16352876],
2193                [25, 16352877],
2194                [26, 16352878],
2195                [27, 16352879],
2196                [28, 16352880],
2197                [29, 16352881],
2198                [30, 16352882],
2199                [31, 16352883],
2200                [32, 16352884],
2201                [33, 16352885],
2202                [34, 16352886],
2203                [35, 16352887],
2204                [36, 16352888],
2205                [37, 16352889],
2206                [38, 16352890],
2207                [39, 16352891],
2208                [40, 16352892],
2209                [41, 16352893],
2210                [42, 16352894],
2211                [43, 16352895],
2212                [44, 16352896],
2213                [45, 16352897],
2214                [46, 16352898],
2215                [47, 16352899],
2216                [48, 16352900],
2217                [49, 16352901],
2218                [50, 16352902]
2219            ]
2220        );
2221        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
2222        assert_eq!(
2223            pairs,
2224            vec![
2225                [0, 16352968],
2226                [1, 16352969],
2227                [2, 16352970],
2228                [3, 16352971],
2229                [4, 16352972],
2230                [5, 16352973],
2231                [6, 16352974],
2232                [7, 16352975],
2233                [8, 16352976],
2234                [9, 16352977],
2235                [10, 16352978],
2236                [11, 16352979],
2237                [12, 16352980],
2238                [13, 16352981],
2239                [14, 16352982],
2240                [15, 16352983],
2241                [16, 16352984],
2242                [17, 16352985],
2243                [18, 16352986],
2244                [19, 16352987],
2245                [20, 16352988],
2246                [21, 16352989],
2247                [22, 16352990],
2248                [23, 16352991],
2249                [24, 16352992],
2250                [25, 16352993],
2251                [26, 16352994],
2252                [27, 16352995],
2253                [28, 16352996],
2254                [29, 16352997],
2255                [30, 16352998],
2256                [31, 16352999],
2257                [32, 16353000],
2258                [33, 16353001],
2259                [34, 16353002],
2260                [35, 16353003],
2261                [36, 16353004],
2262                [37, 16353005],
2263                [38, 16353006],
2264                [39, 16353007],
2265                [40, 16353008],
2266                [41, 16353009],
2267                [42, 16353010],
2268                [43, 16353011]
2269            ]
2270        );
2271        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
2272        assert_eq!(
2273            pairs,
2274            vec![
2275                [5, 16414998],
2276                [6, 16414999],
2277                [7, 16415000],
2278                [8, 16415001],
2279                [9, 16415002],
2280                [10, 16415003],
2281                [11, 16415004],
2282                [12, 16415005],
2283                [13, 16415006],
2284                [14, 16415007],
2285                [15, 16415008],
2286                [16, 16415009],
2287                [17, 16415010],
2288                [18, 16415011],
2289                [19, 16415012],
2290                [20, 16415013],
2291                [21, 16415014],
2292                [22, 16415015],
2293                [23, 16415016],
2294                [24, 16415017],
2295                [25, 16415018],
2296                [26, 16415019],
2297                [27, 16415020],
2298                [28, 16415021],
2299                [29, 16415022],
2300                [30, 16415023],
2301                [31, 16415024],
2302                [32, 16415025],
2303                [33, 16415026],
2304                [34, 16415027],
2305                [35, 16415028],
2306                [36, 16415029],
2307                [37, 16415030],
2308                [38, 16415031],
2309                [39, 16415032],
2310                [40, 16415033],
2311                [41, 16415034],
2312                [42, 16415035],
2313                [43, 16415036],
2314                [44, 16415037],
2315                [45, 16415038],
2316                [46, 16415039],
2317                [47, 16415040],
2318                [48, 16415041],
2319                [49, 16415042],
2320                [50, 16415043]
2321            ]
2322        );
2323        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
2324        assert_eq!(
2325            pairs,
2326            vec![
2327                [0, 17031591],
2328                [1, 17031592],
2329                [2, 17031593],
2330                [3, 17031594],
2331                [4, 17031595],
2332                [5, 17031596],
2333                [6, 17031597],
2334                [7, 17031598],
2335                [8, 17031599],
2336                [9, 17031600],
2337                [10, 17031601],
2338                [11, 17031602],
2339                [12, 17031603],
2340                [13, 17031604],
2341                [14, 17031605],
2342                [15, 17031606],
2343                [16, 17031607],
2344                [17, 17031608],
2345                [18, 17031609],
2346                [19, 17031610],
2347                [20, 17031611],
2348                [21, 17031612],
2349                [22, 17031613],
2350                [27, 17031614],
2351                [28, 17031615],
2352                [29, 17031616],
2353                [30, 17031617],
2354                [31, 17031618],
2355                [32, 17031619],
2356                [33, 17031620],
2357                [34, 17031621],
2358                [35, 17031622],
2359                [36, 17031623],
2360                [37, 17031624],
2361                [38, 17031625],
2362                [39, 17031626],
2363                [40, 17031627],
2364                [41, 17031628],
2365                [42, 17031629],
2366                [43, 17031630],
2367                [44, 17031631],
2368                [45, 17031632],
2369                [46, 17031633],
2370                [47, 17031634],
2371                [48, 17031635],
2372                [49, 17031636],
2373                [50, 17031637]
2374            ]
2375        );
2376        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
2377        assert_eq!(
2378            pairs,
2379            vec![
2380                [0, 17057382],
2381                [1, 17057383],
2382                [2, 17057384],
2383                [3, 17057385],
2384                [4, 17057386],
2385                [5, 17057387],
2386                [6, 17057388],
2387                [7, 17057389],
2388                [8, 17057390],
2389                [9, 17057391],
2390                [10, 17057392],
2391                [11, 17057393],
2392                [12, 17057394],
2393                [13, 17057395],
2394                [14, 17057396],
2395                [15, 17057397],
2396                [16, 17057398],
2397                [17, 17057399],
2398                [19, 17057400],
2399                [20, 17057401],
2400                [21, 17057402],
2401                [22, 17057403],
2402                [23, 17057404],
2403                [24, 17057405],
2404                [25, 17057406],
2405                [26, 17057407],
2406                [27, 17057408],
2407                [28, 17057409],
2408                [29, 17057410],
2409                [30, 17057411],
2410                [31, 17057412],
2411                [32, 17057413],
2412                [33, 17057414],
2413                [34, 17057415],
2414                [35, 17057416],
2415                [36, 17057417],
2416                [37, 17057418],
2417                [38, 17057419],
2418                [39, 17057420],
2419                [40, 17057421],
2420                [41, 17057422],
2421                [42, 17057423],
2422                [43, 17057424],
2423                [44, 17057425],
2424                [45, 17057426],
2425                [46, 17057427],
2426                [47, 17057428],
2427                [48, 17057429],
2428                [49, 17057430],
2429                [50, 17057431]
2430            ]
2431        );
2432        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
2433        assert_eq!(
2434            pairs,
2435            vec![
2436                [0, 17092766],
2437                [1, 17092767],
2438                [2, 17092768],
2439                [3, 17092769],
2440                [4, 17092770],
2441                [5, 17092771],
2442                [6, 17092772],
2443                [7, 17092773],
2444                [8, 17092774],
2445                [9, 17092775],
2446                [10, 17092776],
2447                [11, 17092777],
2448                [12, 17092778],
2449                [13, 17092779],
2450                [14, 17092780],
2451                [15, 17092781],
2452                [16, 17092782],
2453                [17, 17094966],
2454                [18, 17094967],
2455                [19, 17094968],
2456                [20, 17094969],
2457                [21, 17094970],
2458                [22, 17094971],
2459                [23, 17094972],
2460                [24, 17094973],
2461                [25, 17094974],
2462                [26, 17094975],
2463                [27, 17094976],
2464                [28, 17094977],
2465                [29, 17094978],
2466                [30, 17094979],
2467                [31, 17094980],
2468                [32, 17094981],
2469                [33, 17094982],
2470                [34, 17094983],
2471                [35, 17094984],
2472                [36, 17094985],
2473                [37, 17094986],
2474                [38, 17094987],
2475                [39, 17094988],
2476                [40, 17094989],
2477                [41, 17094990],
2478                [42, 17094991],
2479                [43, 17094992],
2480                [44, 17094993],
2481                [45, 17094994],
2482                [46, 17094995],
2483                [47, 17094996],
2484                [48, 17094997],
2485                [49, 17094998],
2486                [50, 17094999]
2487            ]
2488        );
2489        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
2490        assert_eq!(
2491            pairs,
2492            vec![
2493                [0, 17092782],
2494                [1, 17094966],
2495                [2, 17094967],
2496                [3, 17094968],
2497                [4, 17094969],
2498                [5, 17094970],
2499                [6, 17094971],
2500                [7, 17094972],
2501                [8, 17094973],
2502                [9, 17094974],
2503                [10, 17094975],
2504                [11, 17094976],
2505                [12, 17094977],
2506                [13, 17094978],
2507                [14, 17094979],
2508                [15, 17094980],
2509                [16, 17094981],
2510                [17, 17094982],
2511                [18, 17094983],
2512                [19, 17094984],
2513                [20, 17094985],
2514                [21, 17094986],
2515                [22, 17094987],
2516                [23, 17094988],
2517                [24, 17094989],
2518                [25, 17094990],
2519                [26, 17094991],
2520                [27, 17094992],
2521                [28, 17094993],
2522                [29, 17094994],
2523                [30, 17094995],
2524                [31, 17094996],
2525                [32, 17094997],
2526                [33, 17094998],
2527                [34, 17094999],
2528                [35, 17095000],
2529                [36, 17095001],
2530                [37, 17095002],
2531                [38, 17095003],
2532                [39, 17095004],
2533                [40, 17095005],
2534                [41, 17095006],
2535                [42, 17095007],
2536                [43, 17095008],
2537                [44, 17095009],
2538                [45, 17095010],
2539                [46, 17095011],
2540                [47, 17095012],
2541                [48, 17095013],
2542                [49, 17095014],
2543                [50, 17095015]
2544            ]
2545        );
2546        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
2547        assert_eq!(
2548            pairs,
2549            vec![
2550                [0, 17092782],
2551                [1, 17094966],
2552                [2, 17094967],
2553                [3, 17094968],
2554                [4, 17094969],
2555                [5, 17094970],
2556                [6, 17094971],
2557                [7, 17094972],
2558                [8, 17094973],
2559                [9, 17094974],
2560                [10, 17094975],
2561                [11, 17094976],
2562                [12, 17094977],
2563                [13, 17094978],
2564                [14, 17094979],
2565                [15, 17094980],
2566                [16, 17094981],
2567                [17, 17094982],
2568                [18, 17094983],
2569                [19, 17094984],
2570                [20, 17094985],
2571                [21, 17094986],
2572                [22, 17094987],
2573                [23, 17094988],
2574                [24, 17094989],
2575                [25, 17094990],
2576                [26, 17094991],
2577                [27, 17094992],
2578                [28, 17094993],
2579                [29, 17094994],
2580                [30, 17094995],
2581                [31, 17094996],
2582                [32, 17094997],
2583                [33, 17094998],
2584                [34, 17094999],
2585                [35, 17095000],
2586                [36, 17095001],
2587                [37, 17095002],
2588                [38, 17095003],
2589                [39, 17095004],
2590                [40, 17095005],
2591                [41, 17095006],
2592                [42, 17095007],
2593                [43, 17095008],
2594                [44, 17095009],
2595                [45, 17095010],
2596                [46, 17095011],
2597                [47, 17095012],
2598                [48, 17095013],
2599                [49, 17095014],
2600                [50, 17095015]
2601            ]
2602        );
2603        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
2604        assert_eq!(
2605            pairs,
2606            vec![
2607                [9, 17137287],
2608                [10, 17137288],
2609                [11, 17137289],
2610                [12, 17137290],
2611                [13, 17137291],
2612                [14, 17137292],
2613                [15, 17137293],
2614                [16, 17137294],
2615                [17, 17137295],
2616                [18, 17137296],
2617                [19, 17137297],
2618                [20, 17137298],
2619                [21, 17137299],
2620                [22, 17137300],
2621                [23, 17137301],
2622                [24, 17137302],
2623                [25, 17137303],
2624                [26, 17137304],
2625                [27, 17137305],
2626                [28, 17137306],
2627                [29, 17137307],
2628                [30, 17137308],
2629                [31, 17137309],
2630                [32, 17137310],
2631                [33, 17137311],
2632                [34, 17137312],
2633                [35, 17137313],
2634                [36, 17137314],
2635                [37, 17137315],
2636                [38, 17137316],
2637                [39, 17137317],
2638                [40, 17137318],
2639                [41, 17137319]
2640            ]
2641        );
2642        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
2643        assert_eq!(
2644            pairs,
2645            vec![
2646                [2, 17306238],
2647                [3, 17306239],
2648                [4, 17306240],
2649                [5, 17306241],
2650                [6, 17306242],
2651                [7, 17306243],
2652                [8, 17306244],
2653                [9, 17306245],
2654                [10, 17306246],
2655                [11, 17306247],
2656                [12, 17306248],
2657                [13, 17306249],
2658                [14, 17306250],
2659                [15, 17306251],
2660                [16, 17306252],
2661                [17, 17306253],
2662                [18, 17306254],
2663                [19, 17306255],
2664                [20, 17306256],
2665                [21, 17306257],
2666                [22, 17306258],
2667                [23, 17306259],
2668                [24, 17306260],
2669                [25, 17306261],
2670                [26, 17306262],
2671                [27, 17306263],
2672                [28, 17306264],
2673                [29, 17306265],
2674                [30, 17306266],
2675                [31, 17306267],
2676                [32, 17306268],
2677                [33, 17306269],
2678                [34, 17306270],
2679                [35, 17306271],
2680                [36, 17306272],
2681                [37, 17306273],
2682                [38, 17306274],
2683                [39, 17306275],
2684                [40, 17306276],
2685                [41, 17306277],
2686                [42, 17306278],
2687                [43, 17306279],
2688                [44, 17306280],
2689                [45, 17306281],
2690                [46, 17306282],
2691                [47, 17306283],
2692                [48, 17306284],
2693                [49, 17306285]
2694            ]
2695        );
2696        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
2697        assert_eq!(
2698            pairs,
2699            vec![
2700                [4, 17561868],
2701                [5, 17561869],
2702                [6, 17561870],
2703                [7, 17561871],
2704                [8, 17561872],
2705                [9, 17561873],
2706                [10, 17561874],
2707                [11, 17561875],
2708                [12, 17561876],
2709                [13, 17561877],
2710                [14, 17561878],
2711                [15, 17561879],
2712                [16, 17561880],
2713                [17, 17561881],
2714                [18, 17561882],
2715                [19, 17561883],
2716                [20, 17561884],
2717                [21, 17561885],
2718                [22, 17561886],
2719                [23, 17561887],
2720                [24, 17561888],
2721                [25, 17561889],
2722                [26, 17561890],
2723                [27, 17561891],
2724                [28, 17561892],
2725                [29, 17561893],
2726                [30, 17561894],
2727                [31, 17561895],
2728                [32, 17561896],
2729                [33, 17561897],
2730                [34, 17561898],
2731                [35, 17561899],
2732                [36, 17561900],
2733                [37, 17561901],
2734                [38, 17561902],
2735                [39, 17561903],
2736                [40, 17561904],
2737                [41, 17561905],
2738                [42, 17561906],
2739                [43, 17561907],
2740                [44, 17561908],
2741                [45, 17561909],
2742                [46, 17561910],
2743                [47, 17561911],
2744                [48, 17561912]
2745            ]
2746        );
2747        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
2748        assert_eq!(
2749            pairs,
2750            vec![
2751                [0, 17566078],
2752                [1, 17566079],
2753                [2, 17566080],
2754                [3, 17566081],
2755                [4, 17566082],
2756                [5, 17566083],
2757                [6, 17566084],
2758                [7, 17566085],
2759                [8, 17566086],
2760                [9, 17566087],
2761                [10, 17566088],
2762                [11, 17566089],
2763                [12, 17566090],
2764                [13, 17566091],
2765                [14, 17566092],
2766                [15, 17566093],
2767                [16, 17566094],
2768                [17, 17566095],
2769                [18, 17566096],
2770                [19, 17566097],
2771                [20, 17566098],
2772                [21, 17566099],
2773                [22, 17566100],
2774                [23, 17566101],
2775                [24, 17566102],
2776                [25, 17566103],
2777                [26, 17566104],
2778                [27, 17566105],
2779                [28, 17566106],
2780                [29, 17566107],
2781                [30, 17566108],
2782                [31, 17566109],
2783                [32, 17566110],
2784                [33, 17566111],
2785                [34, 17566112],
2786                [35, 17566113],
2787                [36, 17566114],
2788                [37, 17566115],
2789                [38, 17566116],
2790                [39, 17566117],
2791                [40, 17566118],
2792                [41, 17577951],
2793                [42, 17577952],
2794                [43, 17577953],
2795                [44, 17577954],
2796                [45, 17577955],
2797                [46, 17577956],
2798                [47, 17577957],
2799                [48, 17577958],
2800                [49, 17577959],
2801                [50, 17577960]
2802            ]
2803        );
2804        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
2805        assert_eq!(
2806            pairs,
2807            vec![
2808                [0, 17566108],
2809                [1, 17566109],
2810                [2, 17566110],
2811                [3, 17566111],
2812                [4, 17566112],
2813                [5, 17566113],
2814                [6, 17566114],
2815                [7, 17566115],
2816                [8, 17566116],
2817                [9, 17566117],
2818                [10, 17566118],
2819                [11, 17577951],
2820                [12, 17577952],
2821                [13, 17577953],
2822                [14, 17577954],
2823                [15, 17577955],
2824                [16, 17577956],
2825                [17, 17577957],
2826                [18, 17577958],
2827                [19, 17577959],
2828                [20, 17577960],
2829                [21, 17577961],
2830                [22, 17577962],
2831                [23, 17577963],
2832                [24, 17577964],
2833                [25, 17577965],
2834                [26, 17577966],
2835                [27, 17577967],
2836                [28, 17577968],
2837                [29, 17577969],
2838                [30, 17577970],
2839                [31, 17577971],
2840                [32, 17577972],
2841                [33, 17577973],
2842                [34, 17577974],
2843                [35, 17577975],
2844                [36, 17578686],
2845                [37, 17578687],
2846                [38, 17578688],
2847                [39, 17578689],
2848                [40, 17578690],
2849                [41, 17578691],
2850                [42, 17578692],
2851                [43, 17578693],
2852                [44, 17578694],
2853                [45, 17578695],
2854                [46, 17578696],
2855                [47, 17578697],
2856                [48, 17578698],
2857                [49, 17578699],
2858                [50, 17578700]
2859            ]
2860        );
2861        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
2862        assert_eq!(
2863            pairs,
2864            vec![
2865                [0, 17566111],
2866                [1, 17566112],
2867                [2, 17566113],
2868                [3, 17566114],
2869                [4, 17566115],
2870                [5, 17566116],
2871                [6, 17566117],
2872                [7, 17566118],
2873                [8, 17577951],
2874                [9, 17577952],
2875                [10, 17577953],
2876                [11, 17577954],
2877                [12, 17577955],
2878                [13, 17577956],
2879                [14, 17577957],
2880                [15, 17577958],
2881                [16, 17577959],
2882                [17, 17577960],
2883                [18, 17577961],
2884                [19, 17577962],
2885                [20, 17577963],
2886                [21, 17577964],
2887                [22, 17577965],
2888                [23, 17577966],
2889                [24, 17577967],
2890                [25, 17577968],
2891                [26, 17577969],
2892                [27, 17577970],
2893                [28, 17577971],
2894                [29, 17577972],
2895                [30, 17577973],
2896                [31, 17577974],
2897                [32, 17577975],
2898                [33, 17578686],
2899                [34, 17578687],
2900                [35, 17578688],
2901                [36, 17578689],
2902                [37, 17578690],
2903                [38, 17578691],
2904                [39, 17578692],
2905                [40, 17578693],
2906                [41, 17578694],
2907                [42, 17578695],
2908                [43, 17578696],
2909                [44, 17578697],
2910                [45, 17578698],
2911                [46, 17578699],
2912                [47, 17578700],
2913                [48, 17578701],
2914                [49, 17578702],
2915                [50, 17578703]
2916            ]
2917        );
2918        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
2919        assert_eq!(
2920            pairs,
2921            vec![
2922                [0, 17566111],
2923                [1, 17566112],
2924                [2, 17566113],
2925                [3, 17566114],
2926                [4, 17566115],
2927                [5, 17566116],
2928                [6, 17566117],
2929                [7, 17566118],
2930                [8, 17577951],
2931                [9, 17577952],
2932                [10, 17577953],
2933                [11, 17577954],
2934                [12, 17577955],
2935                [13, 17577956],
2936                [14, 17577957],
2937                [15, 17577958],
2938                [16, 17577959],
2939                [17, 17577960],
2940                [18, 17577961],
2941                [19, 17577962],
2942                [20, 17577963],
2943                [21, 17577964],
2944                [22, 17577965],
2945                [23, 17577966],
2946                [24, 17577967],
2947                [25, 17577968],
2948                [26, 17577969],
2949                [27, 17577970],
2950                [28, 17577971],
2951                [29, 17577972],
2952                [30, 17577973],
2953                [31, 17577974],
2954                [32, 17577975],
2955                [33, 17578686],
2956                [34, 17578687],
2957                [35, 17578688],
2958                [36, 17578689],
2959                [37, 17578690],
2960                [38, 17578691],
2961                [39, 17578692],
2962                [40, 17578693],
2963                [41, 17578694],
2964                [42, 17578695],
2965                [43, 17578696],
2966                [44, 17578697],
2967                [45, 17578698],
2968                [46, 17578699],
2969                [47, 17578700],
2970                [48, 17578701],
2971                [49, 17578702],
2972                [50, 17578703]
2973            ]
2974        );
2975        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
2976        assert_eq!(
2977            pairs,
2978            vec![
2979                [0, 17566111],
2980                [1, 17566112],
2981                [2, 17566113],
2982                [3, 17566114],
2983                [4, 17566115],
2984                [5, 17566116],
2985                [6, 17566117],
2986                [7, 17566118],
2987                [8, 17577951],
2988                [9, 17577952],
2989                [10, 17577953],
2990                [11, 17577954],
2991                [12, 17577955],
2992                [13, 17577956],
2993                [14, 17577957],
2994                [15, 17577958],
2995                [16, 17577959],
2996                [17, 17577960],
2997                [18, 17577961],
2998                [19, 17577962],
2999                [20, 17577963],
3000                [21, 17577964],
3001                [22, 17577965],
3002                [23, 17577966],
3003                [24, 17577967],
3004                [25, 17577968],
3005                [26, 17577969],
3006                [27, 17577970],
3007                [28, 17577971],
3008                [29, 17577972],
3009                [30, 17577973],
3010                [31, 17577974],
3011                [32, 17577975],
3012                [33, 17578686],
3013                [34, 17578687],
3014                [35, 17578688],
3015                [36, 17578689],
3016                [37, 17578690],
3017                [38, 17578691],
3018                [39, 17578692],
3019                [40, 17578693],
3020                [41, 17578694],
3021                [42, 17578695],
3022                [43, 17578696],
3023                [44, 17578697],
3024                [45, 17578698],
3025                [46, 17578699],
3026                [47, 17578700],
3027                [48, 17578701],
3028                [49, 17578702],
3029                [50, 17578703]
3030            ]
3031        );
3032        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
3033        assert_eq!(
3034            pairs,
3035            vec![
3036                [0, 17566111],
3037                [1, 17566112],
3038                [2, 17566113],
3039                [3, 17566114],
3040                [4, 17566115],
3041                [5, 17566116],
3042                [6, 17566117],
3043                [7, 17566118],
3044                [8, 17577951],
3045                [9, 17577952],
3046                [10, 17577953],
3047                [11, 17577954],
3048                [12, 17577955],
3049                [13, 17577956],
3050                [14, 17577957],
3051                [15, 17577958],
3052                [16, 17577959],
3053                [17, 17577960],
3054                [18, 17577961],
3055                [19, 17577962],
3056                [20, 17577963],
3057                [21, 17577964],
3058                [22, 17577965],
3059                [23, 17577966],
3060                [24, 17577967],
3061                [25, 17577968],
3062                [26, 17577969],
3063                [27, 17577970],
3064                [28, 17577971],
3065                [29, 17577972],
3066                [30, 17577973],
3067                [31, 17577974],
3068                [32, 17577975],
3069                [33, 17578686],
3070                [34, 17578687],
3071                [35, 17578688],
3072                [36, 17578689],
3073                [37, 17578690],
3074                [38, 17578691],
3075                [39, 17578692],
3076                [40, 17578693],
3077                [41, 17578694],
3078                [42, 17578695],
3079                [43, 17578696],
3080                [44, 17578697],
3081                [45, 17578698],
3082                [46, 17578699],
3083                [47, 17578700],
3084                [48, 17578701],
3085                [49, 17578702],
3086                [50, 17578703]
3087            ]
3088        );
3089        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
3090        assert_eq!(
3091            pairs,
3092            vec![
3093                [0, 17566112],
3094                [1, 17566113],
3095                [2, 17566114],
3096                [3, 17566115],
3097                [4, 17566116],
3098                [5, 17566117],
3099                [6, 17566118],
3100                [7, 17577951],
3101                [8, 17577952],
3102                [9, 17577953],
3103                [10, 17577954],
3104                [11, 17577955],
3105                [12, 17577956],
3106                [13, 17577957],
3107                [14, 17577958],
3108                [15, 17577959],
3109                [16, 17577960],
3110                [17, 17577961],
3111                [18, 17577962],
3112                [19, 17577963],
3113                [20, 17577964],
3114                [21, 17577965],
3115                [22, 17577966],
3116                [23, 17577967],
3117                [24, 17577968],
3118                [25, 17577969],
3119                [26, 17577970],
3120                [27, 17577971],
3121                [28, 17577972],
3122                [29, 17577973],
3123                [30, 17577974],
3124                [31, 17577975],
3125                [32, 17578686],
3126                [33, 17578687],
3127                [34, 17578688],
3128                [35, 17578689],
3129                [36, 17578690],
3130                [37, 17578691],
3131                [38, 17578692],
3132                [39, 17578693],
3133                [40, 17578694],
3134                [41, 17578695],
3135                [42, 17578696],
3136                [43, 17578697],
3137                [44, 17578698],
3138                [45, 17578699],
3139                [46, 17578700],
3140                [47, 17578701],
3141                [48, 17578702],
3142                [49, 17578703],
3143                [50, 17578704]
3144            ]
3145        );
3146        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
3147        assert_eq!(
3148            pairs,
3149            vec![
3150                [0, 17566113],
3151                [1, 17566114],
3152                [2, 17566115],
3153                [3, 17566116],
3154                [4, 17566117],
3155                [5, 17566118],
3156                [6, 17577951],
3157                [7, 17577952],
3158                [8, 17577953],
3159                [9, 17577954],
3160                [10, 17577955],
3161                [11, 17577956],
3162                [12, 17577957],
3163                [13, 17577958],
3164                [14, 17577959],
3165                [15, 17577960],
3166                [16, 17577961],
3167                [17, 17577962],
3168                [18, 17577963],
3169                [19, 17577964],
3170                [20, 17577965],
3171                [21, 17577966],
3172                [22, 17577967],
3173                [23, 17577968],
3174                [24, 17577969],
3175                [25, 17577970],
3176                [26, 17577971],
3177                [27, 17577972],
3178                [28, 17577973],
3179                [29, 17577974],
3180                [30, 17577975],
3181                [31, 17578686],
3182                [32, 17578687],
3183                [33, 17578688],
3184                [34, 17578689],
3185                [35, 17578690],
3186                [36, 17578691],
3187                [37, 17578692],
3188                [38, 17578693],
3189                [39, 17578694],
3190                [40, 17578695],
3191                [41, 17578696],
3192                [42, 17578697],
3193                [43, 17578698],
3194                [44, 17578699],
3195                [45, 17578700],
3196                [46, 17578701],
3197                [47, 17578702],
3198                [48, 17578703],
3199                [49, 17578704],
3200                [50, 17578705]
3201            ]
3202        );
3203        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
3204        assert_eq!(
3205            pairs,
3206            vec![
3207                [0, 17566113],
3208                [1, 17566114],
3209                [2, 17566115],
3210                [3, 17566116],
3211                [4, 17566117],
3212                [5, 17566118],
3213                [6, 17577951],
3214                [7, 17577952],
3215                [8, 17577953],
3216                [9, 17577954],
3217                [10, 17577955],
3218                [11, 17577956],
3219                [12, 17577957],
3220                [13, 17577958],
3221                [14, 17577959],
3222                [15, 17577960],
3223                [16, 17577961],
3224                [17, 17577962],
3225                [18, 17577963],
3226                [19, 17577964],
3227                [20, 17577965],
3228                [21, 17577966],
3229                [22, 17577967],
3230                [23, 17577968],
3231                [24, 17577969],
3232                [25, 17577970],
3233                [26, 17577971],
3234                [27, 17577972],
3235                [28, 17577973],
3236                [29, 17577974],
3237                [30, 17577975],
3238                [31, 17578686],
3239                [32, 17578687],
3240                [33, 17578688],
3241                [34, 17578689],
3242                [35, 17578690],
3243                [36, 17578691],
3244                [37, 17578692],
3245                [38, 17578693],
3246                [39, 17578694],
3247                [40, 17578695],
3248                [41, 17578696],
3249                [42, 17578697],
3250                [43, 17578698],
3251                [44, 17578699],
3252                [45, 17578700],
3253                [46, 17578701],
3254                [47, 17578702],
3255                [48, 17578703],
3256                [49, 17578704],
3257                [50, 17578705]
3258            ]
3259        );
3260        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
3261        assert_eq!(
3262            pairs,
3263            vec![
3264                [1, 17579733],
3265                [2, 17579734],
3266                [3, 17579735],
3267                [4, 17579736],
3268                [5, 17579737],
3269                [6, 17579738],
3270                [7, 17579739],
3271                [8, 17579740],
3272                [9, 17579741],
3273                [10, 17579742],
3274                [11, 17579743],
3275                [12, 17579744],
3276                [13, 17579745],
3277                [14, 17579746],
3278                [15, 17579747],
3279                [16, 17579748],
3280                [17, 17579749],
3281                [18, 17579750],
3282                [19, 17579751],
3283                [20, 17579752],
3284                [21, 17579753],
3285                [22, 17579754],
3286                [23, 17579755],
3287                [24, 17579756],
3288                [25, 17579757],
3289                [26, 17579758],
3290                [27, 17579759],
3291                [28, 17579760],
3292                [29, 17579761],
3293                [30, 17579762],
3294                [31, 17579763],
3295                [32, 17579764],
3296                [33, 17579765],
3297                [34, 17579766],
3298                [35, 17579767],
3299                [36, 17579768],
3300                [37, 17579769],
3301                [38, 17579770],
3302                [39, 17579771],
3303                [40, 17579772],
3304                [41, 17579773],
3305                [42, 17579774],
3306                [43, 17579775],
3307                [44, 17579776],
3308                [45, 17581244],
3309                [46, 17581245],
3310                [47, 17581246],
3311                [48, 17581247],
3312                [49, 17581248],
3313                [50, 17581249]
3314            ]
3315        );
3316        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
3317        assert_eq!(
3318            pairs,
3319            vec![
3320                [0, 17581369],
3321                [1, 17581370],
3322                [2, 17582885],
3323                [3, 17582886],
3324                [4, 17582887],
3325                [5, 17582888],
3326                [6, 17582889],
3327                [7, 17582890],
3328                [8, 17582891],
3329                [9, 17582892],
3330                [10, 17582893],
3331                [11, 17582894],
3332                [12, 17582895],
3333                [13, 17582896],
3334                [14, 17582897],
3335                [15, 17582898],
3336                [16, 17582899],
3337                [17, 17582900],
3338                [18, 17582901],
3339                [19, 17582902],
3340                [20, 17582903],
3341                [21, 17582904],
3342                [22, 17582905],
3343                [23, 17582906],
3344                [24, 17582907],
3345                [25, 17582908],
3346                [26, 17582909],
3347                [27, 17582910],
3348                [28, 17582911],
3349                [29, 17582912],
3350                [30, 17582913],
3351                [31, 17582914],
3352                [32, 17582915],
3353                [33, 17582916],
3354                [34, 17582917],
3355                [35, 17582918],
3356                [36, 17582919],
3357                [37, 17582920],
3358                [38, 17582921],
3359                [39, 17582922],
3360                [40, 17582923],
3361                [41, 17582924],
3362                [42, 17582925],
3363                [43, 17582926],
3364                [44, 17582927],
3365                [45, 17582928],
3366                [46, 17582929],
3367                [47, 17582930],
3368                [48, 17582931],
3369                [49, 17582932],
3370                [50, 17583028]
3371            ]
3372        );
3373        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
3374        assert_eq!(
3375            pairs,
3376            vec![
3377                [0, 17581370],
3378                [1, 17582885],
3379                [2, 17582886],
3380                [3, 17582887],
3381                [4, 17582888],
3382                [5, 17582889],
3383                [6, 17582890],
3384                [7, 17582891],
3385                [8, 17582892],
3386                [9, 17582893],
3387                [10, 17582894],
3388                [11, 17582895],
3389                [12, 17582896],
3390                [13, 17582897],
3391                [14, 17582898],
3392                [15, 17582899],
3393                [16, 17582900],
3394                [17, 17582901],
3395                [18, 17582902],
3396                [19, 17582903],
3397                [20, 17582904],
3398                [21, 17582905],
3399                [22, 17582906],
3400                [23, 17582907],
3401                [24, 17582908],
3402                [25, 17582909],
3403                [26, 17582910],
3404                [27, 17582911],
3405                [28, 17582912],
3406                [29, 17582913],
3407                [30, 17582914],
3408                [31, 17582915],
3409                [32, 17582916],
3410                [33, 17582917],
3411                [34, 17582918],
3412                [35, 17582919],
3413                [36, 17582920],
3414                [37, 17582921],
3415                [38, 17582922],
3416                [39, 17582923],
3417                [40, 17582924],
3418                [41, 17582925],
3419                [42, 17582926],
3420                [43, 17582927],
3421                [44, 17582928],
3422                [45, 17582929],
3423                [46, 17582930],
3424                [47, 17582931],
3425                [48, 17582932],
3426                [49, 17583028],
3427                [50, 17583029]
3428            ]
3429        );
3430        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
3431        assert_eq!(
3432            pairs,
3433            vec![
3434                [0, 17581370],
3435                [1, 17582885],
3436                [2, 17582886],
3437                [3, 17582887],
3438                [4, 17582888],
3439                [5, 17582889],
3440                [6, 17582890],
3441                [7, 17582891],
3442                [8, 17582892],
3443                [9, 17582893],
3444                [10, 17582894],
3445                [11, 17582895],
3446                [12, 17582896],
3447                [13, 17582897],
3448                [14, 17582898],
3449                [15, 17582899],
3450                [16, 17582900],
3451                [17, 17582901],
3452                [18, 17582902],
3453                [19, 17582903],
3454                [20, 17582904],
3455                [21, 17582905],
3456                [22, 17582906],
3457                [23, 17582907],
3458                [24, 17582908],
3459                [25, 17582909],
3460                [26, 17582910],
3461                [27, 17582911],
3462                [28, 17582912],
3463                [29, 17582913],
3464                [30, 17582914],
3465                [31, 17582915],
3466                [32, 17582916],
3467                [33, 17582917],
3468                [34, 17582918],
3469                [35, 17582919],
3470                [36, 17582920],
3471                [37, 17582921],
3472                [38, 17582922],
3473                [39, 17582923],
3474                [40, 17582924],
3475                [41, 17582925],
3476                [42, 17582926],
3477                [43, 17582927],
3478                [44, 17582928],
3479                [45, 17582929],
3480                [46, 17582930],
3481                [47, 17582931],
3482                [48, 17582932],
3483                [49, 17583028],
3484                [50, 17583029]
3485            ]
3486        );
3487        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
3488        assert_eq!(
3489            pairs,
3490            vec![
3491                [1, 17582911],
3492                [2, 17582912],
3493                [3, 17582913],
3494                [4, 17582914],
3495                [5, 17582915],
3496                [6, 17582916],
3497                [7, 17582917],
3498                [8, 17582918],
3499                [9, 17582919],
3500                [10, 17582920],
3501                [11, 17582921],
3502                [12, 17582922],
3503                [13, 17582923],
3504                [14, 17582924],
3505                [15, 17582925],
3506                [16, 17582926],
3507                [17, 17582927],
3508                [18, 17582928],
3509                [19, 17582929],
3510                [20, 17582930],
3511                [21, 17582931],
3512                [22, 17582932],
3513                [23, 17583028],
3514                [24, 17583029],
3515                [25, 17583030],
3516                [26, 17583031],
3517                [27, 17583032],
3518                [28, 17583033],
3519                [29, 17583034],
3520                [30, 17583035],
3521                [31, 17583036],
3522                [32, 17583037],
3523                [33, 17583038],
3524                [34, 17583039],
3525                [35, 17583040],
3526                [36, 17583041],
3527                [37, 17583042],
3528                [38, 17583043],
3529                [39, 17583044],
3530                [40, 17583045],
3531                [41, 17583046],
3532                [42, 17583047],
3533                [43, 17583048],
3534                [44, 17583049],
3535                [45, 17583050],
3536                [46, 17583051],
3537                [47, 17583052],
3538                [48, 17583053],
3539                [49, 17583054],
3540                [50, 17583055]
3541            ]
3542        );
3543        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
3544        assert_eq!(
3545            pairs,
3546            vec![
3547                [0, 17588621],
3548                [1, 17588622],
3549                [2, 17588623],
3550                [3, 17588624],
3551                [4, 17588625],
3552                [5, 17588626],
3553                [6, 17588627],
3554                [7, 17588628],
3555                [8, 17588629],
3556                [9, 17588630],
3557                [10, 17588631],
3558                [11, 17588632],
3559                [12, 17588633],
3560                [13, 17588634],
3561                [14, 17588635],
3562                [15, 17588636],
3563                [16, 17588637],
3564                [17, 17588638],
3565                [18, 17588639],
3566                [19, 17588640],
3567                [20, 17588641],
3568                [21, 17588642],
3569                [22, 17588643],
3570                [23, 17588644],
3571                [24, 17588645],
3572                [25, 17588646],
3573                [26, 17588647],
3574                [27, 17588648],
3575                [28, 17588649],
3576                [29, 17588650],
3577                [30, 17588651],
3578                [31, 17588652],
3579                [32, 17588653],
3580                [33, 17588654],
3581                [34, 17588655],
3582                [35, 17588656],
3583                [36, 17588657],
3584                [37, 17589196],
3585                [38, 17589197],
3586                [39, 17589198],
3587                [40, 17589199],
3588                [41, 17589200],
3589                [42, 17589201],
3590                [43, 17589202],
3591                [44, 17589203],
3592                [45, 17589204],
3593                [46, 17589205],
3594                [47, 17589206],
3595                [48, 17589207],
3596                [49, 17589208]
3597            ]
3598        );
3599        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
3600        assert_eq!(
3601            pairs,
3602            vec![
3603                [0, 17588621],
3604                [1, 17588622],
3605                [2, 17588623],
3606                [3, 17588624],
3607                [4, 17588625],
3608                [5, 17588626],
3609                [6, 17588627],
3610                [7, 17588628],
3611                [8, 17588629],
3612                [9, 17588630],
3613                [10, 17588631],
3614                [11, 17588632],
3615                [12, 17588633],
3616                [13, 17588634],
3617                [14, 17588635],
3618                [15, 17588636],
3619                [16, 17588637],
3620                [17, 17588638],
3621                [18, 17588639],
3622                [19, 17588640],
3623                [20, 17588641],
3624                [21, 17588642],
3625                [22, 17588643],
3626                [23, 17588644],
3627                [24, 17588645],
3628                [25, 17588646],
3629                [26, 17588647],
3630                [27, 17588648],
3631                [28, 17588649],
3632                [29, 17588650],
3633                [30, 17588651],
3634                [31, 17588652],
3635                [32, 17588653],
3636                [33, 17588654],
3637                [34, 17588655],
3638                [35, 17588656],
3639                [36, 17588657],
3640                [37, 17589196],
3641                [38, 17589197],
3642                [39, 17589198],
3643                [40, 17589199],
3644                [41, 17589200],
3645                [42, 17589201],
3646                [43, 17589202],
3647                [44, 17589203],
3648                [45, 17589204],
3649                [46, 17589205],
3650                [47, 17589206],
3651                [48, 17589207],
3652                [49, 17589208]
3653            ]
3654        );
3655        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
3656        assert_eq!(
3657            pairs,
3658            vec![
3659                [0, 17588621],
3660                [1, 17588622],
3661                [2, 17588623],
3662                [3, 17588624],
3663                [4, 17588625],
3664                [5, 17588626],
3665                [6, 17588627],
3666                [7, 17588628],
3667                [8, 17588629],
3668                [9, 17588630],
3669                [10, 17588631],
3670                [11, 17588632],
3671                [12, 17588633],
3672                [13, 17588634],
3673                [14, 17588635],
3674                [15, 17588636],
3675                [16, 17588637],
3676                [17, 17588638],
3677                [18, 17588639],
3678                [19, 17588640],
3679                [20, 17588641],
3680                [21, 17588642],
3681                [22, 17588643],
3682                [23, 17588644],
3683                [24, 17588645],
3684                [25, 17588646],
3685                [26, 17588647],
3686                [27, 17588648],
3687                [28, 17588649],
3688                [29, 17588650],
3689                [30, 17588651],
3690                [31, 17588652],
3691                [32, 17588653],
3692                [33, 17588654],
3693                [34, 17588655],
3694                [35, 17588656],
3695                [36, 17588657],
3696                [37, 17589196],
3697                [38, 17589197],
3698                [39, 17589198],
3699                [40, 17589199],
3700                [41, 17589200],
3701                [42, 17589201],
3702                [43, 17589202],
3703                [44, 17589203],
3704                [45, 17589204],
3705                [46, 17589205],
3706                [47, 17589206],
3707                [48, 17589207],
3708                [49, 17589208]
3709            ]
3710        );
3711        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
3712        assert_eq!(
3713            pairs,
3714            vec![
3715                [1, 17591770],
3716                [2, 17591771],
3717                [3, 17591772],
3718                [4, 17591773],
3719                [5, 17591774],
3720                [6, 17591775],
3721                [7, 17591776],
3722                [8, 17591777],
3723                [9, 17591778],
3724                [10, 17591779],
3725                [11, 17591780],
3726                [12, 17591781],
3727                [13, 17591782],
3728                [14, 17591783],
3729                [15, 17591784],
3730                [16, 17591785],
3731                [17, 17591786],
3732                [18, 17591787],
3733                [19, 17591788],
3734                [20, 17591789],
3735                [21, 17591790],
3736                [22, 17591791],
3737                [23, 17591792],
3738                [24, 17591793],
3739                [25, 17591794],
3740                [26, 17591796],
3741                [27, 17591797],
3742                [28, 17591798],
3743                [29, 17591799],
3744                [30, 17591800],
3745                [31, 17591801],
3746                [32, 17591802],
3747                [33, 17591803],
3748                [34, 17591804],
3749                [35, 17591805],
3750                [36, 17591806],
3751                [37, 17591807],
3752                [38, 17591808],
3753                [39, 17591809],
3754                [40, 17591810],
3755                [41, 17591811],
3756                [42, 17591812],
3757                [43, 17591813],
3758                [44, 17591814],
3759                [45, 17591815],
3760                [46, 17591816],
3761                [47, 17591817],
3762                [48, 17591818],
3763                [49, 17591819],
3764                [50, 17591820]
3765            ]
3766        );
3767        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
3768        assert_eq!(
3769            pairs,
3770            vec![
3771                [0, 17593855],
3772                [1, 17593856],
3773                [2, 17593857],
3774                [3, 17593858],
3775                [4, 17593859],
3776                [5, 17593860],
3777                [6, 17593861],
3778                [7, 17593862],
3779                [8, 17593863],
3780                [9, 17593864],
3781                [10, 17593865],
3782                [11, 17593866],
3783                [12, 17593867],
3784                [13, 17593868],
3785                [14, 17593869],
3786                [15, 17593870],
3787                [16, 17593871],
3788                [17, 17593872],
3789                [18, 17593873],
3790                [19, 17593874],
3791                [20, 17593875],
3792                [21, 17593876],
3793                [22, 17593877],
3794                [23, 17593878],
3795                [24, 17593880],
3796                [25, 17593881],
3797                [26, 17593882],
3798                [27, 17593883],
3799                [28, 17593884],
3800                [29, 17593885],
3801                [30, 17593886],
3802                [31, 17593887],
3803                [32, 17593888],
3804                [33, 17593889],
3805                [34, 17593890],
3806                [35, 17593891],
3807                [36, 17593892],
3808                [37, 17593893],
3809                [38, 17593894],
3810                [39, 17593895],
3811                [40, 17593896],
3812                [41, 17593897],
3813                [42, 17593898],
3814                [43, 17593899],
3815                [44, 17593900],
3816                [45, 17593901],
3817                [46, 17593902],
3818                [47, 17593903]
3819            ]
3820        );
3821        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
3822        assert_eq!(
3823            pairs,
3824            vec![
3825                [0, 17593863],
3826                [1, 17593864],
3827                [2, 17593865],
3828                [3, 17593866],
3829                [4, 17593867],
3830                [5, 17593868],
3831                [6, 17593869],
3832                [7, 17593870],
3833                [8, 17593871],
3834                [9, 17593872],
3835                [10, 17593873],
3836                [11, 17593874],
3837                [12, 17593875],
3838                [13, 17593876],
3839                [14, 17593877],
3840                [15, 17593878],
3841                [16, 17593880],
3842                [17, 17593881],
3843                [18, 17593882],
3844                [19, 17593883],
3845                [20, 17593884],
3846                [21, 17593885],
3847                [22, 17593886],
3848                [23, 17593887],
3849                [24, 17593888],
3850                [25, 17593889],
3851                [26, 17593890],
3852                [27, 17593891],
3853                [28, 17593892],
3854                [29, 17593893],
3855                [30, 17593894],
3856                [31, 17593895],
3857                [32, 17593896],
3858                [33, 17593897],
3859                [34, 17593898],
3860                [35, 17593899],
3861                [36, 17593900],
3862                [37, 17593901],
3863                [38, 17593902],
3864                [39, 17593903],
3865                [40, 17593904],
3866                [41, 17593905],
3867                [42, 17593906],
3868                [43, 17593907]
3869            ]
3870        );
3871        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
3872        assert_eq!(
3873            pairs,
3874            vec![
3875                [11, 17596476],
3876                [12, 17596477],
3877                [13, 17596478],
3878                [14, 17596479],
3879                [15, 17596480],
3880                [16, 17596481],
3881                [17, 17596482],
3882                [19, 17596483],
3883                [20, 17596484],
3884                [21, 17596485],
3885                [22, 17596486],
3886                [23, 17596487],
3887                [24, 17596488],
3888                [25, 17596489],
3889                [26, 17596490],
3890                [27, 17596491],
3891                [28, 17596492],
3892                [29, 17596493],
3893                [30, 17596494],
3894                [31, 17596495],
3895                [32, 17596496],
3896                [33, 17596497],
3897                [34, 17596498],
3898                [35, 17596499],
3899                [36, 17596500],
3900                [37, 17596501],
3901                [38, 17596502],
3902                [39, 17596503],
3903                [40, 17596504],
3904                [41, 17596505],
3905                [42, 17596506],
3906                [43, 17596507],
3907                [44, 17596508],
3908                [45, 17596509],
3909                [46, 17596510],
3910                [47, 17596511],
3911                [48, 17596512],
3912                [49, 17596513],
3913                [50, 17596514]
3914            ]
3915        );
3916        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
3917        assert_eq!(
3918            pairs,
3919            vec![
3920                [5, 17624012],
3921                [6, 17624013],
3922                [7, 17624014],
3923                [8, 17624015],
3924                [9, 17624016],
3925                [10, 17624017],
3926                [11, 17624018],
3927                [12, 17624019],
3928                [13, 17624020],
3929                [14, 17625913],
3930                [15, 17625914],
3931                [16, 17625915],
3932                [17, 17625916],
3933                [18, 17625917],
3934                [19, 17625918],
3935                [20, 17625919],
3936                [21, 17625920],
3937                [22, 17625921],
3938                [23, 17625922],
3939                [24, 17625923],
3940                [25, 17625924],
3941                [26, 17625925],
3942                [27, 17625926],
3943                [28, 17625927],
3944                [29, 17625928],
3945                [30, 17625929],
3946                [31, 17625930],
3947                [32, 17625931],
3948                [33, 17625932],
3949                [34, 17625933],
3950                [35, 17625934],
3951                [36, 17625935],
3952                [37, 17625936],
3953                [38, 17625937],
3954                [39, 17625938],
3955                [40, 17625939],
3956                [41, 17625940],
3957                [42, 17625941],
3958                [43, 17625942],
3959                [44, 17625943],
3960                [45, 17625944],
3961                [46, 17625945],
3962                [47, 17625946],
3963                [48, 17625947],
3964                [49, 17625948],
3965                [50, 17625949]
3966            ]
3967        );
3968        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
3969        assert_eq!(
3970            pairs,
3971            vec![
3972                [2, 17624012],
3973                [3, 17624013],
3974                [4, 17624014],
3975                [5, 17624015],
3976                [6, 17624016],
3977                [7, 17624017],
3978                [8, 17624018],
3979                [9, 17624019],
3980                [10, 17624020],
3981                [11, 17625913],
3982                [12, 17625914],
3983                [13, 17625915],
3984                [14, 17625916],
3985                [15, 17625917],
3986                [16, 17625918],
3987                [17, 17625919],
3988                [18, 17625920],
3989                [19, 17625921],
3990                [20, 17625922],
3991                [21, 17625923],
3992                [22, 17625924],
3993                [23, 17625925],
3994                [24, 17625926],
3995                [25, 17625927],
3996                [26, 17625928],
3997                [27, 17625929],
3998                [28, 17625930],
3999                [29, 17625931],
4000                [30, 17625932],
4001                [31, 17625933],
4002                [32, 17625934],
4003                [33, 17625935],
4004                [34, 17625936],
4005                [35, 17625937],
4006                [36, 17625938],
4007                [37, 17625939],
4008                [38, 17625940],
4009                [39, 17625941],
4010                [40, 17625942],
4011                [41, 17625943],
4012                [42, 17625944],
4013                [43, 17625945],
4014                [44, 17625946],
4015                [45, 17625947],
4016                [46, 17625948],
4017                [47, 17625949],
4018                [48, 17625950],
4019                [49, 17625951],
4020                [50, 17625952]
4021            ]
4022        );
4023        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
4024        assert_eq!(
4025            pairs,
4026            vec![
4027                [1, 31796700],
4028                [2, 31796701],
4029                [3, 31796702],
4030                [4, 31796703],
4031                [5, 31796704],
4032                [6, 31796705],
4033                [7, 31796706],
4034                [8, 31796710],
4035                [9, 31796711],
4036                [10, 31796712],
4037                [11, 31796713],
4038                [12, 31796714],
4039                [13, 31796715],
4040                [14, 31796716],
4041                [15, 31796717],
4042                [16, 31796718],
4043                [17, 31796719],
4044                [18, 31796720],
4045                [19, 31796721],
4046                [20, 31796722],
4047                [21, 31796723],
4048                [22, 31796724],
4049                [23, 31796725],
4050                [24, 31796726],
4051                [25, 31796727],
4052                [26, 31796728],
4053                [27, 31799014],
4054                [28, 31799015],
4055                [29, 31799016],
4056                [30, 31799017],
4057                [31, 31799018],
4058                [32, 31799019],
4059                [33, 31799020],
4060                [34, 31799021],
4061                [35, 31799022],
4062                [36, 31799023],
4063                [37, 31799024],
4064                [38, 31799025],
4065                [39, 31799026],
4066                [40, 31799027],
4067                [41, 31799028],
4068                [42, 31799029],
4069                [43, 31799030],
4070                [44, 31799031],
4071                [45, 31799032],
4072                [46, 31799033],
4073                [47, 31799034],
4074                [48, 31799035],
4075                [49, 31799036],
4076                [50, 31799037]
4077            ]
4078        );
4079        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
4080        assert_eq!(
4081            pairs,
4082            vec![
4083                [0, 36722692],
4084                [1, 36722693],
4085                [2, 36722694],
4086                [3, 36722695],
4087                [4, 36722696],
4088                [5, 36722697],
4089                [6, 36722698],
4090                [7, 36722699],
4091                [8, 36722700],
4092                [9, 36722701],
4093                [10, 36722702],
4094                [11, 36722703],
4095                [12, 36722704],
4096                [13, 36722705],
4097                [14, 36723505],
4098                [15, 36723506],
4099                [16, 36723507],
4100                [17, 36723508],
4101                [18, 36723509],
4102                [19, 36723510],
4103                [20, 36723511],
4104                [21, 36723512],
4105                [22, 36723513],
4106                [23, 36723514],
4107                [24, 36723515],
4108                [25, 36723516],
4109                [26, 36723517],
4110                [27, 36723518],
4111                [28, 36723519],
4112                [29, 36723520],
4113                [30, 36723521],
4114                [31, 36723522],
4115                [32, 36723523],
4116                [33, 36723524],
4117                [34, 36723525],
4118                [35, 36723526],
4119                [36, 36723527],
4120                [37, 36723528],
4121                [38, 36723529],
4122                [39, 36723530],
4123                [40, 36723531],
4124                [41, 36723532],
4125                [42, 36737414],
4126                [43, 36737415],
4127                [44, 36737416],
4128                [45, 36737417],
4129                [46, 36737418],
4130                [47, 36737419],
4131                [48, 36737420]
4132            ]
4133        );
4134        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
4135        assert_eq!(
4136            pairs,
4137            vec![
4138                [4, 44587963],
4139                [5, 44587964],
4140                [6, 44587965],
4141                [7, 44587966],
4142                [8, 44587967],
4143                [9, 44587968],
4144                [10, 44587969],
4145                [11, 44587970],
4146                [12, 44587971],
4147                [13, 44587972],
4148                [14, 44587973],
4149                [15, 44587974],
4150                [16, 44587975],
4151                [17, 44587976],
4152                [18, 44587977],
4153                [19, 44587978],
4154                [20, 44587979],
4155                [21, 44587980],
4156                [22, 44587981],
4157                [23, 44587982],
4158                [24, 44587983],
4159                [25, 44589680],
4160                [26, 44589681],
4161                [27, 44589682],
4162                [28, 44589683],
4163                [29, 44589684],
4164                [30, 44589685],
4165                [31, 44589686],
4166                [32, 44589687],
4167                [33, 44589688],
4168                [34, 44589689],
4169                [35, 44589690],
4170                [36, 44589691],
4171                [37, 44589692],
4172                [38, 44589693],
4173                [39, 44589694],
4174                [40, 44589695],
4175                [41, 44589696],
4176                [42, 44589697],
4177                [43, 44589698],
4178                [44, 44589699],
4179                [45, 44589700],
4180                [46, 44589701],
4181                [47, 44589702],
4182                [48, 44592034],
4183                [49, 44592035],
4184                [50, 44592036]
4185            ]
4186        );
4187    }
4188
4189    #[test]
4190    fn test_aligned_pairs_full() {
4191        let mut bam = bam::Reader::from_path("./test/test_spliced_reads.bam").unwrap();
4192        let mut it = bam.records();
4193
4194        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
4195        assert_eq!(
4196            pairs,
4197            vec![
4198                [Some(0), None],
4199                [Some(1), None],
4200                [Some(2), None],
4201                [Some(3), None],
4202                [Some(4), None],
4203                [Some(5), None],
4204                [Some(6), Some(16050676)],
4205                [Some(7), Some(16050677)],
4206                [Some(8), Some(16050678)],
4207                [Some(9), Some(16050679)],
4208                [Some(10), Some(16050680)],
4209                [Some(11), Some(16050681)],
4210                [Some(12), Some(16050682)],
4211                [Some(13), Some(16050683)],
4212                [Some(14), Some(16050684)],
4213                [Some(15), Some(16050685)],
4214                [Some(16), Some(16050686)],
4215                [Some(17), Some(16050687)],
4216                [Some(18), Some(16050688)],
4217                [Some(19), Some(16050689)],
4218                [Some(20), Some(16050690)],
4219                [Some(21), Some(16050691)],
4220                [Some(22), Some(16050692)],
4221                [Some(23), Some(16050693)],
4222                [Some(24), Some(16050694)],
4223                [Some(25), Some(16050695)],
4224                [Some(26), Some(16050696)],
4225                [Some(27), Some(16050697)],
4226                [Some(28), Some(16050698)],
4227                [Some(29), Some(16050699)],
4228                [Some(30), Some(16050700)],
4229                [Some(31), Some(16050701)],
4230                [Some(32), Some(16050702)],
4231                [Some(33), Some(16050703)],
4232                [Some(34), Some(16050704)],
4233                [Some(35), Some(16050705)],
4234                [Some(36), Some(16050706)],
4235                [Some(37), Some(16050707)],
4236                [Some(38), Some(16050708)],
4237                [Some(39), Some(16050709)],
4238                [Some(40), Some(16050710)],
4239                [Some(41), Some(16050711)],
4240                [Some(42), Some(16050712)],
4241                [Some(43), Some(16050713)],
4242                [Some(44), Some(16050714)],
4243                [Some(45), Some(16050715)],
4244                [Some(46), Some(16050716)],
4245                [Some(47), Some(16050717)],
4246                [Some(48), Some(16050718)],
4247                [Some(49), Some(16050719)],
4248                [Some(50), Some(16050720)]
4249            ]
4250        );
4251        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
4252        assert_eq!(
4253            pairs,
4254            vec![
4255                [Some(0), Some(16096878)],
4256                [Some(1), Some(16096879)],
4257                [Some(2), Some(16096880)],
4258                [Some(3), Some(16096881)],
4259                [Some(4), Some(16096882)],
4260                [Some(5), Some(16096883)],
4261                [Some(6), Some(16096884)],
4262                [None, Some(16096885)],
4263                [None, Some(16096886)],
4264                [Some(7), Some(16096887)],
4265                [Some(8), Some(16096888)],
4266                [Some(9), Some(16096889)],
4267                [Some(10), Some(16096890)],
4268                [Some(11), Some(16096891)],
4269                [Some(12), Some(16096892)],
4270                [Some(13), Some(16096893)],
4271                [Some(14), Some(16096894)],
4272                [Some(15), Some(16096895)],
4273                [Some(16), Some(16096896)],
4274                [Some(17), Some(16096897)],
4275                [Some(18), Some(16096898)],
4276                [Some(19), Some(16096899)],
4277                [Some(20), Some(16096900)],
4278                [Some(21), Some(16096901)],
4279                [Some(22), Some(16096902)],
4280                [Some(23), Some(16096903)],
4281                [Some(24), Some(16096904)],
4282                [Some(25), Some(16096905)],
4283                [Some(26), Some(16096906)],
4284                [Some(27), Some(16096907)],
4285                [Some(28), Some(16096908)],
4286                [Some(29), Some(16096909)],
4287                [Some(30), Some(16096910)],
4288                [Some(31), Some(16096911)],
4289                [Some(32), Some(16096912)],
4290                [Some(33), Some(16096913)],
4291                [Some(34), Some(16096914)],
4292                [Some(35), Some(16096915)],
4293                [Some(36), Some(16096916)],
4294                [Some(37), Some(16096917)],
4295                [Some(38), Some(16096918)],
4296                [Some(39), Some(16096919)],
4297                [Some(40), Some(16096920)],
4298                [Some(41), Some(16096921)],
4299                [Some(42), Some(16096922)],
4300                [Some(43), Some(16096923)],
4301                [Some(44), Some(16096924)],
4302                [Some(45), Some(16096925)],
4303                [Some(46), Some(16096926)],
4304                [Some(47), Some(16096927)],
4305                [Some(48), Some(16096928)],
4306                [Some(49), Some(16096929)],
4307                [Some(50), Some(16096930)]
4308            ]
4309        );
4310        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
4311        assert_eq!(
4312            pairs,
4313            vec![
4314                [Some(0), Some(16097145)],
4315                [Some(1), Some(16097146)],
4316                [Some(2), Some(16097147)],
4317                [Some(3), Some(16097148)],
4318                [Some(4), Some(16097149)],
4319                [Some(5), Some(16097150)],
4320                [Some(6), Some(16097151)],
4321                [Some(7), Some(16097152)],
4322                [Some(8), Some(16097153)],
4323                [Some(9), Some(16097154)],
4324                [Some(10), Some(16097155)],
4325                [Some(11), Some(16097156)],
4326                [Some(12), Some(16097157)],
4327                [Some(13), Some(16097158)],
4328                [Some(14), Some(16097159)],
4329                [Some(15), Some(16097160)],
4330                [Some(16), Some(16097161)],
4331                [Some(17), Some(16097162)],
4332                [Some(18), Some(16097163)],
4333                [Some(19), Some(16097164)],
4334                [Some(20), Some(16097165)],
4335                [Some(21), Some(16097166)],
4336                [Some(22), Some(16097167)],
4337                [Some(23), Some(16097168)],
4338                [Some(24), Some(16097169)],
4339                [Some(25), Some(16097170)],
4340                [Some(26), Some(16097171)],
4341                [Some(27), Some(16097172)],
4342                [Some(28), Some(16097173)],
4343                [None, Some(16097174)],
4344                [None, Some(16097175)],
4345                [Some(29), Some(16097176)],
4346                [Some(30), Some(16097177)],
4347                [Some(31), Some(16097178)],
4348                [Some(32), Some(16097179)],
4349                [Some(33), Some(16097180)],
4350                [Some(34), Some(16097181)],
4351                [Some(35), Some(16097182)],
4352                [Some(36), Some(16097183)],
4353                [Some(37), Some(16097184)],
4354                [Some(38), Some(16097185)],
4355                [Some(39), Some(16097186)],
4356                [Some(40), Some(16097187)],
4357                [Some(41), Some(16097188)],
4358                [Some(42), Some(16097189)],
4359                [Some(43), Some(16097190)],
4360                [Some(44), Some(16097191)],
4361                [Some(45), Some(16097192)],
4362                [Some(46), Some(16097193)],
4363                [Some(47), Some(16097194)],
4364                [Some(48), Some(16097195)],
4365                [Some(49), Some(16097196)],
4366                [Some(50), Some(16097197)]
4367            ]
4368        );
4369        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
4370        assert_eq!(
4371            pairs,
4372            vec![
4373                [Some(0), Some(16117350)],
4374                [Some(1), Some(16117351)],
4375                [Some(2), Some(16117352)],
4376                [Some(3), Some(16117353)],
4377                [Some(4), Some(16117354)],
4378                [Some(5), Some(16117355)],
4379                [Some(6), Some(16117356)],
4380                [Some(7), Some(16117357)],
4381                [Some(8), Some(16117358)],
4382                [Some(9), Some(16117359)],
4383                [Some(10), Some(16117360)],
4384                [Some(11), Some(16117361)],
4385                [Some(12), Some(16117362)],
4386                [Some(13), Some(16117363)],
4387                [Some(14), Some(16117364)],
4388                [Some(15), Some(16117365)],
4389                [Some(16), Some(16117366)],
4390                [Some(17), Some(16117367)],
4391                [Some(18), Some(16117368)],
4392                [Some(19), Some(16117369)],
4393                [Some(20), Some(16117370)],
4394                [Some(21), Some(16117371)],
4395                [Some(22), Some(16117372)],
4396                [Some(23), Some(16117373)],
4397                [Some(24), Some(16117374)],
4398                [Some(25), Some(16117375)],
4399                [Some(26), Some(16117376)],
4400                [Some(27), Some(16117377)],
4401                [Some(28), Some(16117378)],
4402                [Some(29), Some(16117379)],
4403                [Some(30), Some(16117380)],
4404                [Some(31), Some(16117381)],
4405                [Some(32), Some(16117382)],
4406                [Some(33), Some(16117383)],
4407                [Some(34), Some(16117384)],
4408                [Some(35), Some(16117385)],
4409                [Some(36), Some(16117386)],
4410                [Some(37), Some(16117387)],
4411                [Some(38), Some(16117388)],
4412                [Some(39), Some(16117389)],
4413                [Some(40), Some(16117390)],
4414                [Some(41), Some(16117391)],
4415                [Some(42), Some(16117392)],
4416                [Some(43), Some(16117393)],
4417                [Some(44), Some(16117394)],
4418                [Some(45), Some(16117395)],
4419                [Some(46), Some(16117396)],
4420                [Some(47), Some(16117397)],
4421                [Some(48), Some(16117398)],
4422                [Some(49), Some(16117399)],
4423                [Some(50), Some(16117400)]
4424            ]
4425        );
4426        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
4427        assert_eq!(
4428            pairs,
4429            vec![
4430                [Some(0), Some(16118483)],
4431                [Some(1), Some(16118484)],
4432                [Some(2), Some(16118485)],
4433                [Some(3), Some(16118486)],
4434                [Some(4), Some(16118487)],
4435                [Some(5), Some(16118488)],
4436                [Some(6), Some(16118489)],
4437                [Some(7), Some(16118490)],
4438                [Some(8), Some(16118491)],
4439                [Some(9), Some(16118492)],
4440                [Some(10), Some(16118493)],
4441                [Some(11), Some(16118494)],
4442                [Some(12), Some(16118495)],
4443                [Some(13), Some(16118496)],
4444                [Some(14), Some(16118497)],
4445                [Some(15), Some(16118498)],
4446                [Some(16), Some(16118499)],
4447                [Some(17), Some(16118500)],
4448                [Some(18), Some(16118501)],
4449                [Some(19), Some(16118502)],
4450                [Some(20), Some(16118503)],
4451                [Some(21), Some(16118504)],
4452                [Some(22), Some(16118505)],
4453                [Some(23), Some(16118506)],
4454                [Some(24), Some(16118507)],
4455                [Some(25), Some(16118508)],
4456                [Some(26), Some(16118509)],
4457                [Some(27), Some(16118510)],
4458                [Some(28), Some(16118511)],
4459                [Some(29), Some(16118512)],
4460                [Some(30), Some(16118513)],
4461                [Some(31), Some(16118514)],
4462                [Some(32), Some(16118515)],
4463                [Some(33), Some(16118516)],
4464                [Some(34), Some(16118517)],
4465                [Some(35), Some(16118518)],
4466                [Some(36), Some(16118519)],
4467                [Some(37), Some(16118520)],
4468                [Some(38), Some(16118521)],
4469                [Some(39), Some(16118522)],
4470                [Some(40), Some(16118523)],
4471                [Some(41), Some(16118524)],
4472                [Some(42), Some(16118525)],
4473                [Some(43), Some(16118526)],
4474                [Some(44), Some(16118527)],
4475                [Some(45), Some(16118528)],
4476                [Some(46), Some(16118529)],
4477                [Some(47), Some(16118530)],
4478                [Some(48), Some(16118531)],
4479                [Some(49), Some(16118532)],
4480                [Some(50), Some(16118533)]
4481            ]
4482        );
4483
4484        //
4485        //for the rest, we just verify that they have the expected amount of None in each position
4486        fn some_count(pairs: &[[Option<i64>; 2]], pos: usize) -> i64 {
4487            pairs.iter().filter(|x| x[pos].is_some()).count() as i64
4488        }
4489        fn none_count(pairs: &[[Option<i64>; 2]], pos: usize) -> i64 {
4490            pairs.iter().filter(|x| x[pos].is_none()).count() as i64
4491        }
4492
4493        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
4494        assert_eq!(some_count(&pairs, 0), 51);
4495        assert_eq!(none_count(&pairs, 0), 0);
4496        assert_eq!(some_count(&pairs, 1), 51);
4497        assert_eq!(none_count(&pairs, 1), 0);
4498        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
4499        assert_eq!(some_count(&pairs, 0), 51);
4500        assert_eq!(none_count(&pairs, 0), 0);
4501        assert_eq!(some_count(&pairs, 1), 51);
4502        assert_eq!(none_count(&pairs, 1), 0);
4503        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
4504        assert_eq!(some_count(&pairs, 0), 51);
4505        assert_eq!(none_count(&pairs, 0), 0);
4506        assert_eq!(some_count(&pairs, 1), 51);
4507        assert_eq!(none_count(&pairs, 1), 0);
4508        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
4509        assert_eq!(some_count(&pairs, 0), 51);
4510        assert_eq!(none_count(&pairs, 0), 0);
4511        assert_eq!(some_count(&pairs, 1), 51);
4512        assert_eq!(none_count(&pairs, 1), 0);
4513        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
4514        assert_eq!(some_count(&pairs, 0), 51);
4515        assert_eq!(none_count(&pairs, 0), 0);
4516        assert_eq!(some_count(&pairs, 1), 45);
4517        assert_eq!(none_count(&pairs, 1), 6);
4518        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
4519        assert_eq!(some_count(&pairs, 0), 51);
4520        assert_eq!(none_count(&pairs, 0), 0);
4521        assert_eq!(some_count(&pairs, 1), 41);
4522        assert_eq!(none_count(&pairs, 1), 10);
4523        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
4524        assert_eq!(some_count(&pairs, 0), 51);
4525        assert_eq!(none_count(&pairs, 0), 0);
4526        assert_eq!(some_count(&pairs, 1), 51);
4527        assert_eq!(none_count(&pairs, 1), 0);
4528        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
4529        assert_eq!(some_count(&pairs, 0), 51);
4530        assert_eq!(none_count(&pairs, 0), 0);
4531        assert_eq!(some_count(&pairs, 1), 51);
4532        assert_eq!(none_count(&pairs, 1), 0);
4533        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
4534        assert_eq!(some_count(&pairs, 0), 51);
4535        assert_eq!(none_count(&pairs, 0), 0);
4536        assert_eq!(some_count(&pairs, 1), 51);
4537        assert_eq!(none_count(&pairs, 1), 0);
4538        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
4539        assert_eq!(some_count(&pairs, 0), 51);
4540        assert_eq!(none_count(&pairs, 0), 0);
4541        assert_eq!(some_count(&pairs, 1), 51);
4542        assert_eq!(none_count(&pairs, 1), 0);
4543        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
4544        assert_eq!(some_count(&pairs, 0), 51);
4545        assert_eq!(none_count(&pairs, 0), 0);
4546        assert_eq!(some_count(&pairs, 1), 42);
4547        assert_eq!(none_count(&pairs, 1), 9);
4548        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
4549        assert_eq!(some_count(&pairs, 0), 51);
4550        assert_eq!(none_count(&pairs, 0), 0);
4551        assert_eq!(some_count(&pairs, 1), 51);
4552        assert_eq!(none_count(&pairs, 1), 0);
4553        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
4554        assert_eq!(some_count(&pairs, 0), 51);
4555        assert_eq!(none_count(&pairs, 0), 0);
4556        assert_eq!(some_count(&pairs, 1), 50);
4557        assert_eq!(none_count(&pairs, 1), 1);
4558        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
4559        assert_eq!(some_count(&pairs, 0), 51);
4560        assert_eq!(none_count(&pairs, 0), 0);
4561        assert_eq!(some_count(&pairs, 1), 45);
4562        assert_eq!(none_count(&pairs, 1), 6);
4563        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
4564        assert_eq!(some_count(&pairs, 0), 51);
4565        assert_eq!(none_count(&pairs, 0), 0);
4566        assert_eq!(some_count(&pairs, 1), 48);
4567        assert_eq!(none_count(&pairs, 1), 3);
4568        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
4569        assert_eq!(some_count(&pairs, 0), 51);
4570        assert_eq!(none_count(&pairs, 0), 0);
4571        assert_eq!(some_count(&pairs, 1), 42);
4572        assert_eq!(none_count(&pairs, 1), 9);
4573        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
4574        assert_eq!(some_count(&pairs, 0), 51);
4575        assert_eq!(none_count(&pairs, 0), 0);
4576        assert_eq!(some_count(&pairs, 1), 38);
4577        assert_eq!(none_count(&pairs, 1), 13);
4578        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
4579        assert_eq!(some_count(&pairs, 0), 51);
4580        assert_eq!(none_count(&pairs, 0), 0);
4581        assert_eq!(some_count(&pairs, 1), 44);
4582        assert_eq!(none_count(&pairs, 1), 7);
4583        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
4584        assert_eq!(some_count(&pairs, 0), 51);
4585        assert_eq!(none_count(&pairs, 0), 0);
4586        assert_eq!(some_count(&pairs, 1), 46);
4587        assert_eq!(none_count(&pairs, 1), 5);
4588        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
4589        assert_eq!(some_count(&pairs, 0), 51);
4590        assert_eq!(none_count(&pairs, 0), 0);
4591        assert_eq!(some_count(&pairs, 1), 47);
4592        assert_eq!(none_count(&pairs, 1), 4);
4593        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
4594        assert_eq!(some_count(&pairs, 0), 51);
4595        assert_eq!(none_count(&pairs, 0), 0);
4596        assert_eq!(some_count(&pairs, 1), 50);
4597        assert_eq!(none_count(&pairs, 1), 1);
4598        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
4599        assert_eq!(some_count(&pairs, 0), 51);
4600        assert_eq!(none_count(&pairs, 0), 2183);
4601        assert_eq!(some_count(&pairs, 1), 2234);
4602        assert_eq!(none_count(&pairs, 1), 0);
4603        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
4604        assert_eq!(some_count(&pairs, 0), 51);
4605        assert_eq!(none_count(&pairs, 0), 2183);
4606        assert_eq!(some_count(&pairs, 1), 2234);
4607        assert_eq!(none_count(&pairs, 1), 0);
4608        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
4609        assert_eq!(some_count(&pairs, 0), 51);
4610        assert_eq!(none_count(&pairs, 0), 2183);
4611        assert_eq!(some_count(&pairs, 1), 2234);
4612        assert_eq!(none_count(&pairs, 1), 0);
4613        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
4614        assert_eq!(some_count(&pairs, 0), 51);
4615        assert_eq!(none_count(&pairs, 0), 0);
4616        assert_eq!(some_count(&pairs, 1), 33);
4617        assert_eq!(none_count(&pairs, 1), 18);
4618        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
4619        assert_eq!(some_count(&pairs, 0), 51);
4620        assert_eq!(none_count(&pairs, 0), 0);
4621        assert_eq!(some_count(&pairs, 1), 48);
4622        assert_eq!(none_count(&pairs, 1), 3);
4623        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
4624        assert_eq!(some_count(&pairs, 0), 51);
4625        assert_eq!(none_count(&pairs, 0), 0);
4626        assert_eq!(some_count(&pairs, 1), 45);
4627        assert_eq!(none_count(&pairs, 1), 6);
4628        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
4629        assert_eq!(some_count(&pairs, 0), 51);
4630        assert_eq!(none_count(&pairs, 0), 11832);
4631        assert_eq!(some_count(&pairs, 1), 11883);
4632        assert_eq!(none_count(&pairs, 1), 0);
4633        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
4634        assert_eq!(some_count(&pairs, 0), 51);
4635        assert_eq!(none_count(&pairs, 0), 12542);
4636        assert_eq!(some_count(&pairs, 1), 12593);
4637        assert_eq!(none_count(&pairs, 1), 0);
4638        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
4639        assert_eq!(some_count(&pairs, 0), 51);
4640        assert_eq!(none_count(&pairs, 0), 12542);
4641        assert_eq!(some_count(&pairs, 1), 12593);
4642        assert_eq!(none_count(&pairs, 1), 0);
4643        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
4644        assert_eq!(some_count(&pairs, 0), 51);
4645        assert_eq!(none_count(&pairs, 0), 12542);
4646        assert_eq!(some_count(&pairs, 1), 12593);
4647        assert_eq!(none_count(&pairs, 1), 0);
4648        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
4649        assert_eq!(some_count(&pairs, 0), 51);
4650        assert_eq!(none_count(&pairs, 0), 12542);
4651        assert_eq!(some_count(&pairs, 1), 12593);
4652        assert_eq!(none_count(&pairs, 1), 0);
4653        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
4654        assert_eq!(some_count(&pairs, 0), 51);
4655        assert_eq!(none_count(&pairs, 0), 12542);
4656        assert_eq!(some_count(&pairs, 1), 12593);
4657        assert_eq!(none_count(&pairs, 1), 0);
4658        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
4659        assert_eq!(some_count(&pairs, 0), 51);
4660        assert_eq!(none_count(&pairs, 0), 12542);
4661        assert_eq!(some_count(&pairs, 1), 12593);
4662        assert_eq!(none_count(&pairs, 1), 0);
4663        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
4664        assert_eq!(some_count(&pairs, 0), 51);
4665        assert_eq!(none_count(&pairs, 0), 12542);
4666        assert_eq!(some_count(&pairs, 1), 12593);
4667        assert_eq!(none_count(&pairs, 1), 0);
4668        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
4669        assert_eq!(some_count(&pairs, 0), 51);
4670        assert_eq!(none_count(&pairs, 0), 12542);
4671        assert_eq!(some_count(&pairs, 1), 12593);
4672        assert_eq!(none_count(&pairs, 1), 0);
4673        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
4674        assert_eq!(some_count(&pairs, 0), 51);
4675        assert_eq!(none_count(&pairs, 0), 1467);
4676        assert_eq!(some_count(&pairs, 1), 1517);
4677        assert_eq!(none_count(&pairs, 1), 1);
4678        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
4679        assert_eq!(some_count(&pairs, 0), 51);
4680        assert_eq!(none_count(&pairs, 0), 1609);
4681        assert_eq!(some_count(&pairs, 1), 1660);
4682        assert_eq!(none_count(&pairs, 1), 0);
4683        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
4684        assert_eq!(some_count(&pairs, 0), 51);
4685        assert_eq!(none_count(&pairs, 0), 1609);
4686        assert_eq!(some_count(&pairs, 1), 1660);
4687        assert_eq!(none_count(&pairs, 1), 0);
4688        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
4689        assert_eq!(some_count(&pairs, 0), 51);
4690        assert_eq!(none_count(&pairs, 0), 1609);
4691        assert_eq!(some_count(&pairs, 1), 1660);
4692        assert_eq!(none_count(&pairs, 1), 0);
4693        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
4694        assert_eq!(some_count(&pairs, 0), 51);
4695        assert_eq!(none_count(&pairs, 0), 95);
4696        assert_eq!(some_count(&pairs, 1), 145);
4697        assert_eq!(none_count(&pairs, 1), 1);
4698        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
4699        assert_eq!(some_count(&pairs, 0), 51);
4700        assert_eq!(none_count(&pairs, 0), 538);
4701        assert_eq!(some_count(&pairs, 1), 588);
4702        assert_eq!(none_count(&pairs, 1), 1);
4703        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
4704        assert_eq!(some_count(&pairs, 0), 51);
4705        assert_eq!(none_count(&pairs, 0), 538);
4706        assert_eq!(some_count(&pairs, 1), 588);
4707        assert_eq!(none_count(&pairs, 1), 1);
4708        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
4709        assert_eq!(some_count(&pairs, 0), 51);
4710        assert_eq!(none_count(&pairs, 0), 538);
4711        assert_eq!(some_count(&pairs, 1), 588);
4712        assert_eq!(none_count(&pairs, 1), 1);
4713        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
4714        assert_eq!(some_count(&pairs, 0), 51);
4715        assert_eq!(none_count(&pairs, 0), 1);
4716        assert_eq!(some_count(&pairs, 1), 51);
4717        assert_eq!(none_count(&pairs, 1), 1);
4718        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
4719        assert_eq!(some_count(&pairs, 0), 51);
4720        assert_eq!(none_count(&pairs, 0), 1);
4721        assert_eq!(some_count(&pairs, 1), 49);
4722        assert_eq!(none_count(&pairs, 1), 3);
4723        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
4724        assert_eq!(some_count(&pairs, 0), 51);
4725        assert_eq!(none_count(&pairs, 0), 1);
4726        assert_eq!(some_count(&pairs, 1), 45);
4727        assert_eq!(none_count(&pairs, 1), 7);
4728        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
4729        assert_eq!(some_count(&pairs, 0), 51);
4730        assert_eq!(none_count(&pairs, 0), 0);
4731        assert_eq!(some_count(&pairs, 1), 39);
4732        assert_eq!(none_count(&pairs, 1), 12);
4733        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
4734        assert_eq!(some_count(&pairs, 0), 51);
4735        assert_eq!(none_count(&pairs, 0), 1892);
4736        assert_eq!(some_count(&pairs, 1), 1938);
4737        assert_eq!(none_count(&pairs, 1), 5);
4738        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
4739        assert_eq!(some_count(&pairs, 0), 51);
4740        assert_eq!(none_count(&pairs, 0), 1892);
4741        assert_eq!(some_count(&pairs, 1), 1941);
4742        assert_eq!(none_count(&pairs, 1), 2);
4743        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
4744        assert_eq!(some_count(&pairs, 0), 51);
4745        assert_eq!(none_count(&pairs, 0), 2288);
4746        assert_eq!(some_count(&pairs, 1), 2338);
4747        assert_eq!(none_count(&pairs, 1), 1);
4748        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
4749        assert_eq!(some_count(&pairs, 0), 51);
4750        assert_eq!(none_count(&pairs, 0), 14680);
4751        assert_eq!(some_count(&pairs, 1), 14729);
4752        assert_eq!(none_count(&pairs, 1), 2);
4753        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
4754        assert_eq!(some_count(&pairs, 0), 51);
4755        assert_eq!(none_count(&pairs, 0), 4027);
4756        assert_eq!(some_count(&pairs, 1), 4074);
4757        assert_eq!(none_count(&pairs, 1), 4);
4758    }
4759
4760    #[test]
4761    fn test_aligned_block_pairs() {
4762        let mut bam = bam::Reader::from_path("./test/test_spliced_reads.bam").unwrap();
4763        let mut it = bam.records();
4764
4765        let read = it.next().unwrap().unwrap();
4766        let pairs: Vec<_> = read.aligned_pairs().collect();
4767        let block_pairs: Vec<_> = read.aligned_block_pairs().collect();
4768
4769        //first coordinates identical
4770        assert_eq!(pairs[0][0], block_pairs[0].0[0]); //read
4771        assert_eq!(pairs[0][1], block_pairs[0].1[0]); // genomic
4772
4773        //end coordinates are + 1, so the ranges are the same...
4774        assert_eq!(
4775            pairs[pairs.len() - 1][0],
4776            block_pairs[block_pairs.len() - 1].0[1] - 1
4777        );
4778        assert_eq!(
4779            pairs[pairs.len() - 1][1],
4780            block_pairs[block_pairs.len() - 1].1[1] - 1
4781        );
4782
4783        //let's see if they're really identical
4784        for read in it {
4785            let read = read.unwrap();
4786            let pairs: Vec<_> = read.aligned_pairs().collect();
4787            let block_pairs: Vec<_> = read.aligned_block_pairs().collect();
4788            let mut ii = 0;
4789            for ([read_start, read_stop], [genome_start, genome_stop]) in block_pairs {
4790                assert_eq!(read_stop - read_start, genome_stop - genome_start);
4791                for (read_pos, genome_pos) in (read_start..read_stop).zip(genome_start..genome_stop)
4792                {
4793                    assert_eq!(pairs[ii][0], read_pos);
4794                    assert_eq!(pairs[ii][1], genome_pos);
4795                    ii += 1;
4796                }
4797            }
4798        }
4799    }
4800
4801    #[test]
4802    fn test_get_cigar_stats() {
4803        let mut bam = bam::Reader::from_path("./test/test_spliced_reads.bam").unwrap();
4804        let mut it = bam.records();
4805
4806        fn to_arr(hm: HashMap<Cigar, i32>) -> [i32; 9] {
4807            [
4808                *hm.get(&Cigar::Match(0)).unwrap(),
4809                *hm.get(&Cigar::Ins(0)).unwrap(),
4810                *hm.get(&Cigar::Del(0)).unwrap(),
4811                *hm.get(&Cigar::RefSkip(0)).unwrap(),
4812                *hm.get(&Cigar::SoftClip(0)).unwrap(),
4813                *hm.get(&Cigar::HardClip(0)).unwrap(),
4814                *hm.get(&Cigar::Pad(0)).unwrap(),
4815                *hm.get(&Cigar::Equal(0)).unwrap(),
4816                *hm.get(&Cigar::Diff(0)).unwrap(),
4817            ]
4818        }
4819
4820        let read = it.next().unwrap().unwrap();
4821        let cigar_nucleotides = read.cigar_stats_nucleotides();
4822        assert_eq!(to_arr(cigar_nucleotides), [45, 0, 0, 0, 6, 0, 0, 0, 0]);
4823        let cigar_blocks = read.cigar_stats_blocks();
4824        assert_eq!(to_arr(cigar_blocks), [1, 0, 0, 0, 1, 0, 0, 0, 0]);
4825        let read = it.next().unwrap().unwrap();
4826        let cigar_nucleotides = read.cigar_stats_nucleotides();
4827        assert_eq!(to_arr(cigar_nucleotides), [51, 0, 2, 0, 0, 0, 0, 0, 0]);
4828        let cigar_blocks = read.cigar_stats_blocks();
4829        assert_eq!(to_arr(cigar_blocks), [2, 0, 1, 0, 0, 0, 0, 0, 0]);
4830        let read = it.next().unwrap().unwrap();
4831        let cigar_nucleotides = read.cigar_stats_nucleotides();
4832        assert_eq!(to_arr(cigar_nucleotides), [51, 0, 2, 0, 0, 0, 0, 0, 0]);
4833        let cigar_blocks = read.cigar_stats_blocks();
4834        assert_eq!(to_arr(cigar_blocks), [2, 0, 1, 0, 0, 0, 0, 0, 0]);
4835        let read = it.next().unwrap().unwrap();
4836        let cigar_nucleotides = read.cigar_stats_nucleotides();
4837        assert_eq!(to_arr(cigar_nucleotides), [51, 0, 0, 0, 0, 0, 0, 0, 0]);
4838        let cigar_blocks = read.cigar_stats_blocks();
4839        assert_eq!(to_arr(cigar_blocks), [1, 0, 0, 0, 0, 0, 0, 0, 0]);
4840        let read = it.next().unwrap().unwrap();
4841        let cigar_nucleotides = read.cigar_stats_nucleotides();
4842        assert_eq!(to_arr(cigar_nucleotides), [51, 0, 0, 0, 0, 0, 0, 0, 0]);
4843        let cigar_blocks = read.cigar_stats_blocks();
4844        assert_eq!(to_arr(cigar_blocks), [1, 0, 0, 0, 0, 0, 0, 0, 0]);
4845        let read = it.next().unwrap().unwrap();
4846        let cigar_nucleotides = read.cigar_stats_nucleotides();
4847        assert_eq!(to_arr(cigar_nucleotides), [51, 0, 0, 0, 0, 0, 0, 0, 0]);
4848        let cigar_blocks = read.cigar_stats_blocks();
4849        assert_eq!(to_arr(cigar_blocks), [1, 0, 0, 0, 0, 0, 0, 0, 0]);
4850        let read = it.next().unwrap().unwrap();
4851        let cigar_nucleotides = read.cigar_stats_nucleotides();
4852        assert_eq!(to_arr(cigar_nucleotides), [51, 0, 0, 0, 0, 0, 0, 0, 0]);
4853        let cigar_blocks = read.cigar_stats_blocks();
4854        assert_eq!(to_arr(cigar_blocks), [1, 0, 0, 0, 0, 0, 0, 0, 0]);
4855        let read = it.next().unwrap().unwrap();
4856        let cigar_nucleotides = read.cigar_stats_nucleotides();
4857        assert_eq!(to_arr(cigar_nucleotides), [51, 0, 0, 0, 0, 0, 0, 0, 0]);
4858        let cigar_blocks = read.cigar_stats_blocks();
4859        assert_eq!(to_arr(cigar_blocks), [1, 0, 0, 0, 0, 0, 0, 0, 0]);
4860        let read = it.next().unwrap().unwrap();
4861        let cigar_nucleotides = read.cigar_stats_nucleotides();
4862        assert_eq!(to_arr(cigar_nucleotides), [51, 0, 0, 0, 0, 0, 0, 0, 0]);
4863        let cigar_blocks = read.cigar_stats_blocks();
4864        assert_eq!(to_arr(cigar_blocks), [1, 0, 0, 0, 0, 0, 0, 0, 0]);
4865        let read = it.next().unwrap().unwrap();
4866        let cigar_nucleotides = read.cigar_stats_nucleotides();
4867        assert_eq!(to_arr(cigar_nucleotides), [45, 0, 0, 0, 6, 0, 0, 0, 0]);
4868        let cigar_blocks = read.cigar_stats_blocks();
4869        assert_eq!(to_arr(cigar_blocks), [1, 0, 0, 0, 1, 0, 0, 0, 0]);
4870        let read = it.next().unwrap().unwrap();
4871        let cigar_nucleotides = read.cigar_stats_nucleotides();
4872        assert_eq!(to_arr(cigar_nucleotides), [41, 0, 0, 0, 10, 0, 0, 0, 0]);
4873        let cigar_blocks = read.cigar_stats_blocks();
4874        assert_eq!(to_arr(cigar_blocks), [1, 0, 0, 0, 1, 0, 0, 0, 0]);
4875        let read = it.next().unwrap().unwrap();
4876        let cigar_nucleotides = read.cigar_stats_nucleotides();
4877        assert_eq!(to_arr(cigar_nucleotides), [51, 0, 0, 0, 0, 0, 0, 0, 0]);
4878        let cigar_blocks = read.cigar_stats_blocks();
4879        assert_eq!(to_arr(cigar_blocks), [1, 0, 0, 0, 0, 0, 0, 0, 0]);
4880        let read = it.next().unwrap().unwrap();
4881        let cigar_nucleotides = read.cigar_stats_nucleotides();
4882        assert_eq!(to_arr(cigar_nucleotides), [51, 0, 0, 0, 0, 0, 0, 0, 0]);
4883        let cigar_blocks = read.cigar_stats_blocks();
4884        assert_eq!(to_arr(cigar_blocks), [1, 0, 0, 0, 0, 0, 0, 0, 0]);
4885        let read = it.next().unwrap().unwrap();
4886        let cigar_nucleotides = read.cigar_stats_nucleotides();
4887        assert_eq!(to_arr(cigar_nucleotides), [51, 0, 0, 0, 0, 0, 0, 0, 0]);
4888        let cigar_blocks = read.cigar_stats_blocks();
4889        assert_eq!(to_arr(cigar_blocks), [1, 0, 0, 0, 0, 0, 0, 0, 0]);
4890        let read = it.next().unwrap().unwrap();
4891        let cigar_nucleotides = read.cigar_stats_nucleotides();
4892        assert_eq!(to_arr(cigar_nucleotides), [51, 0, 0, 0, 0, 0, 0, 0, 0]);
4893        let cigar_blocks = read.cigar_stats_blocks();
4894        assert_eq!(to_arr(cigar_blocks), [1, 0, 0, 0, 0, 0, 0, 0, 0]);
4895        let read = it.next().unwrap().unwrap();
4896        let cigar_nucleotides = read.cigar_stats_nucleotides();
4897        assert_eq!(to_arr(cigar_nucleotides), [42, 0, 0, 0, 9, 0, 0, 0, 0]);
4898        let cigar_blocks = read.cigar_stats_blocks();
4899        assert_eq!(to_arr(cigar_blocks), [1, 0, 0, 0, 1, 0, 0, 0, 0]);
4900        let read = it.next().unwrap().unwrap();
4901        let cigar_nucleotides = read.cigar_stats_nucleotides();
4902        assert_eq!(to_arr(cigar_nucleotides), [51, 0, 0, 0, 0, 0, 0, 0, 0]);
4903        let cigar_blocks = read.cigar_stats_blocks();
4904        assert_eq!(to_arr(cigar_blocks), [1, 0, 0, 0, 0, 0, 0, 0, 0]);
4905        let read = it.next().unwrap().unwrap();
4906        let cigar_nucleotides = read.cigar_stats_nucleotides();
4907        assert_eq!(to_arr(cigar_nucleotides), [50, 0, 0, 0, 1, 0, 0, 0, 0]);
4908        let cigar_blocks = read.cigar_stats_blocks();
4909        assert_eq!(to_arr(cigar_blocks), [1, 0, 0, 0, 1, 0, 0, 0, 0]);
4910        let read = it.next().unwrap().unwrap();
4911        let cigar_nucleotides = read.cigar_stats_nucleotides();
4912        assert_eq!(to_arr(cigar_nucleotides), [45, 0, 0, 0, 6, 0, 0, 0, 0]);
4913        let cigar_blocks = read.cigar_stats_blocks();
4914        assert_eq!(to_arr(cigar_blocks), [1, 0, 0, 0, 1, 0, 0, 0, 0]);
4915        let read = it.next().unwrap().unwrap();
4916        let cigar_nucleotides = read.cigar_stats_nucleotides();
4917        assert_eq!(to_arr(cigar_nucleotides), [48, 0, 0, 0, 3, 0, 0, 0, 0]);
4918        let cigar_blocks = read.cigar_stats_blocks();
4919        assert_eq!(to_arr(cigar_blocks), [1, 0, 0, 0, 1, 0, 0, 0, 0]);
4920        let read = it.next().unwrap().unwrap();
4921        let cigar_nucleotides = read.cigar_stats_nucleotides();
4922        assert_eq!(to_arr(cigar_nucleotides), [42, 0, 0, 0, 9, 0, 0, 0, 0]);
4923        let cigar_blocks = read.cigar_stats_blocks();
4924        assert_eq!(to_arr(cigar_blocks), [1, 0, 0, 0, 1, 0, 0, 0, 0]);
4925        let read = it.next().unwrap().unwrap();
4926        let cigar_nucleotides = read.cigar_stats_nucleotides();
4927        assert_eq!(to_arr(cigar_nucleotides), [38, 0, 0, 0, 13, 0, 0, 0, 0]);
4928        let cigar_blocks = read.cigar_stats_blocks();
4929        assert_eq!(to_arr(cigar_blocks), [1, 0, 0, 0, 1, 0, 0, 0, 0]);
4930        let read = it.next().unwrap().unwrap();
4931        let cigar_nucleotides = read.cigar_stats_nucleotides();
4932        assert_eq!(to_arr(cigar_nucleotides), [44, 0, 0, 0, 7, 0, 0, 0, 0]);
4933        let cigar_blocks = read.cigar_stats_blocks();
4934        assert_eq!(to_arr(cigar_blocks), [1, 0, 0, 0, 1, 0, 0, 0, 0]);
4935        let read = it.next().unwrap().unwrap();
4936        let cigar_nucleotides = read.cigar_stats_nucleotides();
4937        assert_eq!(to_arr(cigar_nucleotides), [46, 0, 0, 0, 5, 0, 0, 0, 0]);
4938        let cigar_blocks = read.cigar_stats_blocks();
4939        assert_eq!(to_arr(cigar_blocks), [1, 0, 0, 0, 1, 0, 0, 0, 0]);
4940        let read = it.next().unwrap().unwrap();
4941        let cigar_nucleotides = read.cigar_stats_nucleotides();
4942        assert_eq!(to_arr(cigar_nucleotides), [47, 4, 0, 0, 0, 0, 0, 0, 0]);
4943        let cigar_blocks = read.cigar_stats_blocks();
4944        assert_eq!(to_arr(cigar_blocks), [2, 1, 0, 0, 0, 0, 0, 0, 0]);
4945        let read = it.next().unwrap().unwrap();
4946        let cigar_nucleotides = read.cigar_stats_nucleotides();
4947        assert_eq!(to_arr(cigar_nucleotides), [50, 1, 0, 0, 0, 0, 0, 0, 0]);
4948        let cigar_blocks = read.cigar_stats_blocks();
4949        assert_eq!(to_arr(cigar_blocks), [2, 1, 0, 0, 0, 0, 0, 0, 0]);
4950        let read = it.next().unwrap().unwrap();
4951        let cigar_nucleotides = read.cigar_stats_nucleotides();
4952        assert_eq!(to_arr(cigar_nucleotides), [51, 0, 0, 2183, 0, 0, 0, 0, 0]);
4953        let cigar_blocks = read.cigar_stats_blocks();
4954        assert_eq!(to_arr(cigar_blocks), [2, 0, 0, 1, 0, 0, 0, 0, 0]);
4955        let read = it.next().unwrap().unwrap();
4956        let cigar_nucleotides = read.cigar_stats_nucleotides();
4957        assert_eq!(to_arr(cigar_nucleotides), [51, 0, 0, 2183, 0, 0, 0, 0, 0]);
4958        let cigar_blocks = read.cigar_stats_blocks();
4959        assert_eq!(to_arr(cigar_blocks), [2, 0, 0, 1, 0, 0, 0, 0, 0]);
4960        let read = it.next().unwrap().unwrap();
4961        let cigar_nucleotides = read.cigar_stats_nucleotides();
4962        assert_eq!(to_arr(cigar_nucleotides), [51, 0, 0, 2183, 0, 0, 0, 0, 0]);
4963        let cigar_blocks = read.cigar_stats_blocks();
4964        assert_eq!(to_arr(cigar_blocks), [2, 0, 0, 1, 0, 0, 0, 0, 0]);
4965        let read = it.next().unwrap().unwrap();
4966        let cigar_nucleotides = read.cigar_stats_nucleotides();
4967        assert_eq!(to_arr(cigar_nucleotides), [33, 0, 0, 0, 18, 0, 0, 0, 0]);
4968        let cigar_blocks = read.cigar_stats_blocks();
4969        assert_eq!(to_arr(cigar_blocks), [1, 0, 0, 0, 2, 0, 0, 0, 0]);
4970        let read = it.next().unwrap().unwrap();
4971        let cigar_nucleotides = read.cigar_stats_nucleotides();
4972        assert_eq!(to_arr(cigar_nucleotides), [48, 0, 0, 0, 3, 0, 0, 0, 0]);
4973        let cigar_blocks = read.cigar_stats_blocks();
4974        assert_eq!(to_arr(cigar_blocks), [1, 0, 0, 0, 2, 0, 0, 0, 0]);
4975        let read = it.next().unwrap().unwrap();
4976        let cigar_nucleotides = read.cigar_stats_nucleotides();
4977        assert_eq!(to_arr(cigar_nucleotides), [45, 0, 0, 0, 6, 0, 0, 0, 0]);
4978        let cigar_blocks = read.cigar_stats_blocks();
4979        assert_eq!(to_arr(cigar_blocks), [1, 0, 0, 0, 2, 0, 0, 0, 0]);
4980        let read = it.next().unwrap().unwrap();
4981        let cigar_nucleotides = read.cigar_stats_nucleotides();
4982        assert_eq!(to_arr(cigar_nucleotides), [51, 0, 0, 11832, 0, 0, 0, 0, 0]);
4983        let cigar_blocks = read.cigar_stats_blocks();
4984        assert_eq!(to_arr(cigar_blocks), [2, 0, 0, 1, 0, 0, 0, 0, 0]);
4985        let read = it.next().unwrap().unwrap();
4986        let cigar_nucleotides = read.cigar_stats_nucleotides();
4987        assert_eq!(to_arr(cigar_nucleotides), [51, 0, 0, 12542, 0, 0, 0, 0, 0],);
4988        let cigar_blocks = read.cigar_stats_blocks();
4989        assert_eq!(to_arr(cigar_blocks), [3, 0, 0, 2, 0, 0, 0, 0, 0]);
4990        let read = it.next().unwrap().unwrap();
4991        let cigar_nucleotides = read.cigar_stats_nucleotides();
4992        assert_eq!(to_arr(cigar_nucleotides), [51, 0, 0, 12542, 0, 0, 0, 0, 0],);
4993        let cigar_blocks = read.cigar_stats_blocks();
4994        assert_eq!(to_arr(cigar_blocks), [3, 0, 0, 2, 0, 0, 0, 0, 0]);
4995        let read = it.next().unwrap().unwrap();
4996        let cigar_nucleotides = read.cigar_stats_nucleotides();
4997        assert_eq!(to_arr(cigar_nucleotides), [51, 0, 0, 12542, 0, 0, 0, 0, 0],);
4998        let cigar_blocks = read.cigar_stats_blocks();
4999        assert_eq!(to_arr(cigar_blocks), [3, 0, 0, 2, 0, 0, 0, 0, 0]);
5000        let read = it.next().unwrap().unwrap();
5001        let cigar_nucleotides = read.cigar_stats_nucleotides();
5002        assert_eq!(to_arr(cigar_nucleotides), [51, 0, 0, 12542, 0, 0, 0, 0, 0],);
5003        let cigar_blocks = read.cigar_stats_blocks();
5004        assert_eq!(to_arr(cigar_blocks), [3, 0, 0, 2, 0, 0, 0, 0, 0]);
5005        let read = it.next().unwrap().unwrap();
5006        let cigar_nucleotides = read.cigar_stats_nucleotides();
5007        assert_eq!(to_arr(cigar_nucleotides), [51, 0, 0, 12542, 0, 0, 0, 0, 0],);
5008        let cigar_blocks = read.cigar_stats_blocks();
5009        assert_eq!(to_arr(cigar_blocks), [3, 0, 0, 2, 0, 0, 0, 0, 0]);
5010        let read = it.next().unwrap().unwrap();
5011        let cigar_nucleotides = read.cigar_stats_nucleotides();
5012        assert_eq!(to_arr(cigar_nucleotides), [51, 0, 0, 12542, 0, 0, 0, 0, 0],);
5013        let cigar_blocks = read.cigar_stats_blocks();
5014        assert_eq!(to_arr(cigar_blocks), [3, 0, 0, 2, 0, 0, 0, 0, 0]);
5015        let read = it.next().unwrap().unwrap();
5016        let cigar_nucleotides = read.cigar_stats_nucleotides();
5017        assert_eq!(to_arr(cigar_nucleotides), [51, 0, 0, 12542, 0, 0, 0, 0, 0],);
5018        let cigar_blocks = read.cigar_stats_blocks();
5019        assert_eq!(to_arr(cigar_blocks), [3, 0, 0, 2, 0, 0, 0, 0, 0]);
5020        let read = it.next().unwrap().unwrap();
5021        let cigar_nucleotides = read.cigar_stats_nucleotides();
5022        assert_eq!(to_arr(cigar_nucleotides), [51, 0, 0, 12542, 0, 0, 0, 0, 0],);
5023        let cigar_blocks = read.cigar_stats_blocks();
5024        assert_eq!(to_arr(cigar_blocks), [3, 0, 0, 2, 0, 0, 0, 0, 0]);
5025        let read = it.next().unwrap().unwrap();
5026        let cigar_nucleotides = read.cigar_stats_nucleotides();
5027        assert_eq!(to_arr(cigar_nucleotides), [50, 0, 0, 1467, 1, 0, 0, 0, 0]);
5028        let cigar_blocks = read.cigar_stats_blocks();
5029        assert_eq!(to_arr(cigar_blocks), [2, 0, 0, 1, 1, 0, 0, 0, 0]);
5030        let read = it.next().unwrap().unwrap();
5031        let cigar_nucleotides = read.cigar_stats_nucleotides();
5032        assert_eq!(to_arr(cigar_nucleotides), [51, 0, 0, 1609, 0, 0, 0, 0, 0]);
5033        let cigar_blocks = read.cigar_stats_blocks();
5034        assert_eq!(to_arr(cigar_blocks), [3, 0, 0, 2, 0, 0, 0, 0, 0]);
5035        let read = it.next().unwrap().unwrap();
5036        let cigar_nucleotides = read.cigar_stats_nucleotides();
5037        assert_eq!(to_arr(cigar_nucleotides), [51, 0, 0, 1609, 0, 0, 0, 0, 0]);
5038        let cigar_blocks = read.cigar_stats_blocks();
5039        assert_eq!(to_arr(cigar_blocks), [3, 0, 0, 2, 0, 0, 0, 0, 0]);
5040        let read = it.next().unwrap().unwrap();
5041        let cigar_nucleotides = read.cigar_stats_nucleotides();
5042        assert_eq!(to_arr(cigar_nucleotides), [51, 0, 0, 1609, 0, 0, 0, 0, 0]);
5043        let cigar_blocks = read.cigar_stats_blocks();
5044        assert_eq!(to_arr(cigar_blocks), [3, 0, 0, 2, 0, 0, 0, 0, 0]);
5045        let read = it.next().unwrap().unwrap();
5046        let cigar_nucleotides = read.cigar_stats_nucleotides();
5047        assert_eq!(to_arr(cigar_nucleotides), [50, 0, 0, 95, 1, 0, 0, 0, 0]);
5048        let cigar_blocks = read.cigar_stats_blocks();
5049        assert_eq!(to_arr(cigar_blocks), [2, 0, 0, 1, 1, 0, 0, 0, 0]);
5050        let read = it.next().unwrap().unwrap();
5051        let cigar_nucleotides = read.cigar_stats_nucleotides();
5052        assert_eq!(to_arr(cigar_nucleotides), [50, 0, 0, 538, 1, 0, 0, 0, 0]);
5053        let cigar_blocks = read.cigar_stats_blocks();
5054        assert_eq!(to_arr(cigar_blocks), [2, 0, 0, 1, 1, 0, 0, 0, 0]);
5055        let read = it.next().unwrap().unwrap();
5056        let cigar_nucleotides = read.cigar_stats_nucleotides();
5057        assert_eq!(to_arr(cigar_nucleotides), [50, 0, 0, 538, 1, 0, 0, 0, 0]);
5058        let cigar_blocks = read.cigar_stats_blocks();
5059        assert_eq!(to_arr(cigar_blocks), [2, 0, 0, 1, 1, 0, 0, 0, 0]);
5060        let read = it.next().unwrap().unwrap();
5061        let cigar_nucleotides = read.cigar_stats_nucleotides();
5062        assert_eq!(to_arr(cigar_nucleotides), [50, 0, 0, 538, 1, 0, 0, 0, 0]);
5063        let cigar_blocks = read.cigar_stats_blocks();
5064        assert_eq!(to_arr(cigar_blocks), [2, 0, 0, 1, 1, 0, 0, 0, 0]);
5065        let read = it.next().unwrap().unwrap();
5066        let cigar_nucleotides = read.cigar_stats_nucleotides();
5067        assert_eq!(to_arr(cigar_nucleotides), [50, 0, 1, 0, 1, 0, 0, 0, 0]);
5068        let cigar_blocks = read.cigar_stats_blocks();
5069        assert_eq!(to_arr(cigar_blocks), [2, 0, 1, 0, 1, 0, 0, 0, 0]);
5070        let read = it.next().unwrap().unwrap();
5071        let cigar_nucleotides = read.cigar_stats_nucleotides();
5072        assert_eq!(to_arr(cigar_nucleotides), [48, 0, 1, 0, 3, 0, 0, 0, 0]);
5073        let cigar_blocks = read.cigar_stats_blocks();
5074        assert_eq!(to_arr(cigar_blocks), [2, 0, 1, 0, 1, 0, 0, 0, 0]);
5075        let read = it.next().unwrap().unwrap();
5076        let cigar_nucleotides = read.cigar_stats_nucleotides();
5077        assert_eq!(to_arr(cigar_nucleotides), [44, 0, 1, 0, 7, 0, 0, 0, 0]);
5078        let cigar_blocks = read.cigar_stats_blocks();
5079        assert_eq!(to_arr(cigar_blocks), [2, 0, 1, 0, 1, 0, 0, 0, 0]);
5080        let read = it.next().unwrap().unwrap();
5081        let cigar_nucleotides = read.cigar_stats_nucleotides();
5082        assert_eq!(to_arr(cigar_nucleotides), [39, 1, 0, 0, 11, 0, 0, 0, 0]);
5083        let cigar_blocks = read.cigar_stats_blocks();
5084        assert_eq!(to_arr(cigar_blocks), [2, 1, 0, 0, 1, 0, 0, 0, 0]);
5085        let read = it.next().unwrap().unwrap();
5086        let cigar_nucleotides = read.cigar_stats_nucleotides();
5087        assert_eq!(to_arr(cigar_nucleotides), [46, 0, 0, 1892, 5, 0, 0, 0, 0]);
5088        let cigar_blocks = read.cigar_stats_blocks();
5089        assert_eq!(to_arr(cigar_blocks), [2, 0, 0, 1, 1, 0, 0, 0, 0]);
5090        let read = it.next().unwrap().unwrap();
5091        let cigar_nucleotides = read.cigar_stats_nucleotides();
5092        assert_eq!(to_arr(cigar_nucleotides), [49, 0, 0, 1892, 2, 0, 0, 0, 0]);
5093        let cigar_blocks = read.cigar_stats_blocks();
5094        assert_eq!(to_arr(cigar_blocks), [2, 0, 0, 1, 1, 0, 0, 0, 0]);
5095        let read = it.next().unwrap().unwrap();
5096        let cigar_nucleotides = read.cigar_stats_nucleotides();
5097        assert_eq!(to_arr(cigar_nucleotides), [50, 0, 3, 2285, 1, 0, 0, 0, 0]);
5098        let cigar_blocks = read.cigar_stats_blocks();
5099        assert_eq!(to_arr(cigar_blocks), [3, 0, 1, 1, 1, 0, 0, 0, 0]);
5100        let read = it.next().unwrap().unwrap();
5101        let cigar_nucleotides = read.cigar_stats_nucleotides();
5102        assert_eq!(to_arr(cigar_nucleotides), [49, 0, 0, 14680, 2, 0, 0, 0, 0],);
5103        let cigar_blocks = read.cigar_stats_blocks();
5104        assert_eq!(to_arr(cigar_blocks), [3, 0, 0, 2, 1, 0, 0, 0, 0]);
5105        let read = it.next().unwrap().unwrap();
5106        let cigar_nucleotides = read.cigar_stats_nucleotides();
5107        assert_eq!(to_arr(cigar_nucleotides), [47, 0, 0, 4027, 4, 0, 0, 0, 0]);
5108        let cigar_blocks = read.cigar_stats_blocks();
5109        assert_eq!(to_arr(cigar_blocks), [3, 0, 0, 2, 1, 0, 0, 0, 0]);
5110    }
5111
5112    #[test]
5113    fn test_reference_positions() {
5114        let mut bam = bam::Reader::from_path("./test/test_spliced_reads.bam").unwrap();
5115        let mut it = bam.records();
5116
5117        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();
5118        assert_eq!(
5119            rp,
5120            vec![
5121                16050676, 16050677, 16050678, 16050679, 16050680, 16050681, 16050682, 16050683,
5122                16050684, 16050685, 16050686, 16050687, 16050688, 16050689, 16050690, 16050691,
5123                16050692, 16050693, 16050694, 16050695, 16050696, 16050697, 16050698, 16050699,
5124                16050700, 16050701, 16050702, 16050703, 16050704, 16050705, 16050706, 16050707,
5125                16050708, 16050709, 16050710, 16050711, 16050712, 16050713, 16050714, 16050715,
5126                16050716, 16050717, 16050718, 16050719, 16050720
5127            ]
5128        );
5129        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();
5130        assert_eq!(
5131            rp,
5132            vec![
5133                16096878, 16096879, 16096880, 16096881, 16096882, 16096883, 16096884, 16096887,
5134                16096888, 16096889, 16096890, 16096891, 16096892, 16096893, 16096894, 16096895,
5135                16096896, 16096897, 16096898, 16096899, 16096900, 16096901, 16096902, 16096903,
5136                16096904, 16096905, 16096906, 16096907, 16096908, 16096909, 16096910, 16096911,
5137                16096912, 16096913, 16096914, 16096915, 16096916, 16096917, 16096918, 16096919,
5138                16096920, 16096921, 16096922, 16096923, 16096924, 16096925, 16096926, 16096927,
5139                16096928, 16096929, 16096930
5140            ]
5141        );
5142        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();
5143        assert_eq!(
5144            rp,
5145            vec![
5146                16097145, 16097146, 16097147, 16097148, 16097149, 16097150, 16097151, 16097152,
5147                16097153, 16097154, 16097155, 16097156, 16097157, 16097158, 16097159, 16097160,
5148                16097161, 16097162, 16097163, 16097164, 16097165, 16097166, 16097167, 16097168,
5149                16097169, 16097170, 16097171, 16097172, 16097173, 16097176, 16097177, 16097178,
5150                16097179, 16097180, 16097181, 16097182, 16097183, 16097184, 16097185, 16097186,
5151                16097187, 16097188, 16097189, 16097190, 16097191, 16097192, 16097193, 16097194,
5152                16097195, 16097196, 16097197
5153            ]
5154        );
5155        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();
5156        assert_eq!(
5157            rp,
5158            vec![
5159                16117350, 16117351, 16117352, 16117353, 16117354, 16117355, 16117356, 16117357,
5160                16117358, 16117359, 16117360, 16117361, 16117362, 16117363, 16117364, 16117365,
5161                16117366, 16117367, 16117368, 16117369, 16117370, 16117371, 16117372, 16117373,
5162                16117374, 16117375, 16117376, 16117377, 16117378, 16117379, 16117380, 16117381,
5163                16117382, 16117383, 16117384, 16117385, 16117386, 16117387, 16117388, 16117389,
5164                16117390, 16117391, 16117392, 16117393, 16117394, 16117395, 16117396, 16117397,
5165                16117398, 16117399, 16117400
5166            ]
5167        );
5168        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();
5169        assert_eq!(
5170            rp,
5171            vec![
5172                16118483, 16118484, 16118485, 16118486, 16118487, 16118488, 16118489, 16118490,
5173                16118491, 16118492, 16118493, 16118494, 16118495, 16118496, 16118497, 16118498,
5174                16118499, 16118500, 16118501, 16118502, 16118503, 16118504, 16118505, 16118506,
5175                16118507, 16118508, 16118509, 16118510, 16118511, 16118512, 16118513, 16118514,
5176                16118515, 16118516, 16118517, 16118518, 16118519, 16118520, 16118521, 16118522,
5177                16118523, 16118524, 16118525, 16118526, 16118527, 16118528, 16118529, 16118530,
5178                16118531, 16118532, 16118533
5179            ]
5180        );
5181        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();
5182        assert_eq!(
5183            rp,
5184            vec![
5185                16118499, 16118500, 16118501, 16118502, 16118503, 16118504, 16118505, 16118506,
5186                16118507, 16118508, 16118509, 16118510, 16118511, 16118512, 16118513, 16118514,
5187                16118515, 16118516, 16118517, 16118518, 16118519, 16118520, 16118521, 16118522,
5188                16118523, 16118524, 16118525, 16118526, 16118527, 16118528, 16118529, 16118530,
5189                16118531, 16118532, 16118533, 16118534, 16118535, 16118536, 16118537, 16118538,
5190                16118539, 16118540, 16118541, 16118542, 16118543, 16118544, 16118545, 16118546,
5191                16118547, 16118548, 16118549
5192            ]
5193        );
5194        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();
5195        assert_eq!(
5196            rp,
5197            vec![
5198                16118499, 16118500, 16118501, 16118502, 16118503, 16118504, 16118505, 16118506,
5199                16118507, 16118508, 16118509, 16118510, 16118511, 16118512, 16118513, 16118514,
5200                16118515, 16118516, 16118517, 16118518, 16118519, 16118520, 16118521, 16118522,
5201                16118523, 16118524, 16118525, 16118526, 16118527, 16118528, 16118529, 16118530,
5202                16118531, 16118532, 16118533, 16118534, 16118535, 16118536, 16118537, 16118538,
5203                16118539, 16118540, 16118541, 16118542, 16118543, 16118544, 16118545, 16118546,
5204                16118547, 16118548, 16118549
5205            ]
5206        );
5207        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();
5208        assert_eq!(
5209            rp,
5210            vec![
5211                16118499, 16118500, 16118501, 16118502, 16118503, 16118504, 16118505, 16118506,
5212                16118507, 16118508, 16118509, 16118510, 16118511, 16118512, 16118513, 16118514,
5213                16118515, 16118516, 16118517, 16118518, 16118519, 16118520, 16118521, 16118522,
5214                16118523, 16118524, 16118525, 16118526, 16118527, 16118528, 16118529, 16118530,
5215                16118531, 16118532, 16118533, 16118534, 16118535, 16118536, 16118537, 16118538,
5216                16118539, 16118540, 16118541, 16118542, 16118543, 16118544, 16118545, 16118546,
5217                16118547, 16118548, 16118549
5218            ]
5219        );
5220        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();
5221        assert_eq!(
5222            rp,
5223            vec![
5224                16123411, 16123412, 16123413, 16123414, 16123415, 16123416, 16123417, 16123418,
5225                16123419, 16123420, 16123421, 16123422, 16123423, 16123424, 16123425, 16123426,
5226                16123427, 16123428, 16123429, 16123430, 16123431, 16123432, 16123433, 16123434,
5227                16123435, 16123436, 16123437, 16123438, 16123439, 16123440, 16123441, 16123442,
5228                16123443, 16123444, 16123445, 16123446, 16123447, 16123448, 16123449, 16123450,
5229                16123451, 16123452, 16123453, 16123454, 16123455, 16123456, 16123457, 16123458,
5230                16123459, 16123460, 16123461
5231            ]
5232        );
5233        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();
5234        assert_eq!(
5235            rp,
5236            vec![
5237                16123417, 16123418, 16123419, 16123420, 16123421, 16123422, 16123423, 16123424,
5238                16123425, 16123426, 16123427, 16123428, 16123429, 16123430, 16123431, 16123432,
5239                16123433, 16123434, 16123435, 16123436, 16123437, 16123438, 16123439, 16123440,
5240                16123441, 16123442, 16123443, 16123444, 16123445, 16123446, 16123447, 16123448,
5241                16123449, 16123450, 16123451, 16123452, 16123453, 16123454, 16123455, 16123456,
5242                16123457, 16123458, 16123459, 16123460, 16123461
5243            ]
5244        );
5245        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();
5246        assert_eq!(
5247            rp,
5248            vec![
5249                16165860, 16165861, 16165862, 16165863, 16165864, 16165865, 16165866, 16165867,
5250                16165868, 16165869, 16165870, 16165871, 16165872, 16165873, 16165874, 16165875,
5251                16165876, 16165877, 16165878, 16165879, 16165880, 16165881, 16165882, 16165883,
5252                16165884, 16165885, 16165886, 16165887, 16165888, 16165889, 16165890, 16165891,
5253                16165892, 16165893, 16165894, 16165895, 16165896, 16165897, 16165898, 16165899,
5254                16165900
5255            ]
5256        );
5257        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();
5258        assert_eq!(
5259            rp,
5260            vec![
5261                16180871, 16180872, 16180873, 16180874, 16180875, 16180876, 16180877, 16180878,
5262                16180879, 16180880, 16180881, 16180882, 16180883, 16180884, 16180885, 16180886,
5263                16180887, 16180888, 16180889, 16180890, 16180891, 16180892, 16180893, 16180894,
5264                16180895, 16180896, 16180897, 16180898, 16180899, 16180900, 16180901, 16180902,
5265                16180903, 16180904, 16180905, 16180906, 16180907, 16180908, 16180909, 16180910,
5266                16180911, 16180912, 16180913, 16180914, 16180915, 16180916, 16180917, 16180918,
5267                16180919, 16180920, 16180921
5268            ]
5269        );
5270        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();
5271        assert_eq!(
5272            rp,
5273            vec![
5274                16189705, 16189706, 16189707, 16189708, 16189709, 16189710, 16189711, 16189712,
5275                16189713, 16189714, 16189715, 16189716, 16189717, 16189718, 16189719, 16189720,
5276                16189721, 16189722, 16189723, 16189724, 16189725, 16189726, 16189727, 16189728,
5277                16189729, 16189730, 16189731, 16189732, 16189733, 16189734, 16189735, 16189736,
5278                16189737, 16189738, 16189739, 16189740, 16189741, 16189742, 16189743, 16189744,
5279                16189745, 16189746, 16189747, 16189748, 16189749, 16189750, 16189751, 16189752,
5280                16189753, 16189754, 16189755
5281            ]
5282        );
5283        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();
5284        assert_eq!(
5285            rp,
5286            vec![
5287                16231271, 16231272, 16231273, 16231274, 16231275, 16231276, 16231277, 16231278,
5288                16231279, 16231280, 16231281, 16231282, 16231283, 16231284, 16231285, 16231286,
5289                16231287, 16231288, 16231289, 16231290, 16231291, 16231292, 16231293, 16231294,
5290                16231295, 16231296, 16231297, 16231298, 16231299, 16231300, 16231301, 16231302,
5291                16231303, 16231304, 16231305, 16231306, 16231307, 16231308, 16231309, 16231310,
5292                16231311, 16231312, 16231313, 16231314, 16231315, 16231316, 16231317, 16231318,
5293                16231319, 16231320, 16231321
5294            ]
5295        );
5296        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();
5297        assert_eq!(
5298            rp,
5299            vec![
5300                16237657, 16237658, 16237659, 16237660, 16237661, 16237662, 16237663, 16237664,
5301                16237665, 16237666, 16237667, 16237668, 16237669, 16237670, 16237671, 16237672,
5302                16237673, 16237674, 16237675, 16237676, 16237677, 16237678, 16237679, 16237680,
5303                16237681, 16237682, 16237683, 16237684, 16237685, 16237686, 16237687, 16237688,
5304                16237689, 16237690, 16237691, 16237692, 16237693, 16237694, 16237695, 16237696,
5305                16237697, 16237698, 16237699, 16237700, 16237701, 16237702, 16237703, 16237704,
5306                16237705, 16237706, 16237707
5307            ]
5308        );
5309        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();
5310        assert_eq!(
5311            rp,
5312            vec![
5313                16255012, 16255013, 16255014, 16255015, 16255016, 16255017, 16255018, 16255019,
5314                16255020, 16255021, 16255022, 16255023, 16255024, 16255025, 16255026, 16255027,
5315                16255028, 16255029, 16255030, 16255031, 16255032, 16255033, 16255034, 16255035,
5316                16255036, 16255037, 16255038, 16255039, 16255040, 16255041, 16255042, 16255043,
5317                16255044, 16255045, 16255046, 16255047, 16255048, 16255049, 16255050, 16255051,
5318                16255052, 16255053
5319            ]
5320        );
5321        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();
5322        assert_eq!(
5323            rp,
5324            vec![
5325                16255391, 16255392, 16255393, 16255394, 16255395, 16255396, 16255397, 16255398,
5326                16255399, 16255400, 16255401, 16255402, 16255403, 16255404, 16255405, 16255406,
5327                16255407, 16255408, 16255409, 16255410, 16255411, 16255412, 16255413, 16255414,
5328                16255415, 16255416, 16255417, 16255418, 16255419, 16255420, 16255421, 16255422,
5329                16255423, 16255424, 16255425, 16255426, 16255427, 16255428, 16255429, 16255430,
5330                16255431, 16255432, 16255433, 16255434, 16255435, 16255436, 16255437, 16255438,
5331                16255439, 16255440, 16255441
5332            ]
5333        );
5334        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();
5335        assert_eq!(
5336            rp,
5337            vec![
5338                16255392, 16255393, 16255394, 16255395, 16255396, 16255397, 16255398, 16255399,
5339                16255400, 16255401, 16255402, 16255403, 16255404, 16255405, 16255406, 16255407,
5340                16255408, 16255409, 16255410, 16255411, 16255412, 16255413, 16255414, 16255415,
5341                16255416, 16255417, 16255418, 16255419, 16255420, 16255421, 16255422, 16255423,
5342                16255424, 16255425, 16255426, 16255427, 16255428, 16255429, 16255430, 16255431,
5343                16255432, 16255433, 16255434, 16255435, 16255436, 16255437, 16255438, 16255439,
5344                16255440, 16255441
5345            ]
5346        );
5347        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();
5348        assert_eq!(
5349            rp,
5350            vec![
5351                16256084, 16256085, 16256086, 16256087, 16256088, 16256089, 16256090, 16256091,
5352                16256092, 16256093, 16256094, 16256095, 16256096, 16256097, 16256098, 16256099,
5353                16256100, 16256101, 16256102, 16256103, 16256104, 16256105, 16256106, 16256107,
5354                16256108, 16256109, 16256110, 16256111, 16256112, 16256113, 16256114, 16256115,
5355                16256116, 16256117, 16256118, 16256119, 16256120, 16256121, 16256122, 16256123,
5356                16256124, 16256125, 16256126, 16256127, 16256128
5357            ]
5358        );
5359        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();
5360        assert_eq!(
5361            rp,
5362            vec![
5363                16256224, 16256225, 16256226, 16256227, 16256228, 16256229, 16256230, 16256231,
5364                16256232, 16256233, 16256234, 16256235, 16256236, 16256237, 16256238, 16256239,
5365                16256240, 16256241, 16256242, 16256243, 16256244, 16256245, 16256246, 16256247,
5366                16256248, 16256249, 16256250, 16256251, 16256252, 16256253, 16256254, 16256255,
5367                16256256, 16256257, 16256258, 16256259, 16256260, 16256261, 16256262, 16256263,
5368                16256264, 16256265, 16256266, 16256267, 16256268, 16256269, 16256270, 16256271
5369            ]
5370        );
5371        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();
5372        assert_eq!(
5373            rp,
5374            vec![
5375                16325199, 16325200, 16325201, 16325202, 16325203, 16325204, 16325205, 16325206,
5376                16325207, 16325208, 16325209, 16325210, 16325211, 16325212, 16325213, 16325214,
5377                16325215, 16325216, 16325217, 16325218, 16325219, 16325220, 16325221, 16325222,
5378                16325223, 16325224, 16325225, 16325226, 16325227, 16325228, 16325229, 16325230,
5379                16325231, 16325232, 16325233, 16325234, 16325235, 16325236, 16325237, 16325238,
5380                16325239, 16325240
5381            ]
5382        );
5383        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();
5384        assert_eq!(
5385            rp,
5386            vec![
5387                16352865, 16352866, 16352867, 16352868, 16352869, 16352870, 16352871, 16352872,
5388                16352873, 16352874, 16352875, 16352876, 16352877, 16352878, 16352879, 16352880,
5389                16352881, 16352882, 16352883, 16352884, 16352885, 16352886, 16352887, 16352888,
5390                16352889, 16352890, 16352891, 16352892, 16352893, 16352894, 16352895, 16352896,
5391                16352897, 16352898, 16352899, 16352900, 16352901, 16352902
5392            ]
5393        );
5394        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();
5395        assert_eq!(
5396            rp,
5397            vec![
5398                16352968, 16352969, 16352970, 16352971, 16352972, 16352973, 16352974, 16352975,
5399                16352976, 16352977, 16352978, 16352979, 16352980, 16352981, 16352982, 16352983,
5400                16352984, 16352985, 16352986, 16352987, 16352988, 16352989, 16352990, 16352991,
5401                16352992, 16352993, 16352994, 16352995, 16352996, 16352997, 16352998, 16352999,
5402                16353000, 16353001, 16353002, 16353003, 16353004, 16353005, 16353006, 16353007,
5403                16353008, 16353009, 16353010, 16353011
5404            ]
5405        );
5406        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();
5407        assert_eq!(
5408            rp,
5409            vec![
5410                16414998, 16414999, 16415000, 16415001, 16415002, 16415003, 16415004, 16415005,
5411                16415006, 16415007, 16415008, 16415009, 16415010, 16415011, 16415012, 16415013,
5412                16415014, 16415015, 16415016, 16415017, 16415018, 16415019, 16415020, 16415021,
5413                16415022, 16415023, 16415024, 16415025, 16415026, 16415027, 16415028, 16415029,
5414                16415030, 16415031, 16415032, 16415033, 16415034, 16415035, 16415036, 16415037,
5415                16415038, 16415039, 16415040, 16415041, 16415042, 16415043
5416            ]
5417        );
5418        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();
5419        assert_eq!(
5420            rp,
5421            vec![
5422                17031591, 17031592, 17031593, 17031594, 17031595, 17031596, 17031597, 17031598,
5423                17031599, 17031600, 17031601, 17031602, 17031603, 17031604, 17031605, 17031606,
5424                17031607, 17031608, 17031609, 17031610, 17031611, 17031612, 17031613, 17031614,
5425                17031615, 17031616, 17031617, 17031618, 17031619, 17031620, 17031621, 17031622,
5426                17031623, 17031624, 17031625, 17031626, 17031627, 17031628, 17031629, 17031630,
5427                17031631, 17031632, 17031633, 17031634, 17031635, 17031636, 17031637
5428            ]
5429        );
5430        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();
5431        assert_eq!(
5432            rp,
5433            vec![
5434                17057382, 17057383, 17057384, 17057385, 17057386, 17057387, 17057388, 17057389,
5435                17057390, 17057391, 17057392, 17057393, 17057394, 17057395, 17057396, 17057397,
5436                17057398, 17057399, 17057400, 17057401, 17057402, 17057403, 17057404, 17057405,
5437                17057406, 17057407, 17057408, 17057409, 17057410, 17057411, 17057412, 17057413,
5438                17057414, 17057415, 17057416, 17057417, 17057418, 17057419, 17057420, 17057421,
5439                17057422, 17057423, 17057424, 17057425, 17057426, 17057427, 17057428, 17057429,
5440                17057430, 17057431
5441            ]
5442        );
5443        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();
5444        assert_eq!(
5445            rp,
5446            vec![
5447                17092766, 17092767, 17092768, 17092769, 17092770, 17092771, 17092772, 17092773,
5448                17092774, 17092775, 17092776, 17092777, 17092778, 17092779, 17092780, 17092781,
5449                17092782, 17094966, 17094967, 17094968, 17094969, 17094970, 17094971, 17094972,
5450                17094973, 17094974, 17094975, 17094976, 17094977, 17094978, 17094979, 17094980,
5451                17094981, 17094982, 17094983, 17094984, 17094985, 17094986, 17094987, 17094988,
5452                17094989, 17094990, 17094991, 17094992, 17094993, 17094994, 17094995, 17094996,
5453                17094997, 17094998, 17094999
5454            ]
5455        );
5456        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();
5457        assert_eq!(
5458            rp,
5459            vec![
5460                17092782, 17094966, 17094967, 17094968, 17094969, 17094970, 17094971, 17094972,
5461                17094973, 17094974, 17094975, 17094976, 17094977, 17094978, 17094979, 17094980,
5462                17094981, 17094982, 17094983, 17094984, 17094985, 17094986, 17094987, 17094988,
5463                17094989, 17094990, 17094991, 17094992, 17094993, 17094994, 17094995, 17094996,
5464                17094997, 17094998, 17094999, 17095000, 17095001, 17095002, 17095003, 17095004,
5465                17095005, 17095006, 17095007, 17095008, 17095009, 17095010, 17095011, 17095012,
5466                17095013, 17095014, 17095015
5467            ]
5468        );
5469        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();
5470        assert_eq!(
5471            rp,
5472            vec![
5473                17092782, 17094966, 17094967, 17094968, 17094969, 17094970, 17094971, 17094972,
5474                17094973, 17094974, 17094975, 17094976, 17094977, 17094978, 17094979, 17094980,
5475                17094981, 17094982, 17094983, 17094984, 17094985, 17094986, 17094987, 17094988,
5476                17094989, 17094990, 17094991, 17094992, 17094993, 17094994, 17094995, 17094996,
5477                17094997, 17094998, 17094999, 17095000, 17095001, 17095002, 17095003, 17095004,
5478                17095005, 17095006, 17095007, 17095008, 17095009, 17095010, 17095011, 17095012,
5479                17095013, 17095014, 17095015
5480            ]
5481        );
5482        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();
5483        assert_eq!(
5484            rp,
5485            vec![
5486                17137287, 17137288, 17137289, 17137290, 17137291, 17137292, 17137293, 17137294,
5487                17137295, 17137296, 17137297, 17137298, 17137299, 17137300, 17137301, 17137302,
5488                17137303, 17137304, 17137305, 17137306, 17137307, 17137308, 17137309, 17137310,
5489                17137311, 17137312, 17137313, 17137314, 17137315, 17137316, 17137317, 17137318,
5490                17137319
5491            ]
5492        );
5493        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();
5494        assert_eq!(
5495            rp,
5496            vec![
5497                17306238, 17306239, 17306240, 17306241, 17306242, 17306243, 17306244, 17306245,
5498                17306246, 17306247, 17306248, 17306249, 17306250, 17306251, 17306252, 17306253,
5499                17306254, 17306255, 17306256, 17306257, 17306258, 17306259, 17306260, 17306261,
5500                17306262, 17306263, 17306264, 17306265, 17306266, 17306267, 17306268, 17306269,
5501                17306270, 17306271, 17306272, 17306273, 17306274, 17306275, 17306276, 17306277,
5502                17306278, 17306279, 17306280, 17306281, 17306282, 17306283, 17306284, 17306285
5503            ]
5504        );
5505        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();
5506        assert_eq!(
5507            rp,
5508            vec![
5509                17561868, 17561869, 17561870, 17561871, 17561872, 17561873, 17561874, 17561875,
5510                17561876, 17561877, 17561878, 17561879, 17561880, 17561881, 17561882, 17561883,
5511                17561884, 17561885, 17561886, 17561887, 17561888, 17561889, 17561890, 17561891,
5512                17561892, 17561893, 17561894, 17561895, 17561896, 17561897, 17561898, 17561899,
5513                17561900, 17561901, 17561902, 17561903, 17561904, 17561905, 17561906, 17561907,
5514                17561908, 17561909, 17561910, 17561911, 17561912
5515            ]
5516        );
5517        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();
5518        assert_eq!(
5519            rp,
5520            vec![
5521                17566078, 17566079, 17566080, 17566081, 17566082, 17566083, 17566084, 17566085,
5522                17566086, 17566087, 17566088, 17566089, 17566090, 17566091, 17566092, 17566093,
5523                17566094, 17566095, 17566096, 17566097, 17566098, 17566099, 17566100, 17566101,
5524                17566102, 17566103, 17566104, 17566105, 17566106, 17566107, 17566108, 17566109,
5525                17566110, 17566111, 17566112, 17566113, 17566114, 17566115, 17566116, 17566117,
5526                17566118, 17577951, 17577952, 17577953, 17577954, 17577955, 17577956, 17577957,
5527                17577958, 17577959, 17577960
5528            ]
5529        );
5530        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();
5531        assert_eq!(
5532            rp,
5533            vec![
5534                17566108, 17566109, 17566110, 17566111, 17566112, 17566113, 17566114, 17566115,
5535                17566116, 17566117, 17566118, 17577951, 17577952, 17577953, 17577954, 17577955,
5536                17577956, 17577957, 17577958, 17577959, 17577960, 17577961, 17577962, 17577963,
5537                17577964, 17577965, 17577966, 17577967, 17577968, 17577969, 17577970, 17577971,
5538                17577972, 17577973, 17577974, 17577975, 17578686, 17578687, 17578688, 17578689,
5539                17578690, 17578691, 17578692, 17578693, 17578694, 17578695, 17578696, 17578697,
5540                17578698, 17578699, 17578700
5541            ]
5542        );
5543        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();
5544        assert_eq!(
5545            rp,
5546            vec![
5547                17566111, 17566112, 17566113, 17566114, 17566115, 17566116, 17566117, 17566118,
5548                17577951, 17577952, 17577953, 17577954, 17577955, 17577956, 17577957, 17577958,
5549                17577959, 17577960, 17577961, 17577962, 17577963, 17577964, 17577965, 17577966,
5550                17577967, 17577968, 17577969, 17577970, 17577971, 17577972, 17577973, 17577974,
5551                17577975, 17578686, 17578687, 17578688, 17578689, 17578690, 17578691, 17578692,
5552                17578693, 17578694, 17578695, 17578696, 17578697, 17578698, 17578699, 17578700,
5553                17578701, 17578702, 17578703
5554            ]
5555        );
5556        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();
5557        assert_eq!(
5558            rp,
5559            vec![
5560                17566111, 17566112, 17566113, 17566114, 17566115, 17566116, 17566117, 17566118,
5561                17577951, 17577952, 17577953, 17577954, 17577955, 17577956, 17577957, 17577958,
5562                17577959, 17577960, 17577961, 17577962, 17577963, 17577964, 17577965, 17577966,
5563                17577967, 17577968, 17577969, 17577970, 17577971, 17577972, 17577973, 17577974,
5564                17577975, 17578686, 17578687, 17578688, 17578689, 17578690, 17578691, 17578692,
5565                17578693, 17578694, 17578695, 17578696, 17578697, 17578698, 17578699, 17578700,
5566                17578701, 17578702, 17578703
5567            ]
5568        );
5569        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();
5570        assert_eq!(
5571            rp,
5572            vec![
5573                17566111, 17566112, 17566113, 17566114, 17566115, 17566116, 17566117, 17566118,
5574                17577951, 17577952, 17577953, 17577954, 17577955, 17577956, 17577957, 17577958,
5575                17577959, 17577960, 17577961, 17577962, 17577963, 17577964, 17577965, 17577966,
5576                17577967, 17577968, 17577969, 17577970, 17577971, 17577972, 17577973, 17577974,
5577                17577975, 17578686, 17578687, 17578688, 17578689, 17578690, 17578691, 17578692,
5578                17578693, 17578694, 17578695, 17578696, 17578697, 17578698, 17578699, 17578700,
5579                17578701, 17578702, 17578703
5580            ]
5581        );
5582        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();
5583        assert_eq!(
5584            rp,
5585            vec![
5586                17566111, 17566112, 17566113, 17566114, 17566115, 17566116, 17566117, 17566118,
5587                17577951, 17577952, 17577953, 17577954, 17577955, 17577956, 17577957, 17577958,
5588                17577959, 17577960, 17577961, 17577962, 17577963, 17577964, 17577965, 17577966,
5589                17577967, 17577968, 17577969, 17577970, 17577971, 17577972, 17577973, 17577974,
5590                17577975, 17578686, 17578687, 17578688, 17578689, 17578690, 17578691, 17578692,
5591                17578693, 17578694, 17578695, 17578696, 17578697, 17578698, 17578699, 17578700,
5592                17578701, 17578702, 17578703
5593            ]
5594        );
5595        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();
5596        assert_eq!(
5597            rp,
5598            vec![
5599                17566112, 17566113, 17566114, 17566115, 17566116, 17566117, 17566118, 17577951,
5600                17577952, 17577953, 17577954, 17577955, 17577956, 17577957, 17577958, 17577959,
5601                17577960, 17577961, 17577962, 17577963, 17577964, 17577965, 17577966, 17577967,
5602                17577968, 17577969, 17577970, 17577971, 17577972, 17577973, 17577974, 17577975,
5603                17578686, 17578687, 17578688, 17578689, 17578690, 17578691, 17578692, 17578693,
5604                17578694, 17578695, 17578696, 17578697, 17578698, 17578699, 17578700, 17578701,
5605                17578702, 17578703, 17578704
5606            ]
5607        );
5608        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();
5609        assert_eq!(
5610            rp,
5611            vec![
5612                17566113, 17566114, 17566115, 17566116, 17566117, 17566118, 17577951, 17577952,
5613                17577953, 17577954, 17577955, 17577956, 17577957, 17577958, 17577959, 17577960,
5614                17577961, 17577962, 17577963, 17577964, 17577965, 17577966, 17577967, 17577968,
5615                17577969, 17577970, 17577971, 17577972, 17577973, 17577974, 17577975, 17578686,
5616                17578687, 17578688, 17578689, 17578690, 17578691, 17578692, 17578693, 17578694,
5617                17578695, 17578696, 17578697, 17578698, 17578699, 17578700, 17578701, 17578702,
5618                17578703, 17578704, 17578705
5619            ]
5620        );
5621        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();
5622        assert_eq!(
5623            rp,
5624            vec![
5625                17566113, 17566114, 17566115, 17566116, 17566117, 17566118, 17577951, 17577952,
5626                17577953, 17577954, 17577955, 17577956, 17577957, 17577958, 17577959, 17577960,
5627                17577961, 17577962, 17577963, 17577964, 17577965, 17577966, 17577967, 17577968,
5628                17577969, 17577970, 17577971, 17577972, 17577973, 17577974, 17577975, 17578686,
5629                17578687, 17578688, 17578689, 17578690, 17578691, 17578692, 17578693, 17578694,
5630                17578695, 17578696, 17578697, 17578698, 17578699, 17578700, 17578701, 17578702,
5631                17578703, 17578704, 17578705
5632            ]
5633        );
5634        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();
5635        assert_eq!(
5636            rp,
5637            vec![
5638                17579733, 17579734, 17579735, 17579736, 17579737, 17579738, 17579739, 17579740,
5639                17579741, 17579742, 17579743, 17579744, 17579745, 17579746, 17579747, 17579748,
5640                17579749, 17579750, 17579751, 17579752, 17579753, 17579754, 17579755, 17579756,
5641                17579757, 17579758, 17579759, 17579760, 17579761, 17579762, 17579763, 17579764,
5642                17579765, 17579766, 17579767, 17579768, 17579769, 17579770, 17579771, 17579772,
5643                17579773, 17579774, 17579775, 17579776, 17581244, 17581245, 17581246, 17581247,
5644                17581248, 17581249
5645            ]
5646        );
5647        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();
5648        assert_eq!(
5649            rp,
5650            vec![
5651                17581369, 17581370, 17582885, 17582886, 17582887, 17582888, 17582889, 17582890,
5652                17582891, 17582892, 17582893, 17582894, 17582895, 17582896, 17582897, 17582898,
5653                17582899, 17582900, 17582901, 17582902, 17582903, 17582904, 17582905, 17582906,
5654                17582907, 17582908, 17582909, 17582910, 17582911, 17582912, 17582913, 17582914,
5655                17582915, 17582916, 17582917, 17582918, 17582919, 17582920, 17582921, 17582922,
5656                17582923, 17582924, 17582925, 17582926, 17582927, 17582928, 17582929, 17582930,
5657                17582931, 17582932, 17583028
5658            ]
5659        );
5660        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();
5661        assert_eq!(
5662            rp,
5663            vec![
5664                17581370, 17582885, 17582886, 17582887, 17582888, 17582889, 17582890, 17582891,
5665                17582892, 17582893, 17582894, 17582895, 17582896, 17582897, 17582898, 17582899,
5666                17582900, 17582901, 17582902, 17582903, 17582904, 17582905, 17582906, 17582907,
5667                17582908, 17582909, 17582910, 17582911, 17582912, 17582913, 17582914, 17582915,
5668                17582916, 17582917, 17582918, 17582919, 17582920, 17582921, 17582922, 17582923,
5669                17582924, 17582925, 17582926, 17582927, 17582928, 17582929, 17582930, 17582931,
5670                17582932, 17583028, 17583029
5671            ]
5672        );
5673        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();
5674        assert_eq!(
5675            rp,
5676            vec![
5677                17581370, 17582885, 17582886, 17582887, 17582888, 17582889, 17582890, 17582891,
5678                17582892, 17582893, 17582894, 17582895, 17582896, 17582897, 17582898, 17582899,
5679                17582900, 17582901, 17582902, 17582903, 17582904, 17582905, 17582906, 17582907,
5680                17582908, 17582909, 17582910, 17582911, 17582912, 17582913, 17582914, 17582915,
5681                17582916, 17582917, 17582918, 17582919, 17582920, 17582921, 17582922, 17582923,
5682                17582924, 17582925, 17582926, 17582927, 17582928, 17582929, 17582930, 17582931,
5683                17582932, 17583028, 17583029
5684            ]
5685        );
5686        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();
5687        assert_eq!(
5688            rp,
5689            vec![
5690                17582911, 17582912, 17582913, 17582914, 17582915, 17582916, 17582917, 17582918,
5691                17582919, 17582920, 17582921, 17582922, 17582923, 17582924, 17582925, 17582926,
5692                17582927, 17582928, 17582929, 17582930, 17582931, 17582932, 17583028, 17583029,
5693                17583030, 17583031, 17583032, 17583033, 17583034, 17583035, 17583036, 17583037,
5694                17583038, 17583039, 17583040, 17583041, 17583042, 17583043, 17583044, 17583045,
5695                17583046, 17583047, 17583048, 17583049, 17583050, 17583051, 17583052, 17583053,
5696                17583054, 17583055
5697            ]
5698        );
5699        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();
5700        assert_eq!(
5701            rp,
5702            vec![
5703                17588621, 17588622, 17588623, 17588624, 17588625, 17588626, 17588627, 17588628,
5704                17588629, 17588630, 17588631, 17588632, 17588633, 17588634, 17588635, 17588636,
5705                17588637, 17588638, 17588639, 17588640, 17588641, 17588642, 17588643, 17588644,
5706                17588645, 17588646, 17588647, 17588648, 17588649, 17588650, 17588651, 17588652,
5707                17588653, 17588654, 17588655, 17588656, 17588657, 17589196, 17589197, 17589198,
5708                17589199, 17589200, 17589201, 17589202, 17589203, 17589204, 17589205, 17589206,
5709                17589207, 17589208
5710            ]
5711        );
5712        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();
5713        assert_eq!(
5714            rp,
5715            vec![
5716                17588621, 17588622, 17588623, 17588624, 17588625, 17588626, 17588627, 17588628,
5717                17588629, 17588630, 17588631, 17588632, 17588633, 17588634, 17588635, 17588636,
5718                17588637, 17588638, 17588639, 17588640, 17588641, 17588642, 17588643, 17588644,
5719                17588645, 17588646, 17588647, 17588648, 17588649, 17588650, 17588651, 17588652,
5720                17588653, 17588654, 17588655, 17588656, 17588657, 17589196, 17589197, 17589198,
5721                17589199, 17589200, 17589201, 17589202, 17589203, 17589204, 17589205, 17589206,
5722                17589207, 17589208
5723            ]
5724        );
5725        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();
5726        assert_eq!(
5727            rp,
5728            vec![
5729                17588621, 17588622, 17588623, 17588624, 17588625, 17588626, 17588627, 17588628,
5730                17588629, 17588630, 17588631, 17588632, 17588633, 17588634, 17588635, 17588636,
5731                17588637, 17588638, 17588639, 17588640, 17588641, 17588642, 17588643, 17588644,
5732                17588645, 17588646, 17588647, 17588648, 17588649, 17588650, 17588651, 17588652,
5733                17588653, 17588654, 17588655, 17588656, 17588657, 17589196, 17589197, 17589198,
5734                17589199, 17589200, 17589201, 17589202, 17589203, 17589204, 17589205, 17589206,
5735                17589207, 17589208
5736            ]
5737        );
5738        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();
5739        assert_eq!(
5740            rp,
5741            vec![
5742                17591770, 17591771, 17591772, 17591773, 17591774, 17591775, 17591776, 17591777,
5743                17591778, 17591779, 17591780, 17591781, 17591782, 17591783, 17591784, 17591785,
5744                17591786, 17591787, 17591788, 17591789, 17591790, 17591791, 17591792, 17591793,
5745                17591794, 17591796, 17591797, 17591798, 17591799, 17591800, 17591801, 17591802,
5746                17591803, 17591804, 17591805, 17591806, 17591807, 17591808, 17591809, 17591810,
5747                17591811, 17591812, 17591813, 17591814, 17591815, 17591816, 17591817, 17591818,
5748                17591819, 17591820
5749            ]
5750        );
5751        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();
5752        assert_eq!(
5753            rp,
5754            vec![
5755                17593855, 17593856, 17593857, 17593858, 17593859, 17593860, 17593861, 17593862,
5756                17593863, 17593864, 17593865, 17593866, 17593867, 17593868, 17593869, 17593870,
5757                17593871, 17593872, 17593873, 17593874, 17593875, 17593876, 17593877, 17593878,
5758                17593880, 17593881, 17593882, 17593883, 17593884, 17593885, 17593886, 17593887,
5759                17593888, 17593889, 17593890, 17593891, 17593892, 17593893, 17593894, 17593895,
5760                17593896, 17593897, 17593898, 17593899, 17593900, 17593901, 17593902, 17593903
5761            ]
5762        );
5763        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();
5764        assert_eq!(
5765            rp,
5766            vec![
5767                17593863, 17593864, 17593865, 17593866, 17593867, 17593868, 17593869, 17593870,
5768                17593871, 17593872, 17593873, 17593874, 17593875, 17593876, 17593877, 17593878,
5769                17593880, 17593881, 17593882, 17593883, 17593884, 17593885, 17593886, 17593887,
5770                17593888, 17593889, 17593890, 17593891, 17593892, 17593893, 17593894, 17593895,
5771                17593896, 17593897, 17593898, 17593899, 17593900, 17593901, 17593902, 17593903,
5772                17593904, 17593905, 17593906, 17593907
5773            ]
5774        );
5775        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();
5776        assert_eq!(
5777            rp,
5778            vec![
5779                17596476, 17596477, 17596478, 17596479, 17596480, 17596481, 17596482, 17596483,
5780                17596484, 17596485, 17596486, 17596487, 17596488, 17596489, 17596490, 17596491,
5781                17596492, 17596493, 17596494, 17596495, 17596496, 17596497, 17596498, 17596499,
5782                17596500, 17596501, 17596502, 17596503, 17596504, 17596505, 17596506, 17596507,
5783                17596508, 17596509, 17596510, 17596511, 17596512, 17596513, 17596514
5784            ]
5785        );
5786        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();
5787        assert_eq!(
5788            rp,
5789            vec![
5790                17624012, 17624013, 17624014, 17624015, 17624016, 17624017, 17624018, 17624019,
5791                17624020, 17625913, 17625914, 17625915, 17625916, 17625917, 17625918, 17625919,
5792                17625920, 17625921, 17625922, 17625923, 17625924, 17625925, 17625926, 17625927,
5793                17625928, 17625929, 17625930, 17625931, 17625932, 17625933, 17625934, 17625935,
5794                17625936, 17625937, 17625938, 17625939, 17625940, 17625941, 17625942, 17625943,
5795                17625944, 17625945, 17625946, 17625947, 17625948, 17625949
5796            ]
5797        );
5798        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();
5799        assert_eq!(
5800            rp,
5801            vec![
5802                17624012, 17624013, 17624014, 17624015, 17624016, 17624017, 17624018, 17624019,
5803                17624020, 17625913, 17625914, 17625915, 17625916, 17625917, 17625918, 17625919,
5804                17625920, 17625921, 17625922, 17625923, 17625924, 17625925, 17625926, 17625927,
5805                17625928, 17625929, 17625930, 17625931, 17625932, 17625933, 17625934, 17625935,
5806                17625936, 17625937, 17625938, 17625939, 17625940, 17625941, 17625942, 17625943,
5807                17625944, 17625945, 17625946, 17625947, 17625948, 17625949, 17625950, 17625951,
5808                17625952
5809            ]
5810        );
5811        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();
5812        assert_eq!(
5813            rp,
5814            vec![
5815                31796700, 31796701, 31796702, 31796703, 31796704, 31796705, 31796706, 31796710,
5816                31796711, 31796712, 31796713, 31796714, 31796715, 31796716, 31796717, 31796718,
5817                31796719, 31796720, 31796721, 31796722, 31796723, 31796724, 31796725, 31796726,
5818                31796727, 31796728, 31799014, 31799015, 31799016, 31799017, 31799018, 31799019,
5819                31799020, 31799021, 31799022, 31799023, 31799024, 31799025, 31799026, 31799027,
5820                31799028, 31799029, 31799030, 31799031, 31799032, 31799033, 31799034, 31799035,
5821                31799036, 31799037
5822            ]
5823        );
5824        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();
5825        assert_eq!(
5826            rp,
5827            vec![
5828                36722692, 36722693, 36722694, 36722695, 36722696, 36722697, 36722698, 36722699,
5829                36722700, 36722701, 36722702, 36722703, 36722704, 36722705, 36723505, 36723506,
5830                36723507, 36723508, 36723509, 36723510, 36723511, 36723512, 36723513, 36723514,
5831                36723515, 36723516, 36723517, 36723518, 36723519, 36723520, 36723521, 36723522,
5832                36723523, 36723524, 36723525, 36723526, 36723527, 36723528, 36723529, 36723530,
5833                36723531, 36723532, 36737414, 36737415, 36737416, 36737417, 36737418, 36737419,
5834                36737420
5835            ]
5836        );
5837        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();
5838        assert_eq!(
5839            rp,
5840            vec![
5841                44587963, 44587964, 44587965, 44587966, 44587967, 44587968, 44587969, 44587970,
5842                44587971, 44587972, 44587973, 44587974, 44587975, 44587976, 44587977, 44587978,
5843                44587979, 44587980, 44587981, 44587982, 44587983, 44589680, 44589681, 44589682,
5844                44589683, 44589684, 44589685, 44589686, 44589687, 44589688, 44589689, 44589690,
5845                44589691, 44589692, 44589693, 44589694, 44589695, 44589696, 44589697, 44589698,
5846                44589699, 44589700, 44589701, 44589702, 44592034, 44592035, 44592036
5847            ]
5848        );
5849    }
5850
5851    #[test]
5852    fn test_reference_positions_full() {
5853        let mut bam = bam::Reader::from_path("./test/test_spliced_reads.bam").unwrap();
5854        let mut it = bam.records();
5855
5856        let rp: Vec<_> = it
5857            .next()
5858            .unwrap()
5859            .unwrap()
5860            .reference_positions_full()
5861            .collect();
5862        assert_eq!(
5863            rp,
5864            vec![
5865                None,
5866                None,
5867                None,
5868                None,
5869                None,
5870                None,
5871                Some(16050676),
5872                Some(16050677),
5873                Some(16050678),
5874                Some(16050679),
5875                Some(16050680),
5876                Some(16050681),
5877                Some(16050682),
5878                Some(16050683),
5879                Some(16050684),
5880                Some(16050685),
5881                Some(16050686),
5882                Some(16050687),
5883                Some(16050688),
5884                Some(16050689),
5885                Some(16050690),
5886                Some(16050691),
5887                Some(16050692),
5888                Some(16050693),
5889                Some(16050694),
5890                Some(16050695),
5891                Some(16050696),
5892                Some(16050697),
5893                Some(16050698),
5894                Some(16050699),
5895                Some(16050700),
5896                Some(16050701),
5897                Some(16050702),
5898                Some(16050703),
5899                Some(16050704),
5900                Some(16050705),
5901                Some(16050706),
5902                Some(16050707),
5903                Some(16050708),
5904                Some(16050709),
5905                Some(16050710),
5906                Some(16050711),
5907                Some(16050712),
5908                Some(16050713),
5909                Some(16050714),
5910                Some(16050715),
5911                Some(16050716),
5912                Some(16050717),
5913                Some(16050718),
5914                Some(16050719),
5915                Some(16050720)
5916            ]
5917        );
5918        let rp: Vec<_> = it
5919            .next()
5920            .unwrap()
5921            .unwrap()
5922            .reference_positions_full()
5923            .collect();
5924        assert_eq!(
5925            rp,
5926            vec![
5927                Some(16096878),
5928                Some(16096879),
5929                Some(16096880),
5930                Some(16096881),
5931                Some(16096882),
5932                Some(16096883),
5933                Some(16096884),
5934                Some(16096887),
5935                Some(16096888),
5936                Some(16096889),
5937                Some(16096890),
5938                Some(16096891),
5939                Some(16096892),
5940                Some(16096893),
5941                Some(16096894),
5942                Some(16096895),
5943                Some(16096896),
5944                Some(16096897),
5945                Some(16096898),
5946                Some(16096899),
5947                Some(16096900),
5948                Some(16096901),
5949                Some(16096902),
5950                Some(16096903),
5951                Some(16096904),
5952                Some(16096905),
5953                Some(16096906),
5954                Some(16096907),
5955                Some(16096908),
5956                Some(16096909),
5957                Some(16096910),
5958                Some(16096911),
5959                Some(16096912),
5960                Some(16096913),
5961                Some(16096914),
5962                Some(16096915),
5963                Some(16096916),
5964                Some(16096917),
5965                Some(16096918),
5966                Some(16096919),
5967                Some(16096920),
5968                Some(16096921),
5969                Some(16096922),
5970                Some(16096923),
5971                Some(16096924),
5972                Some(16096925),
5973                Some(16096926),
5974                Some(16096927),
5975                Some(16096928),
5976                Some(16096929),
5977                Some(16096930)
5978            ]
5979        );
5980        let rp: Vec<_> = it
5981            .next()
5982            .unwrap()
5983            .unwrap()
5984            .reference_positions_full()
5985            .collect();
5986        assert_eq!(
5987            rp,
5988            vec![
5989                Some(16097145),
5990                Some(16097146),
5991                Some(16097147),
5992                Some(16097148),
5993                Some(16097149),
5994                Some(16097150),
5995                Some(16097151),
5996                Some(16097152),
5997                Some(16097153),
5998                Some(16097154),
5999                Some(16097155),
6000                Some(16097156),
6001                Some(16097157),
6002                Some(16097158),
6003                Some(16097159),
6004                Some(16097160),
6005                Some(16097161),
6006                Some(16097162),
6007                Some(16097163),
6008                Some(16097164),
6009                Some(16097165),
6010                Some(16097166),
6011                Some(16097167),
6012                Some(16097168),
6013                Some(16097169),
6014                Some(16097170),
6015                Some(16097171),
6016                Some(16097172),
6017                Some(16097173),
6018                Some(16097176),
6019                Some(16097177),
6020                Some(16097178),
6021                Some(16097179),
6022                Some(16097180),
6023                Some(16097181),
6024                Some(16097182),
6025                Some(16097183),
6026                Some(16097184),
6027                Some(16097185),
6028                Some(16097186),
6029                Some(16097187),
6030                Some(16097188),
6031                Some(16097189),
6032                Some(16097190),
6033                Some(16097191),
6034                Some(16097192),
6035                Some(16097193),
6036                Some(16097194),
6037                Some(16097195),
6038                Some(16097196),
6039                Some(16097197)
6040            ]
6041        );
6042        let rp: Vec<_> = it
6043            .next()
6044            .unwrap()
6045            .unwrap()
6046            .reference_positions_full()
6047            .collect();
6048        assert_eq!(
6049            rp,
6050            vec![
6051                Some(16117350),
6052                Some(16117351),
6053                Some(16117352),
6054                Some(16117353),
6055                Some(16117354),
6056                Some(16117355),
6057                Some(16117356),
6058                Some(16117357),
6059                Some(16117358),
6060                Some(16117359),
6061                Some(16117360),
6062                Some(16117361),
6063                Some(16117362),
6064                Some(16117363),
6065                Some(16117364),
6066                Some(16117365),
6067                Some(16117366),
6068                Some(16117367),
6069                Some(16117368),
6070                Some(16117369),
6071                Some(16117370),
6072                Some(16117371),
6073                Some(16117372),
6074                Some(16117373),
6075                Some(16117374),
6076                Some(16117375),
6077                Some(16117376),
6078                Some(16117377),
6079                Some(16117378),
6080                Some(16117379),
6081                Some(16117380),
6082                Some(16117381),
6083                Some(16117382),
6084                Some(16117383),
6085                Some(16117384),
6086                Some(16117385),
6087                Some(16117386),
6088                Some(16117387),
6089                Some(16117388),
6090                Some(16117389),
6091                Some(16117390),
6092                Some(16117391),
6093                Some(16117392),
6094                Some(16117393),
6095                Some(16117394),
6096                Some(16117395),
6097                Some(16117396),
6098                Some(16117397),
6099                Some(16117398),
6100                Some(16117399),
6101                Some(16117400)
6102            ]
6103        );
6104        let rp: Vec<_> = it
6105            .next()
6106            .unwrap()
6107            .unwrap()
6108            .reference_positions_full()
6109            .collect();
6110        assert_eq!(
6111            rp,
6112            vec![
6113                Some(16118483),
6114                Some(16118484),
6115                Some(16118485),
6116                Some(16118486),
6117                Some(16118487),
6118                Some(16118488),
6119                Some(16118489),
6120                Some(16118490),
6121                Some(16118491),
6122                Some(16118492),
6123                Some(16118493),
6124                Some(16118494),
6125                Some(16118495),
6126                Some(16118496),
6127                Some(16118497),
6128                Some(16118498),
6129                Some(16118499),
6130                Some(16118500),
6131                Some(16118501),
6132                Some(16118502),
6133                Some(16118503),
6134                Some(16118504),
6135                Some(16118505),
6136                Some(16118506),
6137                Some(16118507),
6138                Some(16118508),
6139                Some(16118509),
6140                Some(16118510),
6141                Some(16118511),
6142                Some(16118512),
6143                Some(16118513),
6144                Some(16118514),
6145                Some(16118515),
6146                Some(16118516),
6147                Some(16118517),
6148                Some(16118518),
6149                Some(16118519),
6150                Some(16118520),
6151                Some(16118521),
6152                Some(16118522),
6153                Some(16118523),
6154                Some(16118524),
6155                Some(16118525),
6156                Some(16118526),
6157                Some(16118527),
6158                Some(16118528),
6159                Some(16118529),
6160                Some(16118530),
6161                Some(16118531),
6162                Some(16118532),
6163                Some(16118533)
6164            ]
6165        );
6166        let rp: Vec<_> = it
6167            .next()
6168            .unwrap()
6169            .unwrap()
6170            .reference_positions_full()
6171            .collect();
6172        assert_eq!(
6173            rp,
6174            vec![
6175                Some(16118499),
6176                Some(16118500),
6177                Some(16118501),
6178                Some(16118502),
6179                Some(16118503),
6180                Some(16118504),
6181                Some(16118505),
6182                Some(16118506),
6183                Some(16118507),
6184                Some(16118508),
6185                Some(16118509),
6186                Some(16118510),
6187                Some(16118511),
6188                Some(16118512),
6189                Some(16118513),
6190                Some(16118514),
6191                Some(16118515),
6192                Some(16118516),
6193                Some(16118517),
6194                Some(16118518),
6195                Some(16118519),
6196                Some(16118520),
6197                Some(16118521),
6198                Some(16118522),
6199                Some(16118523),
6200                Some(16118524),
6201                Some(16118525),
6202                Some(16118526),
6203                Some(16118527),
6204                Some(16118528),
6205                Some(16118529),
6206                Some(16118530),
6207                Some(16118531),
6208                Some(16118532),
6209                Some(16118533),
6210                Some(16118534),
6211                Some(16118535),
6212                Some(16118536),
6213                Some(16118537),
6214                Some(16118538),
6215                Some(16118539),
6216                Some(16118540),
6217                Some(16118541),
6218                Some(16118542),
6219                Some(16118543),
6220                Some(16118544),
6221                Some(16118545),
6222                Some(16118546),
6223                Some(16118547),
6224                Some(16118548),
6225                Some(16118549)
6226            ]
6227        );
6228        let rp: Vec<_> = it
6229            .next()
6230            .unwrap()
6231            .unwrap()
6232            .reference_positions_full()
6233            .collect();
6234        assert_eq!(
6235            rp,
6236            vec![
6237                Some(16118499),
6238                Some(16118500),
6239                Some(16118501),
6240                Some(16118502),
6241                Some(16118503),
6242                Some(16118504),
6243                Some(16118505),
6244                Some(16118506),
6245                Some(16118507),
6246                Some(16118508),
6247                Some(16118509),
6248                Some(16118510),
6249                Some(16118511),
6250                Some(16118512),
6251                Some(16118513),
6252                Some(16118514),
6253                Some(16118515),
6254                Some(16118516),
6255                Some(16118517),
6256                Some(16118518),
6257                Some(16118519),
6258                Some(16118520),
6259                Some(16118521),
6260                Some(16118522),
6261                Some(16118523),
6262                Some(16118524),
6263                Some(16118525),
6264                Some(16118526),
6265                Some(16118527),
6266                Some(16118528),
6267                Some(16118529),
6268                Some(16118530),
6269                Some(16118531),
6270                Some(16118532),
6271                Some(16118533),
6272                Some(16118534),
6273                Some(16118535),
6274                Some(16118536),
6275                Some(16118537),
6276                Some(16118538),
6277                Some(16118539),
6278                Some(16118540),
6279                Some(16118541),
6280                Some(16118542),
6281                Some(16118543),
6282                Some(16118544),
6283                Some(16118545),
6284                Some(16118546),
6285                Some(16118547),
6286                Some(16118548),
6287                Some(16118549)
6288            ]
6289        );
6290        let rp: Vec<_> = it
6291            .next()
6292            .unwrap()
6293            .unwrap()
6294            .reference_positions_full()
6295            .collect();
6296        assert_eq!(
6297            rp,
6298            vec![
6299                Some(16118499),
6300                Some(16118500),
6301                Some(16118501),
6302                Some(16118502),
6303                Some(16118503),
6304                Some(16118504),
6305                Some(16118505),
6306                Some(16118506),
6307                Some(16118507),
6308                Some(16118508),
6309                Some(16118509),
6310                Some(16118510),
6311                Some(16118511),
6312                Some(16118512),
6313                Some(16118513),
6314                Some(16118514),
6315                Some(16118515),
6316                Some(16118516),
6317                Some(16118517),
6318                Some(16118518),
6319                Some(16118519),
6320                Some(16118520),
6321                Some(16118521),
6322                Some(16118522),
6323                Some(16118523),
6324                Some(16118524),
6325                Some(16118525),
6326                Some(16118526),
6327                Some(16118527),
6328                Some(16118528),
6329                Some(16118529),
6330                Some(16118530),
6331                Some(16118531),
6332                Some(16118532),
6333                Some(16118533),
6334                Some(16118534),
6335                Some(16118535),
6336                Some(16118536),
6337                Some(16118537),
6338                Some(16118538),
6339                Some(16118539),
6340                Some(16118540),
6341                Some(16118541),
6342                Some(16118542),
6343                Some(16118543),
6344                Some(16118544),
6345                Some(16118545),
6346                Some(16118546),
6347                Some(16118547),
6348                Some(16118548),
6349                Some(16118549)
6350            ]
6351        );
6352        let rp: Vec<_> = it
6353            .next()
6354            .unwrap()
6355            .unwrap()
6356            .reference_positions_full()
6357            .collect();
6358        assert_eq!(
6359            rp,
6360            vec![
6361                Some(16123411),
6362                Some(16123412),
6363                Some(16123413),
6364                Some(16123414),
6365                Some(16123415),
6366                Some(16123416),
6367                Some(16123417),
6368                Some(16123418),
6369                Some(16123419),
6370                Some(16123420),
6371                Some(16123421),
6372                Some(16123422),
6373                Some(16123423),
6374                Some(16123424),
6375                Some(16123425),
6376                Some(16123426),
6377                Some(16123427),
6378                Some(16123428),
6379                Some(16123429),
6380                Some(16123430),
6381                Some(16123431),
6382                Some(16123432),
6383                Some(16123433),
6384                Some(16123434),
6385                Some(16123435),
6386                Some(16123436),
6387                Some(16123437),
6388                Some(16123438),
6389                Some(16123439),
6390                Some(16123440),
6391                Some(16123441),
6392                Some(16123442),
6393                Some(16123443),
6394                Some(16123444),
6395                Some(16123445),
6396                Some(16123446),
6397                Some(16123447),
6398                Some(16123448),
6399                Some(16123449),
6400                Some(16123450),
6401                Some(16123451),
6402                Some(16123452),
6403                Some(16123453),
6404                Some(16123454),
6405                Some(16123455),
6406                Some(16123456),
6407                Some(16123457),
6408                Some(16123458),
6409                Some(16123459),
6410                Some(16123460),
6411                Some(16123461)
6412            ]
6413        );
6414        let rp: Vec<_> = it
6415            .next()
6416            .unwrap()
6417            .unwrap()
6418            .reference_positions_full()
6419            .collect();
6420        assert_eq!(
6421            rp,
6422            vec![
6423                None,
6424                None,
6425                None,
6426                None,
6427                None,
6428                None,
6429                Some(16123417),
6430                Some(16123418),
6431                Some(16123419),
6432                Some(16123420),
6433                Some(16123421),
6434                Some(16123422),
6435                Some(16123423),
6436                Some(16123424),
6437                Some(16123425),
6438                Some(16123426),
6439                Some(16123427),
6440                Some(16123428),
6441                Some(16123429),
6442                Some(16123430),
6443                Some(16123431),
6444                Some(16123432),
6445                Some(16123433),
6446                Some(16123434),
6447                Some(16123435),
6448                Some(16123436),
6449                Some(16123437),
6450                Some(16123438),
6451                Some(16123439),
6452                Some(16123440),
6453                Some(16123441),
6454                Some(16123442),
6455                Some(16123443),
6456                Some(16123444),
6457                Some(16123445),
6458                Some(16123446),
6459                Some(16123447),
6460                Some(16123448),
6461                Some(16123449),
6462                Some(16123450),
6463                Some(16123451),
6464                Some(16123452),
6465                Some(16123453),
6466                Some(16123454),
6467                Some(16123455),
6468                Some(16123456),
6469                Some(16123457),
6470                Some(16123458),
6471                Some(16123459),
6472                Some(16123460),
6473                Some(16123461)
6474            ]
6475        );
6476        let rp: Vec<_> = it
6477            .next()
6478            .unwrap()
6479            .unwrap()
6480            .reference_positions_full()
6481            .collect();
6482        assert_eq!(
6483            rp,
6484            vec![
6485                Some(16165860),
6486                Some(16165861),
6487                Some(16165862),
6488                Some(16165863),
6489                Some(16165864),
6490                Some(16165865),
6491                Some(16165866),
6492                Some(16165867),
6493                Some(16165868),
6494                Some(16165869),
6495                Some(16165870),
6496                Some(16165871),
6497                Some(16165872),
6498                Some(16165873),
6499                Some(16165874),
6500                Some(16165875),
6501                Some(16165876),
6502                Some(16165877),
6503                Some(16165878),
6504                Some(16165879),
6505                Some(16165880),
6506                Some(16165881),
6507                Some(16165882),
6508                Some(16165883),
6509                Some(16165884),
6510                Some(16165885),
6511                Some(16165886),
6512                Some(16165887),
6513                Some(16165888),
6514                Some(16165889),
6515                Some(16165890),
6516                Some(16165891),
6517                Some(16165892),
6518                Some(16165893),
6519                Some(16165894),
6520                Some(16165895),
6521                Some(16165896),
6522                Some(16165897),
6523                Some(16165898),
6524                Some(16165899),
6525                Some(16165900),
6526                None,
6527                None,
6528                None,
6529                None,
6530                None,
6531                None,
6532                None,
6533                None,
6534                None,
6535                None
6536            ]
6537        );
6538        let rp: Vec<_> = it
6539            .next()
6540            .unwrap()
6541            .unwrap()
6542            .reference_positions_full()
6543            .collect();
6544        assert_eq!(
6545            rp,
6546            vec![
6547                Some(16180871),
6548                Some(16180872),
6549                Some(16180873),
6550                Some(16180874),
6551                Some(16180875),
6552                Some(16180876),
6553                Some(16180877),
6554                Some(16180878),
6555                Some(16180879),
6556                Some(16180880),
6557                Some(16180881),
6558                Some(16180882),
6559                Some(16180883),
6560                Some(16180884),
6561                Some(16180885),
6562                Some(16180886),
6563                Some(16180887),
6564                Some(16180888),
6565                Some(16180889),
6566                Some(16180890),
6567                Some(16180891),
6568                Some(16180892),
6569                Some(16180893),
6570                Some(16180894),
6571                Some(16180895),
6572                Some(16180896),
6573                Some(16180897),
6574                Some(16180898),
6575                Some(16180899),
6576                Some(16180900),
6577                Some(16180901),
6578                Some(16180902),
6579                Some(16180903),
6580                Some(16180904),
6581                Some(16180905),
6582                Some(16180906),
6583                Some(16180907),
6584                Some(16180908),
6585                Some(16180909),
6586                Some(16180910),
6587                Some(16180911),
6588                Some(16180912),
6589                Some(16180913),
6590                Some(16180914),
6591                Some(16180915),
6592                Some(16180916),
6593                Some(16180917),
6594                Some(16180918),
6595                Some(16180919),
6596                Some(16180920),
6597                Some(16180921)
6598            ]
6599        );
6600        let rp: Vec<_> = it
6601            .next()
6602            .unwrap()
6603            .unwrap()
6604            .reference_positions_full()
6605            .collect();
6606        assert_eq!(
6607            rp,
6608            vec![
6609                Some(16189705),
6610                Some(16189706),
6611                Some(16189707),
6612                Some(16189708),
6613                Some(16189709),
6614                Some(16189710),
6615                Some(16189711),
6616                Some(16189712),
6617                Some(16189713),
6618                Some(16189714),
6619                Some(16189715),
6620                Some(16189716),
6621                Some(16189717),
6622                Some(16189718),
6623                Some(16189719),
6624                Some(16189720),
6625                Some(16189721),
6626                Some(16189722),
6627                Some(16189723),
6628                Some(16189724),
6629                Some(16189725),
6630                Some(16189726),
6631                Some(16189727),
6632                Some(16189728),
6633                Some(16189729),
6634                Some(16189730),
6635                Some(16189731),
6636                Some(16189732),
6637                Some(16189733),
6638                Some(16189734),
6639                Some(16189735),
6640                Some(16189736),
6641                Some(16189737),
6642                Some(16189738),
6643                Some(16189739),
6644                Some(16189740),
6645                Some(16189741),
6646                Some(16189742),
6647                Some(16189743),
6648                Some(16189744),
6649                Some(16189745),
6650                Some(16189746),
6651                Some(16189747),
6652                Some(16189748),
6653                Some(16189749),
6654                Some(16189750),
6655                Some(16189751),
6656                Some(16189752),
6657                Some(16189753),
6658                Some(16189754),
6659                Some(16189755)
6660            ]
6661        );
6662        let rp: Vec<_> = it
6663            .next()
6664            .unwrap()
6665            .unwrap()
6666            .reference_positions_full()
6667            .collect();
6668        assert_eq!(
6669            rp,
6670            vec![
6671                Some(16231271),
6672                Some(16231272),
6673                Some(16231273),
6674                Some(16231274),
6675                Some(16231275),
6676                Some(16231276),
6677                Some(16231277),
6678                Some(16231278),
6679                Some(16231279),
6680                Some(16231280),
6681                Some(16231281),
6682                Some(16231282),
6683                Some(16231283),
6684                Some(16231284),
6685                Some(16231285),
6686                Some(16231286),
6687                Some(16231287),
6688                Some(16231288),
6689                Some(16231289),
6690                Some(16231290),
6691                Some(16231291),
6692                Some(16231292),
6693                Some(16231293),
6694                Some(16231294),
6695                Some(16231295),
6696                Some(16231296),
6697                Some(16231297),
6698                Some(16231298),
6699                Some(16231299),
6700                Some(16231300),
6701                Some(16231301),
6702                Some(16231302),
6703                Some(16231303),
6704                Some(16231304),
6705                Some(16231305),
6706                Some(16231306),
6707                Some(16231307),
6708                Some(16231308),
6709                Some(16231309),
6710                Some(16231310),
6711                Some(16231311),
6712                Some(16231312),
6713                Some(16231313),
6714                Some(16231314),
6715                Some(16231315),
6716                Some(16231316),
6717                Some(16231317),
6718                Some(16231318),
6719                Some(16231319),
6720                Some(16231320),
6721                Some(16231321)
6722            ]
6723        );
6724        let rp: Vec<_> = it
6725            .next()
6726            .unwrap()
6727            .unwrap()
6728            .reference_positions_full()
6729            .collect();
6730        assert_eq!(
6731            rp,
6732            vec![
6733                Some(16237657),
6734                Some(16237658),
6735                Some(16237659),
6736                Some(16237660),
6737                Some(16237661),
6738                Some(16237662),
6739                Some(16237663),
6740                Some(16237664),
6741                Some(16237665),
6742                Some(16237666),
6743                Some(16237667),
6744                Some(16237668),
6745                Some(16237669),
6746                Some(16237670),
6747                Some(16237671),
6748                Some(16237672),
6749                Some(16237673),
6750                Some(16237674),
6751                Some(16237675),
6752                Some(16237676),
6753                Some(16237677),
6754                Some(16237678),
6755                Some(16237679),
6756                Some(16237680),
6757                Some(16237681),
6758                Some(16237682),
6759                Some(16237683),
6760                Some(16237684),
6761                Some(16237685),
6762                Some(16237686),
6763                Some(16237687),
6764                Some(16237688),
6765                Some(16237689),
6766                Some(16237690),
6767                Some(16237691),
6768                Some(16237692),
6769                Some(16237693),
6770                Some(16237694),
6771                Some(16237695),
6772                Some(16237696),
6773                Some(16237697),
6774                Some(16237698),
6775                Some(16237699),
6776                Some(16237700),
6777                Some(16237701),
6778                Some(16237702),
6779                Some(16237703),
6780                Some(16237704),
6781                Some(16237705),
6782                Some(16237706),
6783                Some(16237707)
6784            ]
6785        );
6786        let rp: Vec<_> = it
6787            .next()
6788            .unwrap()
6789            .unwrap()
6790            .reference_positions_full()
6791            .collect();
6792        assert_eq!(
6793            rp,
6794            vec![
6795                None,
6796                None,
6797                None,
6798                None,
6799                None,
6800                None,
6801                None,
6802                None,
6803                None,
6804                Some(16255012),
6805                Some(16255013),
6806                Some(16255014),
6807                Some(16255015),
6808                Some(16255016),
6809                Some(16255017),
6810                Some(16255018),
6811                Some(16255019),
6812                Some(16255020),
6813                Some(16255021),
6814                Some(16255022),
6815                Some(16255023),
6816                Some(16255024),
6817                Some(16255025),
6818                Some(16255026),
6819                Some(16255027),
6820                Some(16255028),
6821                Some(16255029),
6822                Some(16255030),
6823                Some(16255031),
6824                Some(16255032),
6825                Some(16255033),
6826                Some(16255034),
6827                Some(16255035),
6828                Some(16255036),
6829                Some(16255037),
6830                Some(16255038),
6831                Some(16255039),
6832                Some(16255040),
6833                Some(16255041),
6834                Some(16255042),
6835                Some(16255043),
6836                Some(16255044),
6837                Some(16255045),
6838                Some(16255046),
6839                Some(16255047),
6840                Some(16255048),
6841                Some(16255049),
6842                Some(16255050),
6843                Some(16255051),
6844                Some(16255052),
6845                Some(16255053)
6846            ]
6847        );
6848        let rp: Vec<_> = it
6849            .next()
6850            .unwrap()
6851            .unwrap()
6852            .reference_positions_full()
6853            .collect();
6854        assert_eq!(
6855            rp,
6856            vec![
6857                Some(16255391),
6858                Some(16255392),
6859                Some(16255393),
6860                Some(16255394),
6861                Some(16255395),
6862                Some(16255396),
6863                Some(16255397),
6864                Some(16255398),
6865                Some(16255399),
6866                Some(16255400),
6867                Some(16255401),
6868                Some(16255402),
6869                Some(16255403),
6870                Some(16255404),
6871                Some(16255405),
6872                Some(16255406),
6873                Some(16255407),
6874                Some(16255408),
6875                Some(16255409),
6876                Some(16255410),
6877                Some(16255411),
6878                Some(16255412),
6879                Some(16255413),
6880                Some(16255414),
6881                Some(16255415),
6882                Some(16255416),
6883                Some(16255417),
6884                Some(16255418),
6885                Some(16255419),
6886                Some(16255420),
6887                Some(16255421),
6888                Some(16255422),
6889                Some(16255423),
6890                Some(16255424),
6891                Some(16255425),
6892                Some(16255426),
6893                Some(16255427),
6894                Some(16255428),
6895                Some(16255429),
6896                Some(16255430),
6897                Some(16255431),
6898                Some(16255432),
6899                Some(16255433),
6900                Some(16255434),
6901                Some(16255435),
6902                Some(16255436),
6903                Some(16255437),
6904                Some(16255438),
6905                Some(16255439),
6906                Some(16255440),
6907                Some(16255441)
6908            ]
6909        );
6910        let rp: Vec<_> = it
6911            .next()
6912            .unwrap()
6913            .unwrap()
6914            .reference_positions_full()
6915            .collect();
6916        assert_eq!(
6917            rp,
6918            vec![
6919                Some(16255392),
6920                Some(16255393),
6921                Some(16255394),
6922                Some(16255395),
6923                Some(16255396),
6924                Some(16255397),
6925                Some(16255398),
6926                Some(16255399),
6927                Some(16255400),
6928                Some(16255401),
6929                Some(16255402),
6930                Some(16255403),
6931                Some(16255404),
6932                Some(16255405),
6933                Some(16255406),
6934                Some(16255407),
6935                Some(16255408),
6936                Some(16255409),
6937                Some(16255410),
6938                Some(16255411),
6939                Some(16255412),
6940                Some(16255413),
6941                Some(16255414),
6942                Some(16255415),
6943                Some(16255416),
6944                Some(16255417),
6945                Some(16255418),
6946                Some(16255419),
6947                Some(16255420),
6948                Some(16255421),
6949                Some(16255422),
6950                Some(16255423),
6951                Some(16255424),
6952                Some(16255425),
6953                Some(16255426),
6954                Some(16255427),
6955                Some(16255428),
6956                Some(16255429),
6957                Some(16255430),
6958                Some(16255431),
6959                Some(16255432),
6960                Some(16255433),
6961                Some(16255434),
6962                Some(16255435),
6963                Some(16255436),
6964                Some(16255437),
6965                Some(16255438),
6966                Some(16255439),
6967                Some(16255440),
6968                Some(16255441),
6969                None
6970            ]
6971        );
6972        let rp: Vec<_> = it
6973            .next()
6974            .unwrap()
6975            .unwrap()
6976            .reference_positions_full()
6977            .collect();
6978        assert_eq!(
6979            rp,
6980            vec![
6981                Some(16256084),
6982                Some(16256085),
6983                Some(16256086),
6984                Some(16256087),
6985                Some(16256088),
6986                Some(16256089),
6987                Some(16256090),
6988                Some(16256091),
6989                Some(16256092),
6990                Some(16256093),
6991                Some(16256094),
6992                Some(16256095),
6993                Some(16256096),
6994                Some(16256097),
6995                Some(16256098),
6996                Some(16256099),
6997                Some(16256100),
6998                Some(16256101),
6999                Some(16256102),
7000                Some(16256103),
7001                Some(16256104),
7002                Some(16256105),
7003                Some(16256106),
7004                Some(16256107),
7005                Some(16256108),
7006                Some(16256109),
7007                Some(16256110),
7008                Some(16256111),
7009                Some(16256112),
7010                Some(16256113),
7011                Some(16256114),
7012                Some(16256115),
7013                Some(16256116),
7014                Some(16256117),
7015                Some(16256118),
7016                Some(16256119),
7017                Some(16256120),
7018                Some(16256121),
7019                Some(16256122),
7020                Some(16256123),
7021                Some(16256124),
7022                Some(16256125),
7023                Some(16256126),
7024                Some(16256127),
7025                Some(16256128),
7026                None,
7027                None,
7028                None,
7029                None,
7030                None,
7031                None
7032            ]
7033        );
7034        let rp: Vec<_> = it
7035            .next()
7036            .unwrap()
7037            .unwrap()
7038            .reference_positions_full()
7039            .collect();
7040        assert_eq!(
7041            rp,
7042            vec![
7043                None,
7044                None,
7045                None,
7046                Some(16256224),
7047                Some(16256225),
7048                Some(16256226),
7049                Some(16256227),
7050                Some(16256228),
7051                Some(16256229),
7052                Some(16256230),
7053                Some(16256231),
7054                Some(16256232),
7055                Some(16256233),
7056                Some(16256234),
7057                Some(16256235),
7058                Some(16256236),
7059                Some(16256237),
7060                Some(16256238),
7061                Some(16256239),
7062                Some(16256240),
7063                Some(16256241),
7064                Some(16256242),
7065                Some(16256243),
7066                Some(16256244),
7067                Some(16256245),
7068                Some(16256246),
7069                Some(16256247),
7070                Some(16256248),
7071                Some(16256249),
7072                Some(16256250),
7073                Some(16256251),
7074                Some(16256252),
7075                Some(16256253),
7076                Some(16256254),
7077                Some(16256255),
7078                Some(16256256),
7079                Some(16256257),
7080                Some(16256258),
7081                Some(16256259),
7082                Some(16256260),
7083                Some(16256261),
7084                Some(16256262),
7085                Some(16256263),
7086                Some(16256264),
7087                Some(16256265),
7088                Some(16256266),
7089                Some(16256267),
7090                Some(16256268),
7091                Some(16256269),
7092                Some(16256270),
7093                Some(16256271)
7094            ]
7095        );
7096        let rp: Vec<_> = it
7097            .next()
7098            .unwrap()
7099            .unwrap()
7100            .reference_positions_full()
7101            .collect();
7102        assert_eq!(
7103            rp,
7104            vec![
7105                Some(16325199),
7106                Some(16325200),
7107                Some(16325201),
7108                Some(16325202),
7109                Some(16325203),
7110                Some(16325204),
7111                Some(16325205),
7112                Some(16325206),
7113                Some(16325207),
7114                Some(16325208),
7115                Some(16325209),
7116                Some(16325210),
7117                Some(16325211),
7118                Some(16325212),
7119                Some(16325213),
7120                Some(16325214),
7121                Some(16325215),
7122                Some(16325216),
7123                Some(16325217),
7124                Some(16325218),
7125                Some(16325219),
7126                Some(16325220),
7127                Some(16325221),
7128                Some(16325222),
7129                Some(16325223),
7130                Some(16325224),
7131                Some(16325225),
7132                Some(16325226),
7133                Some(16325227),
7134                Some(16325228),
7135                Some(16325229),
7136                Some(16325230),
7137                Some(16325231),
7138                Some(16325232),
7139                Some(16325233),
7140                Some(16325234),
7141                Some(16325235),
7142                Some(16325236),
7143                Some(16325237),
7144                Some(16325238),
7145                Some(16325239),
7146                Some(16325240),
7147                None,
7148                None,
7149                None,
7150                None,
7151                None,
7152                None,
7153                None,
7154                None,
7155                None
7156            ]
7157        );
7158        let rp: Vec<_> = it
7159            .next()
7160            .unwrap()
7161            .unwrap()
7162            .reference_positions_full()
7163            .collect();
7164        assert_eq!(
7165            rp,
7166            vec![
7167                None,
7168                None,
7169                None,
7170                None,
7171                None,
7172                None,
7173                None,
7174                None,
7175                None,
7176                None,
7177                None,
7178                None,
7179                None,
7180                Some(16352865),
7181                Some(16352866),
7182                Some(16352867),
7183                Some(16352868),
7184                Some(16352869),
7185                Some(16352870),
7186                Some(16352871),
7187                Some(16352872),
7188                Some(16352873),
7189                Some(16352874),
7190                Some(16352875),
7191                Some(16352876),
7192                Some(16352877),
7193                Some(16352878),
7194                Some(16352879),
7195                Some(16352880),
7196                Some(16352881),
7197                Some(16352882),
7198                Some(16352883),
7199                Some(16352884),
7200                Some(16352885),
7201                Some(16352886),
7202                Some(16352887),
7203                Some(16352888),
7204                Some(16352889),
7205                Some(16352890),
7206                Some(16352891),
7207                Some(16352892),
7208                Some(16352893),
7209                Some(16352894),
7210                Some(16352895),
7211                Some(16352896),
7212                Some(16352897),
7213                Some(16352898),
7214                Some(16352899),
7215                Some(16352900),
7216                Some(16352901),
7217                Some(16352902)
7218            ]
7219        );
7220        let rp: Vec<_> = it
7221            .next()
7222            .unwrap()
7223            .unwrap()
7224            .reference_positions_full()
7225            .collect();
7226        assert_eq!(
7227            rp,
7228            vec![
7229                Some(16352968),
7230                Some(16352969),
7231                Some(16352970),
7232                Some(16352971),
7233                Some(16352972),
7234                Some(16352973),
7235                Some(16352974),
7236                Some(16352975),
7237                Some(16352976),
7238                Some(16352977),
7239                Some(16352978),
7240                Some(16352979),
7241                Some(16352980),
7242                Some(16352981),
7243                Some(16352982),
7244                Some(16352983),
7245                Some(16352984),
7246                Some(16352985),
7247                Some(16352986),
7248                Some(16352987),
7249                Some(16352988),
7250                Some(16352989),
7251                Some(16352990),
7252                Some(16352991),
7253                Some(16352992),
7254                Some(16352993),
7255                Some(16352994),
7256                Some(16352995),
7257                Some(16352996),
7258                Some(16352997),
7259                Some(16352998),
7260                Some(16352999),
7261                Some(16353000),
7262                Some(16353001),
7263                Some(16353002),
7264                Some(16353003),
7265                Some(16353004),
7266                Some(16353005),
7267                Some(16353006),
7268                Some(16353007),
7269                Some(16353008),
7270                Some(16353009),
7271                Some(16353010),
7272                Some(16353011),
7273                None,
7274                None,
7275                None,
7276                None,
7277                None,
7278                None,
7279                None
7280            ]
7281        );
7282        let rp: Vec<_> = it
7283            .next()
7284            .unwrap()
7285            .unwrap()
7286            .reference_positions_full()
7287            .collect();
7288        assert_eq!(
7289            rp,
7290            vec![
7291                None,
7292                None,
7293                None,
7294                None,
7295                None,
7296                Some(16414998),
7297                Some(16414999),
7298                Some(16415000),
7299                Some(16415001),
7300                Some(16415002),
7301                Some(16415003),
7302                Some(16415004),
7303                Some(16415005),
7304                Some(16415006),
7305                Some(16415007),
7306                Some(16415008),
7307                Some(16415009),
7308                Some(16415010),
7309                Some(16415011),
7310                Some(16415012),
7311                Some(16415013),
7312                Some(16415014),
7313                Some(16415015),
7314                Some(16415016),
7315                Some(16415017),
7316                Some(16415018),
7317                Some(16415019),
7318                Some(16415020),
7319                Some(16415021),
7320                Some(16415022),
7321                Some(16415023),
7322                Some(16415024),
7323                Some(16415025),
7324                Some(16415026),
7325                Some(16415027),
7326                Some(16415028),
7327                Some(16415029),
7328                Some(16415030),
7329                Some(16415031),
7330                Some(16415032),
7331                Some(16415033),
7332                Some(16415034),
7333                Some(16415035),
7334                Some(16415036),
7335                Some(16415037),
7336                Some(16415038),
7337                Some(16415039),
7338                Some(16415040),
7339                Some(16415041),
7340                Some(16415042),
7341                Some(16415043)
7342            ]
7343        );
7344        let rp: Vec<_> = it
7345            .next()
7346            .unwrap()
7347            .unwrap()
7348            .reference_positions_full()
7349            .collect();
7350        assert_eq!(
7351            rp,
7352            vec![
7353                Some(17031591),
7354                Some(17031592),
7355                Some(17031593),
7356                Some(17031594),
7357                Some(17031595),
7358                Some(17031596),
7359                Some(17031597),
7360                Some(17031598),
7361                Some(17031599),
7362                Some(17031600),
7363                Some(17031601),
7364                Some(17031602),
7365                Some(17031603),
7366                Some(17031604),
7367                Some(17031605),
7368                Some(17031606),
7369                Some(17031607),
7370                Some(17031608),
7371                Some(17031609),
7372                Some(17031610),
7373                Some(17031611),
7374                Some(17031612),
7375                Some(17031613),
7376                None,
7377                None,
7378                None,
7379                None,
7380                Some(17031614),
7381                Some(17031615),
7382                Some(17031616),
7383                Some(17031617),
7384                Some(17031618),
7385                Some(17031619),
7386                Some(17031620),
7387                Some(17031621),
7388                Some(17031622),
7389                Some(17031623),
7390                Some(17031624),
7391                Some(17031625),
7392                Some(17031626),
7393                Some(17031627),
7394                Some(17031628),
7395                Some(17031629),
7396                Some(17031630),
7397                Some(17031631),
7398                Some(17031632),
7399                Some(17031633),
7400                Some(17031634),
7401                Some(17031635),
7402                Some(17031636),
7403                Some(17031637)
7404            ]
7405        );
7406        let rp: Vec<_> = it
7407            .next()
7408            .unwrap()
7409            .unwrap()
7410            .reference_positions_full()
7411            .collect();
7412        assert_eq!(
7413            rp,
7414            vec![
7415                Some(17057382),
7416                Some(17057383),
7417                Some(17057384),
7418                Some(17057385),
7419                Some(17057386),
7420                Some(17057387),
7421                Some(17057388),
7422                Some(17057389),
7423                Some(17057390),
7424                Some(17057391),
7425                Some(17057392),
7426                Some(17057393),
7427                Some(17057394),
7428                Some(17057395),
7429                Some(17057396),
7430                Some(17057397),
7431                Some(17057398),
7432                Some(17057399),
7433                None,
7434                Some(17057400),
7435                Some(17057401),
7436                Some(17057402),
7437                Some(17057403),
7438                Some(17057404),
7439                Some(17057405),
7440                Some(17057406),
7441                Some(17057407),
7442                Some(17057408),
7443                Some(17057409),
7444                Some(17057410),
7445                Some(17057411),
7446                Some(17057412),
7447                Some(17057413),
7448                Some(17057414),
7449                Some(17057415),
7450                Some(17057416),
7451                Some(17057417),
7452                Some(17057418),
7453                Some(17057419),
7454                Some(17057420),
7455                Some(17057421),
7456                Some(17057422),
7457                Some(17057423),
7458                Some(17057424),
7459                Some(17057425),
7460                Some(17057426),
7461                Some(17057427),
7462                Some(17057428),
7463                Some(17057429),
7464                Some(17057430),
7465                Some(17057431)
7466            ]
7467        );
7468        let rp: Vec<_> = it
7469            .next()
7470            .unwrap()
7471            .unwrap()
7472            .reference_positions_full()
7473            .collect();
7474        assert_eq!(
7475            rp,
7476            vec![
7477                Some(17092766),
7478                Some(17092767),
7479                Some(17092768),
7480                Some(17092769),
7481                Some(17092770),
7482                Some(17092771),
7483                Some(17092772),
7484                Some(17092773),
7485                Some(17092774),
7486                Some(17092775),
7487                Some(17092776),
7488                Some(17092777),
7489                Some(17092778),
7490                Some(17092779),
7491                Some(17092780),
7492                Some(17092781),
7493                Some(17092782),
7494                Some(17094966),
7495                Some(17094967),
7496                Some(17094968),
7497                Some(17094969),
7498                Some(17094970),
7499                Some(17094971),
7500                Some(17094972),
7501                Some(17094973),
7502                Some(17094974),
7503                Some(17094975),
7504                Some(17094976),
7505                Some(17094977),
7506                Some(17094978),
7507                Some(17094979),
7508                Some(17094980),
7509                Some(17094981),
7510                Some(17094982),
7511                Some(17094983),
7512                Some(17094984),
7513                Some(17094985),
7514                Some(17094986),
7515                Some(17094987),
7516                Some(17094988),
7517                Some(17094989),
7518                Some(17094990),
7519                Some(17094991),
7520                Some(17094992),
7521                Some(17094993),
7522                Some(17094994),
7523                Some(17094995),
7524                Some(17094996),
7525                Some(17094997),
7526                Some(17094998),
7527                Some(17094999)
7528            ]
7529        );
7530        let rp: Vec<_> = it
7531            .next()
7532            .unwrap()
7533            .unwrap()
7534            .reference_positions_full()
7535            .collect();
7536        assert_eq!(
7537            rp,
7538            vec![
7539                Some(17092782),
7540                Some(17094966),
7541                Some(17094967),
7542                Some(17094968),
7543                Some(17094969),
7544                Some(17094970),
7545                Some(17094971),
7546                Some(17094972),
7547                Some(17094973),
7548                Some(17094974),
7549                Some(17094975),
7550                Some(17094976),
7551                Some(17094977),
7552                Some(17094978),
7553                Some(17094979),
7554                Some(17094980),
7555                Some(17094981),
7556                Some(17094982),
7557                Some(17094983),
7558                Some(17094984),
7559                Some(17094985),
7560                Some(17094986),
7561                Some(17094987),
7562                Some(17094988),
7563                Some(17094989),
7564                Some(17094990),
7565                Some(17094991),
7566                Some(17094992),
7567                Some(17094993),
7568                Some(17094994),
7569                Some(17094995),
7570                Some(17094996),
7571                Some(17094997),
7572                Some(17094998),
7573                Some(17094999),
7574                Some(17095000),
7575                Some(17095001),
7576                Some(17095002),
7577                Some(17095003),
7578                Some(17095004),
7579                Some(17095005),
7580                Some(17095006),
7581                Some(17095007),
7582                Some(17095008),
7583                Some(17095009),
7584                Some(17095010),
7585                Some(17095011),
7586                Some(17095012),
7587                Some(17095013),
7588                Some(17095014),
7589                Some(17095015)
7590            ]
7591        );
7592        let rp: Vec<_> = it
7593            .next()
7594            .unwrap()
7595            .unwrap()
7596            .reference_positions_full()
7597            .collect();
7598        assert_eq!(
7599            rp,
7600            vec![
7601                Some(17092782),
7602                Some(17094966),
7603                Some(17094967),
7604                Some(17094968),
7605                Some(17094969),
7606                Some(17094970),
7607                Some(17094971),
7608                Some(17094972),
7609                Some(17094973),
7610                Some(17094974),
7611                Some(17094975),
7612                Some(17094976),
7613                Some(17094977),
7614                Some(17094978),
7615                Some(17094979),
7616                Some(17094980),
7617                Some(17094981),
7618                Some(17094982),
7619                Some(17094983),
7620                Some(17094984),
7621                Some(17094985),
7622                Some(17094986),
7623                Some(17094987),
7624                Some(17094988),
7625                Some(17094989),
7626                Some(17094990),
7627                Some(17094991),
7628                Some(17094992),
7629                Some(17094993),
7630                Some(17094994),
7631                Some(17094995),
7632                Some(17094996),
7633                Some(17094997),
7634                Some(17094998),
7635                Some(17094999),
7636                Some(17095000),
7637                Some(17095001),
7638                Some(17095002),
7639                Some(17095003),
7640                Some(17095004),
7641                Some(17095005),
7642                Some(17095006),
7643                Some(17095007),
7644                Some(17095008),
7645                Some(17095009),
7646                Some(17095010),
7647                Some(17095011),
7648                Some(17095012),
7649                Some(17095013),
7650                Some(17095014),
7651                Some(17095015)
7652            ]
7653        );
7654        let rp: Vec<_> = it
7655            .next()
7656            .unwrap()
7657            .unwrap()
7658            .reference_positions_full()
7659            .collect();
7660        assert_eq!(
7661            rp,
7662            vec![
7663                None,
7664                None,
7665                None,
7666                None,
7667                None,
7668                None,
7669                None,
7670                None,
7671                None,
7672                Some(17137287),
7673                Some(17137288),
7674                Some(17137289),
7675                Some(17137290),
7676                Some(17137291),
7677                Some(17137292),
7678                Some(17137293),
7679                Some(17137294),
7680                Some(17137295),
7681                Some(17137296),
7682                Some(17137297),
7683                Some(17137298),
7684                Some(17137299),
7685                Some(17137300),
7686                Some(17137301),
7687                Some(17137302),
7688                Some(17137303),
7689                Some(17137304),
7690                Some(17137305),
7691                Some(17137306),
7692                Some(17137307),
7693                Some(17137308),
7694                Some(17137309),
7695                Some(17137310),
7696                Some(17137311),
7697                Some(17137312),
7698                Some(17137313),
7699                Some(17137314),
7700                Some(17137315),
7701                Some(17137316),
7702                Some(17137317),
7703                Some(17137318),
7704                Some(17137319),
7705                None,
7706                None,
7707                None,
7708                None,
7709                None,
7710                None,
7711                None,
7712                None,
7713                None
7714            ]
7715        );
7716        let rp: Vec<_> = it
7717            .next()
7718            .unwrap()
7719            .unwrap()
7720            .reference_positions_full()
7721            .collect();
7722        assert_eq!(
7723            rp,
7724            vec![
7725                None,
7726                None,
7727                Some(17306238),
7728                Some(17306239),
7729                Some(17306240),
7730                Some(17306241),
7731                Some(17306242),
7732                Some(17306243),
7733                Some(17306244),
7734                Some(17306245),
7735                Some(17306246),
7736                Some(17306247),
7737                Some(17306248),
7738                Some(17306249),
7739                Some(17306250),
7740                Some(17306251),
7741                Some(17306252),
7742                Some(17306253),
7743                Some(17306254),
7744                Some(17306255),
7745                Some(17306256),
7746                Some(17306257),
7747                Some(17306258),
7748                Some(17306259),
7749                Some(17306260),
7750                Some(17306261),
7751                Some(17306262),
7752                Some(17306263),
7753                Some(17306264),
7754                Some(17306265),
7755                Some(17306266),
7756                Some(17306267),
7757                Some(17306268),
7758                Some(17306269),
7759                Some(17306270),
7760                Some(17306271),
7761                Some(17306272),
7762                Some(17306273),
7763                Some(17306274),
7764                Some(17306275),
7765                Some(17306276),
7766                Some(17306277),
7767                Some(17306278),
7768                Some(17306279),
7769                Some(17306280),
7770                Some(17306281),
7771                Some(17306282),
7772                Some(17306283),
7773                Some(17306284),
7774                Some(17306285),
7775                None
7776            ]
7777        );
7778        let rp: Vec<_> = it
7779            .next()
7780            .unwrap()
7781            .unwrap()
7782            .reference_positions_full()
7783            .collect();
7784        assert_eq!(
7785            rp,
7786            vec![
7787                None,
7788                None,
7789                None,
7790                None,
7791                Some(17561868),
7792                Some(17561869),
7793                Some(17561870),
7794                Some(17561871),
7795                Some(17561872),
7796                Some(17561873),
7797                Some(17561874),
7798                Some(17561875),
7799                Some(17561876),
7800                Some(17561877),
7801                Some(17561878),
7802                Some(17561879),
7803                Some(17561880),
7804                Some(17561881),
7805                Some(17561882),
7806                Some(17561883),
7807                Some(17561884),
7808                Some(17561885),
7809                Some(17561886),
7810                Some(17561887),
7811                Some(17561888),
7812                Some(17561889),
7813                Some(17561890),
7814                Some(17561891),
7815                Some(17561892),
7816                Some(17561893),
7817                Some(17561894),
7818                Some(17561895),
7819                Some(17561896),
7820                Some(17561897),
7821                Some(17561898),
7822                Some(17561899),
7823                Some(17561900),
7824                Some(17561901),
7825                Some(17561902),
7826                Some(17561903),
7827                Some(17561904),
7828                Some(17561905),
7829                Some(17561906),
7830                Some(17561907),
7831                Some(17561908),
7832                Some(17561909),
7833                Some(17561910),
7834                Some(17561911),
7835                Some(17561912),
7836                None,
7837                None
7838            ]
7839        );
7840        let rp: Vec<_> = it
7841            .next()
7842            .unwrap()
7843            .unwrap()
7844            .reference_positions_full()
7845            .collect();
7846        assert_eq!(
7847            rp,
7848            vec![
7849                Some(17566078),
7850                Some(17566079),
7851                Some(17566080),
7852                Some(17566081),
7853                Some(17566082),
7854                Some(17566083),
7855                Some(17566084),
7856                Some(17566085),
7857                Some(17566086),
7858                Some(17566087),
7859                Some(17566088),
7860                Some(17566089),
7861                Some(17566090),
7862                Some(17566091),
7863                Some(17566092),
7864                Some(17566093),
7865                Some(17566094),
7866                Some(17566095),
7867                Some(17566096),
7868                Some(17566097),
7869                Some(17566098),
7870                Some(17566099),
7871                Some(17566100),
7872                Some(17566101),
7873                Some(17566102),
7874                Some(17566103),
7875                Some(17566104),
7876                Some(17566105),
7877                Some(17566106),
7878                Some(17566107),
7879                Some(17566108),
7880                Some(17566109),
7881                Some(17566110),
7882                Some(17566111),
7883                Some(17566112),
7884                Some(17566113),
7885                Some(17566114),
7886                Some(17566115),
7887                Some(17566116),
7888                Some(17566117),
7889                Some(17566118),
7890                Some(17577951),
7891                Some(17577952),
7892                Some(17577953),
7893                Some(17577954),
7894                Some(17577955),
7895                Some(17577956),
7896                Some(17577957),
7897                Some(17577958),
7898                Some(17577959),
7899                Some(17577960)
7900            ]
7901        );
7902        let rp: Vec<_> = it
7903            .next()
7904            .unwrap()
7905            .unwrap()
7906            .reference_positions_full()
7907            .collect();
7908        assert_eq!(
7909            rp,
7910            vec![
7911                Some(17566108),
7912                Some(17566109),
7913                Some(17566110),
7914                Some(17566111),
7915                Some(17566112),
7916                Some(17566113),
7917                Some(17566114),
7918                Some(17566115),
7919                Some(17566116),
7920                Some(17566117),
7921                Some(17566118),
7922                Some(17577951),
7923                Some(17577952),
7924                Some(17577953),
7925                Some(17577954),
7926                Some(17577955),
7927                Some(17577956),
7928                Some(17577957),
7929                Some(17577958),
7930                Some(17577959),
7931                Some(17577960),
7932                Some(17577961),
7933                Some(17577962),
7934                Some(17577963),
7935                Some(17577964),
7936                Some(17577965),
7937                Some(17577966),
7938                Some(17577967),
7939                Some(17577968),
7940                Some(17577969),
7941                Some(17577970),
7942                Some(17577971),
7943                Some(17577972),
7944                Some(17577973),
7945                Some(17577974),
7946                Some(17577975),
7947                Some(17578686),
7948                Some(17578687),
7949                Some(17578688),
7950                Some(17578689),
7951                Some(17578690),
7952                Some(17578691),
7953                Some(17578692),
7954                Some(17578693),
7955                Some(17578694),
7956                Some(17578695),
7957                Some(17578696),
7958                Some(17578697),
7959                Some(17578698),
7960                Some(17578699),
7961                Some(17578700)
7962            ]
7963        );
7964        let rp: Vec<_> = it
7965            .next()
7966            .unwrap()
7967            .unwrap()
7968            .reference_positions_full()
7969            .collect();
7970        assert_eq!(
7971            rp,
7972            vec![
7973                Some(17566111),
7974                Some(17566112),
7975                Some(17566113),
7976                Some(17566114),
7977                Some(17566115),
7978                Some(17566116),
7979                Some(17566117),
7980                Some(17566118),
7981                Some(17577951),
7982                Some(17577952),
7983                Some(17577953),
7984                Some(17577954),
7985                Some(17577955),
7986                Some(17577956),
7987                Some(17577957),
7988                Some(17577958),
7989                Some(17577959),
7990                Some(17577960),
7991                Some(17577961),
7992                Some(17577962),
7993                Some(17577963),
7994                Some(17577964),
7995                Some(17577965),
7996                Some(17577966),
7997                Some(17577967),
7998                Some(17577968),
7999                Some(17577969),
8000                Some(17577970),
8001                Some(17577971),
8002                Some(17577972),
8003                Some(17577973),
8004                Some(17577974),
8005                Some(17577975),
8006                Some(17578686),
8007                Some(17578687),
8008                Some(17578688),
8009                Some(17578689),
8010                Some(17578690),
8011                Some(17578691),
8012                Some(17578692),
8013                Some(17578693),
8014                Some(17578694),
8015                Some(17578695),
8016                Some(17578696),
8017                Some(17578697),
8018                Some(17578698),
8019                Some(17578699),
8020                Some(17578700),
8021                Some(17578701),
8022                Some(17578702),
8023                Some(17578703)
8024            ]
8025        );
8026        let rp: Vec<_> = it
8027            .next()
8028            .unwrap()
8029            .unwrap()
8030            .reference_positions_full()
8031            .collect();
8032        assert_eq!(
8033            rp,
8034            vec![
8035                Some(17566111),
8036                Some(17566112),
8037                Some(17566113),
8038                Some(17566114),
8039                Some(17566115),
8040                Some(17566116),
8041                Some(17566117),
8042                Some(17566118),
8043                Some(17577951),
8044                Some(17577952),
8045                Some(17577953),
8046                Some(17577954),
8047                Some(17577955),
8048                Some(17577956),
8049                Some(17577957),
8050                Some(17577958),
8051                Some(17577959),
8052                Some(17577960),
8053                Some(17577961),
8054                Some(17577962),
8055                Some(17577963),
8056                Some(17577964),
8057                Some(17577965),
8058                Some(17577966),
8059                Some(17577967),
8060                Some(17577968),
8061                Some(17577969),
8062                Some(17577970),
8063                Some(17577971),
8064                Some(17577972),
8065                Some(17577973),
8066                Some(17577974),
8067                Some(17577975),
8068                Some(17578686),
8069                Some(17578687),
8070                Some(17578688),
8071                Some(17578689),
8072                Some(17578690),
8073                Some(17578691),
8074                Some(17578692),
8075                Some(17578693),
8076                Some(17578694),
8077                Some(17578695),
8078                Some(17578696),
8079                Some(17578697),
8080                Some(17578698),
8081                Some(17578699),
8082                Some(17578700),
8083                Some(17578701),
8084                Some(17578702),
8085                Some(17578703)
8086            ]
8087        );
8088        let rp: Vec<_> = it
8089            .next()
8090            .unwrap()
8091            .unwrap()
8092            .reference_positions_full()
8093            .collect();
8094        assert_eq!(
8095            rp,
8096            vec![
8097                Some(17566111),
8098                Some(17566112),
8099                Some(17566113),
8100                Some(17566114),
8101                Some(17566115),
8102                Some(17566116),
8103                Some(17566117),
8104                Some(17566118),
8105                Some(17577951),
8106                Some(17577952),
8107                Some(17577953),
8108                Some(17577954),
8109                Some(17577955),
8110                Some(17577956),
8111                Some(17577957),
8112                Some(17577958),
8113                Some(17577959),
8114                Some(17577960),
8115                Some(17577961),
8116                Some(17577962),
8117                Some(17577963),
8118                Some(17577964),
8119                Some(17577965),
8120                Some(17577966),
8121                Some(17577967),
8122                Some(17577968),
8123                Some(17577969),
8124                Some(17577970),
8125                Some(17577971),
8126                Some(17577972),
8127                Some(17577973),
8128                Some(17577974),
8129                Some(17577975),
8130                Some(17578686),
8131                Some(17578687),
8132                Some(17578688),
8133                Some(17578689),
8134                Some(17578690),
8135                Some(17578691),
8136                Some(17578692),
8137                Some(17578693),
8138                Some(17578694),
8139                Some(17578695),
8140                Some(17578696),
8141                Some(17578697),
8142                Some(17578698),
8143                Some(17578699),
8144                Some(17578700),
8145                Some(17578701),
8146                Some(17578702),
8147                Some(17578703)
8148            ]
8149        );
8150        let rp: Vec<_> = it
8151            .next()
8152            .unwrap()
8153            .unwrap()
8154            .reference_positions_full()
8155            .collect();
8156        assert_eq!(
8157            rp,
8158            vec![
8159                Some(17566111),
8160                Some(17566112),
8161                Some(17566113),
8162                Some(17566114),
8163                Some(17566115),
8164                Some(17566116),
8165                Some(17566117),
8166                Some(17566118),
8167                Some(17577951),
8168                Some(17577952),
8169                Some(17577953),
8170                Some(17577954),
8171                Some(17577955),
8172                Some(17577956),
8173                Some(17577957),
8174                Some(17577958),
8175                Some(17577959),
8176                Some(17577960),
8177                Some(17577961),
8178                Some(17577962),
8179                Some(17577963),
8180                Some(17577964),
8181                Some(17577965),
8182                Some(17577966),
8183                Some(17577967),
8184                Some(17577968),
8185                Some(17577969),
8186                Some(17577970),
8187                Some(17577971),
8188                Some(17577972),
8189                Some(17577973),
8190                Some(17577974),
8191                Some(17577975),
8192                Some(17578686),
8193                Some(17578687),
8194                Some(17578688),
8195                Some(17578689),
8196                Some(17578690),
8197                Some(17578691),
8198                Some(17578692),
8199                Some(17578693),
8200                Some(17578694),
8201                Some(17578695),
8202                Some(17578696),
8203                Some(17578697),
8204                Some(17578698),
8205                Some(17578699),
8206                Some(17578700),
8207                Some(17578701),
8208                Some(17578702),
8209                Some(17578703)
8210            ]
8211        );
8212        let rp: Vec<_> = it
8213            .next()
8214            .unwrap()
8215            .unwrap()
8216            .reference_positions_full()
8217            .collect();
8218        assert_eq!(
8219            rp,
8220            vec![
8221                Some(17566112),
8222                Some(17566113),
8223                Some(17566114),
8224                Some(17566115),
8225                Some(17566116),
8226                Some(17566117),
8227                Some(17566118),
8228                Some(17577951),
8229                Some(17577952),
8230                Some(17577953),
8231                Some(17577954),
8232                Some(17577955),
8233                Some(17577956),
8234                Some(17577957),
8235                Some(17577958),
8236                Some(17577959),
8237                Some(17577960),
8238                Some(17577961),
8239                Some(17577962),
8240                Some(17577963),
8241                Some(17577964),
8242                Some(17577965),
8243                Some(17577966),
8244                Some(17577967),
8245                Some(17577968),
8246                Some(17577969),
8247                Some(17577970),
8248                Some(17577971),
8249                Some(17577972),
8250                Some(17577973),
8251                Some(17577974),
8252                Some(17577975),
8253                Some(17578686),
8254                Some(17578687),
8255                Some(17578688),
8256                Some(17578689),
8257                Some(17578690),
8258                Some(17578691),
8259                Some(17578692),
8260                Some(17578693),
8261                Some(17578694),
8262                Some(17578695),
8263                Some(17578696),
8264                Some(17578697),
8265                Some(17578698),
8266                Some(17578699),
8267                Some(17578700),
8268                Some(17578701),
8269                Some(17578702),
8270                Some(17578703),
8271                Some(17578704)
8272            ]
8273        );
8274        let rp: Vec<_> = it
8275            .next()
8276            .unwrap()
8277            .unwrap()
8278            .reference_positions_full()
8279            .collect();
8280        assert_eq!(
8281            rp,
8282            vec![
8283                Some(17566113),
8284                Some(17566114),
8285                Some(17566115),
8286                Some(17566116),
8287                Some(17566117),
8288                Some(17566118),
8289                Some(17577951),
8290                Some(17577952),
8291                Some(17577953),
8292                Some(17577954),
8293                Some(17577955),
8294                Some(17577956),
8295                Some(17577957),
8296                Some(17577958),
8297                Some(17577959),
8298                Some(17577960),
8299                Some(17577961),
8300                Some(17577962),
8301                Some(17577963),
8302                Some(17577964),
8303                Some(17577965),
8304                Some(17577966),
8305                Some(17577967),
8306                Some(17577968),
8307                Some(17577969),
8308                Some(17577970),
8309                Some(17577971),
8310                Some(17577972),
8311                Some(17577973),
8312                Some(17577974),
8313                Some(17577975),
8314                Some(17578686),
8315                Some(17578687),
8316                Some(17578688),
8317                Some(17578689),
8318                Some(17578690),
8319                Some(17578691),
8320                Some(17578692),
8321                Some(17578693),
8322                Some(17578694),
8323                Some(17578695),
8324                Some(17578696),
8325                Some(17578697),
8326                Some(17578698),
8327                Some(17578699),
8328                Some(17578700),
8329                Some(17578701),
8330                Some(17578702),
8331                Some(17578703),
8332                Some(17578704),
8333                Some(17578705)
8334            ]
8335        );
8336        let rp: Vec<_> = it
8337            .next()
8338            .unwrap()
8339            .unwrap()
8340            .reference_positions_full()
8341            .collect();
8342        assert_eq!(
8343            rp,
8344            vec![
8345                Some(17566113),
8346                Some(17566114),
8347                Some(17566115),
8348                Some(17566116),
8349                Some(17566117),
8350                Some(17566118),
8351                Some(17577951),
8352                Some(17577952),
8353                Some(17577953),
8354                Some(17577954),
8355                Some(17577955),
8356                Some(17577956),
8357                Some(17577957),
8358                Some(17577958),
8359                Some(17577959),
8360                Some(17577960),
8361                Some(17577961),
8362                Some(17577962),
8363                Some(17577963),
8364                Some(17577964),
8365                Some(17577965),
8366                Some(17577966),
8367                Some(17577967),
8368                Some(17577968),
8369                Some(17577969),
8370                Some(17577970),
8371                Some(17577971),
8372                Some(17577972),
8373                Some(17577973),
8374                Some(17577974),
8375                Some(17577975),
8376                Some(17578686),
8377                Some(17578687),
8378                Some(17578688),
8379                Some(17578689),
8380                Some(17578690),
8381                Some(17578691),
8382                Some(17578692),
8383                Some(17578693),
8384                Some(17578694),
8385                Some(17578695),
8386                Some(17578696),
8387                Some(17578697),
8388                Some(17578698),
8389                Some(17578699),
8390                Some(17578700),
8391                Some(17578701),
8392                Some(17578702),
8393                Some(17578703),
8394                Some(17578704),
8395                Some(17578705)
8396            ]
8397        );
8398        let rp: Vec<_> = it
8399            .next()
8400            .unwrap()
8401            .unwrap()
8402            .reference_positions_full()
8403            .collect();
8404        assert_eq!(
8405            rp,
8406            vec![
8407                None,
8408                Some(17579733),
8409                Some(17579734),
8410                Some(17579735),
8411                Some(17579736),
8412                Some(17579737),
8413                Some(17579738),
8414                Some(17579739),
8415                Some(17579740),
8416                Some(17579741),
8417                Some(17579742),
8418                Some(17579743),
8419                Some(17579744),
8420                Some(17579745),
8421                Some(17579746),
8422                Some(17579747),
8423                Some(17579748),
8424                Some(17579749),
8425                Some(17579750),
8426                Some(17579751),
8427                Some(17579752),
8428                Some(17579753),
8429                Some(17579754),
8430                Some(17579755),
8431                Some(17579756),
8432                Some(17579757),
8433                Some(17579758),
8434                Some(17579759),
8435                Some(17579760),
8436                Some(17579761),
8437                Some(17579762),
8438                Some(17579763),
8439                Some(17579764),
8440                Some(17579765),
8441                Some(17579766),
8442                Some(17579767),
8443                Some(17579768),
8444                Some(17579769),
8445                Some(17579770),
8446                Some(17579771),
8447                Some(17579772),
8448                Some(17579773),
8449                Some(17579774),
8450                Some(17579775),
8451                Some(17579776),
8452                Some(17581244),
8453                Some(17581245),
8454                Some(17581246),
8455                Some(17581247),
8456                Some(17581248),
8457                Some(17581249)
8458            ]
8459        );
8460        let rp: Vec<_> = it
8461            .next()
8462            .unwrap()
8463            .unwrap()
8464            .reference_positions_full()
8465            .collect();
8466        assert_eq!(
8467            rp,
8468            vec![
8469                Some(17581369),
8470                Some(17581370),
8471                Some(17582885),
8472                Some(17582886),
8473                Some(17582887),
8474                Some(17582888),
8475                Some(17582889),
8476                Some(17582890),
8477                Some(17582891),
8478                Some(17582892),
8479                Some(17582893),
8480                Some(17582894),
8481                Some(17582895),
8482                Some(17582896),
8483                Some(17582897),
8484                Some(17582898),
8485                Some(17582899),
8486                Some(17582900),
8487                Some(17582901),
8488                Some(17582902),
8489                Some(17582903),
8490                Some(17582904),
8491                Some(17582905),
8492                Some(17582906),
8493                Some(17582907),
8494                Some(17582908),
8495                Some(17582909),
8496                Some(17582910),
8497                Some(17582911),
8498                Some(17582912),
8499                Some(17582913),
8500                Some(17582914),
8501                Some(17582915),
8502                Some(17582916),
8503                Some(17582917),
8504                Some(17582918),
8505                Some(17582919),
8506                Some(17582920),
8507                Some(17582921),
8508                Some(17582922),
8509                Some(17582923),
8510                Some(17582924),
8511                Some(17582925),
8512                Some(17582926),
8513                Some(17582927),
8514                Some(17582928),
8515                Some(17582929),
8516                Some(17582930),
8517                Some(17582931),
8518                Some(17582932),
8519                Some(17583028)
8520            ]
8521        );
8522        let rp: Vec<_> = it
8523            .next()
8524            .unwrap()
8525            .unwrap()
8526            .reference_positions_full()
8527            .collect();
8528        assert_eq!(
8529            rp,
8530            vec![
8531                Some(17581370),
8532                Some(17582885),
8533                Some(17582886),
8534                Some(17582887),
8535                Some(17582888),
8536                Some(17582889),
8537                Some(17582890),
8538                Some(17582891),
8539                Some(17582892),
8540                Some(17582893),
8541                Some(17582894),
8542                Some(17582895),
8543                Some(17582896),
8544                Some(17582897),
8545                Some(17582898),
8546                Some(17582899),
8547                Some(17582900),
8548                Some(17582901),
8549                Some(17582902),
8550                Some(17582903),
8551                Some(17582904),
8552                Some(17582905),
8553                Some(17582906),
8554                Some(17582907),
8555                Some(17582908),
8556                Some(17582909),
8557                Some(17582910),
8558                Some(17582911),
8559                Some(17582912),
8560                Some(17582913),
8561                Some(17582914),
8562                Some(17582915),
8563                Some(17582916),
8564                Some(17582917),
8565                Some(17582918),
8566                Some(17582919),
8567                Some(17582920),
8568                Some(17582921),
8569                Some(17582922),
8570                Some(17582923),
8571                Some(17582924),
8572                Some(17582925),
8573                Some(17582926),
8574                Some(17582927),
8575                Some(17582928),
8576                Some(17582929),
8577                Some(17582930),
8578                Some(17582931),
8579                Some(17582932),
8580                Some(17583028),
8581                Some(17583029)
8582            ]
8583        );
8584        let rp: Vec<_> = it
8585            .next()
8586            .unwrap()
8587            .unwrap()
8588            .reference_positions_full()
8589            .collect();
8590        assert_eq!(
8591            rp,
8592            vec![
8593                Some(17581370),
8594                Some(17582885),
8595                Some(17582886),
8596                Some(17582887),
8597                Some(17582888),
8598                Some(17582889),
8599                Some(17582890),
8600                Some(17582891),
8601                Some(17582892),
8602                Some(17582893),
8603                Some(17582894),
8604                Some(17582895),
8605                Some(17582896),
8606                Some(17582897),
8607                Some(17582898),
8608                Some(17582899),
8609                Some(17582900),
8610                Some(17582901),
8611                Some(17582902),
8612                Some(17582903),
8613                Some(17582904),
8614                Some(17582905),
8615                Some(17582906),
8616                Some(17582907),
8617                Some(17582908),
8618                Some(17582909),
8619                Some(17582910),
8620                Some(17582911),
8621                Some(17582912),
8622                Some(17582913),
8623                Some(17582914),
8624                Some(17582915),
8625                Some(17582916),
8626                Some(17582917),
8627                Some(17582918),
8628                Some(17582919),
8629                Some(17582920),
8630                Some(17582921),
8631                Some(17582922),
8632                Some(17582923),
8633                Some(17582924),
8634                Some(17582925),
8635                Some(17582926),
8636                Some(17582927),
8637                Some(17582928),
8638                Some(17582929),
8639                Some(17582930),
8640                Some(17582931),
8641                Some(17582932),
8642                Some(17583028),
8643                Some(17583029)
8644            ]
8645        );
8646        let rp: Vec<_> = it
8647            .next()
8648            .unwrap()
8649            .unwrap()
8650            .reference_positions_full()
8651            .collect();
8652        assert_eq!(
8653            rp,
8654            vec![
8655                None,
8656                Some(17582911),
8657                Some(17582912),
8658                Some(17582913),
8659                Some(17582914),
8660                Some(17582915),
8661                Some(17582916),
8662                Some(17582917),
8663                Some(17582918),
8664                Some(17582919),
8665                Some(17582920),
8666                Some(17582921),
8667                Some(17582922),
8668                Some(17582923),
8669                Some(17582924),
8670                Some(17582925),
8671                Some(17582926),
8672                Some(17582927),
8673                Some(17582928),
8674                Some(17582929),
8675                Some(17582930),
8676                Some(17582931),
8677                Some(17582932),
8678                Some(17583028),
8679                Some(17583029),
8680                Some(17583030),
8681                Some(17583031),
8682                Some(17583032),
8683                Some(17583033),
8684                Some(17583034),
8685                Some(17583035),
8686                Some(17583036),
8687                Some(17583037),
8688                Some(17583038),
8689                Some(17583039),
8690                Some(17583040),
8691                Some(17583041),
8692                Some(17583042),
8693                Some(17583043),
8694                Some(17583044),
8695                Some(17583045),
8696                Some(17583046),
8697                Some(17583047),
8698                Some(17583048),
8699                Some(17583049),
8700                Some(17583050),
8701                Some(17583051),
8702                Some(17583052),
8703                Some(17583053),
8704                Some(17583054),
8705                Some(17583055)
8706            ]
8707        );
8708        let rp: Vec<_> = it
8709            .next()
8710            .unwrap()
8711            .unwrap()
8712            .reference_positions_full()
8713            .collect();
8714        assert_eq!(
8715            rp,
8716            vec![
8717                Some(17588621),
8718                Some(17588622),
8719                Some(17588623),
8720                Some(17588624),
8721                Some(17588625),
8722                Some(17588626),
8723                Some(17588627),
8724                Some(17588628),
8725                Some(17588629),
8726                Some(17588630),
8727                Some(17588631),
8728                Some(17588632),
8729                Some(17588633),
8730                Some(17588634),
8731                Some(17588635),
8732                Some(17588636),
8733                Some(17588637),
8734                Some(17588638),
8735                Some(17588639),
8736                Some(17588640),
8737                Some(17588641),
8738                Some(17588642),
8739                Some(17588643),
8740                Some(17588644),
8741                Some(17588645),
8742                Some(17588646),
8743                Some(17588647),
8744                Some(17588648),
8745                Some(17588649),
8746                Some(17588650),
8747                Some(17588651),
8748                Some(17588652),
8749                Some(17588653),
8750                Some(17588654),
8751                Some(17588655),
8752                Some(17588656),
8753                Some(17588657),
8754                Some(17589196),
8755                Some(17589197),
8756                Some(17589198),
8757                Some(17589199),
8758                Some(17589200),
8759                Some(17589201),
8760                Some(17589202),
8761                Some(17589203),
8762                Some(17589204),
8763                Some(17589205),
8764                Some(17589206),
8765                Some(17589207),
8766                Some(17589208),
8767                None
8768            ]
8769        );
8770        let rp: Vec<_> = it
8771            .next()
8772            .unwrap()
8773            .unwrap()
8774            .reference_positions_full()
8775            .collect();
8776        assert_eq!(
8777            rp,
8778            vec![
8779                Some(17588621),
8780                Some(17588622),
8781                Some(17588623),
8782                Some(17588624),
8783                Some(17588625),
8784                Some(17588626),
8785                Some(17588627),
8786                Some(17588628),
8787                Some(17588629),
8788                Some(17588630),
8789                Some(17588631),
8790                Some(17588632),
8791                Some(17588633),
8792                Some(17588634),
8793                Some(17588635),
8794                Some(17588636),
8795                Some(17588637),
8796                Some(17588638),
8797                Some(17588639),
8798                Some(17588640),
8799                Some(17588641),
8800                Some(17588642),
8801                Some(17588643),
8802                Some(17588644),
8803                Some(17588645),
8804                Some(17588646),
8805                Some(17588647),
8806                Some(17588648),
8807                Some(17588649),
8808                Some(17588650),
8809                Some(17588651),
8810                Some(17588652),
8811                Some(17588653),
8812                Some(17588654),
8813                Some(17588655),
8814                Some(17588656),
8815                Some(17588657),
8816                Some(17589196),
8817                Some(17589197),
8818                Some(17589198),
8819                Some(17589199),
8820                Some(17589200),
8821                Some(17589201),
8822                Some(17589202),
8823                Some(17589203),
8824                Some(17589204),
8825                Some(17589205),
8826                Some(17589206),
8827                Some(17589207),
8828                Some(17589208),
8829                None
8830            ]
8831        );
8832        let rp: Vec<_> = it
8833            .next()
8834            .unwrap()
8835            .unwrap()
8836            .reference_positions_full()
8837            .collect();
8838        assert_eq!(
8839            rp,
8840            vec![
8841                Some(17588621),
8842                Some(17588622),
8843                Some(17588623),
8844                Some(17588624),
8845                Some(17588625),
8846                Some(17588626),
8847                Some(17588627),
8848                Some(17588628),
8849                Some(17588629),
8850                Some(17588630),
8851                Some(17588631),
8852                Some(17588632),
8853                Some(17588633),
8854                Some(17588634),
8855                Some(17588635),
8856                Some(17588636),
8857                Some(17588637),
8858                Some(17588638),
8859                Some(17588639),
8860                Some(17588640),
8861                Some(17588641),
8862                Some(17588642),
8863                Some(17588643),
8864                Some(17588644),
8865                Some(17588645),
8866                Some(17588646),
8867                Some(17588647),
8868                Some(17588648),
8869                Some(17588649),
8870                Some(17588650),
8871                Some(17588651),
8872                Some(17588652),
8873                Some(17588653),
8874                Some(17588654),
8875                Some(17588655),
8876                Some(17588656),
8877                Some(17588657),
8878                Some(17589196),
8879                Some(17589197),
8880                Some(17589198),
8881                Some(17589199),
8882                Some(17589200),
8883                Some(17589201),
8884                Some(17589202),
8885                Some(17589203),
8886                Some(17589204),
8887                Some(17589205),
8888                Some(17589206),
8889                Some(17589207),
8890                Some(17589208),
8891                None
8892            ]
8893        );
8894        let rp: Vec<_> = it
8895            .next()
8896            .unwrap()
8897            .unwrap()
8898            .reference_positions_full()
8899            .collect();
8900        assert_eq!(
8901            rp,
8902            vec![
8903                None,
8904                Some(17591770),
8905                Some(17591771),
8906                Some(17591772),
8907                Some(17591773),
8908                Some(17591774),
8909                Some(17591775),
8910                Some(17591776),
8911                Some(17591777),
8912                Some(17591778),
8913                Some(17591779),
8914                Some(17591780),
8915                Some(17591781),
8916                Some(17591782),
8917                Some(17591783),
8918                Some(17591784),
8919                Some(17591785),
8920                Some(17591786),
8921                Some(17591787),
8922                Some(17591788),
8923                Some(17591789),
8924                Some(17591790),
8925                Some(17591791),
8926                Some(17591792),
8927                Some(17591793),
8928                Some(17591794),
8929                Some(17591796),
8930                Some(17591797),
8931                Some(17591798),
8932                Some(17591799),
8933                Some(17591800),
8934                Some(17591801),
8935                Some(17591802),
8936                Some(17591803),
8937                Some(17591804),
8938                Some(17591805),
8939                Some(17591806),
8940                Some(17591807),
8941                Some(17591808),
8942                Some(17591809),
8943                Some(17591810),
8944                Some(17591811),
8945                Some(17591812),
8946                Some(17591813),
8947                Some(17591814),
8948                Some(17591815),
8949                Some(17591816),
8950                Some(17591817),
8951                Some(17591818),
8952                Some(17591819),
8953                Some(17591820)
8954            ]
8955        );
8956        let rp: Vec<_> = it
8957            .next()
8958            .unwrap()
8959            .unwrap()
8960            .reference_positions_full()
8961            .collect();
8962        assert_eq!(
8963            rp,
8964            vec![
8965                Some(17593855),
8966                Some(17593856),
8967                Some(17593857),
8968                Some(17593858),
8969                Some(17593859),
8970                Some(17593860),
8971                Some(17593861),
8972                Some(17593862),
8973                Some(17593863),
8974                Some(17593864),
8975                Some(17593865),
8976                Some(17593866),
8977                Some(17593867),
8978                Some(17593868),
8979                Some(17593869),
8980                Some(17593870),
8981                Some(17593871),
8982                Some(17593872),
8983                Some(17593873),
8984                Some(17593874),
8985                Some(17593875),
8986                Some(17593876),
8987                Some(17593877),
8988                Some(17593878),
8989                Some(17593880),
8990                Some(17593881),
8991                Some(17593882),
8992                Some(17593883),
8993                Some(17593884),
8994                Some(17593885),
8995                Some(17593886),
8996                Some(17593887),
8997                Some(17593888),
8998                Some(17593889),
8999                Some(17593890),
9000                Some(17593891),
9001                Some(17593892),
9002                Some(17593893),
9003                Some(17593894),
9004                Some(17593895),
9005                Some(17593896),
9006                Some(17593897),
9007                Some(17593898),
9008                Some(17593899),
9009                Some(17593900),
9010                Some(17593901),
9011                Some(17593902),
9012                Some(17593903),
9013                None,
9014                None,
9015                None
9016            ]
9017        );
9018        let rp: Vec<_> = it
9019            .next()
9020            .unwrap()
9021            .unwrap()
9022            .reference_positions_full()
9023            .collect();
9024        assert_eq!(
9025            rp,
9026            vec![
9027                Some(17593863),
9028                Some(17593864),
9029                Some(17593865),
9030                Some(17593866),
9031                Some(17593867),
9032                Some(17593868),
9033                Some(17593869),
9034                Some(17593870),
9035                Some(17593871),
9036                Some(17593872),
9037                Some(17593873),
9038                Some(17593874),
9039                Some(17593875),
9040                Some(17593876),
9041                Some(17593877),
9042                Some(17593878),
9043                Some(17593880),
9044                Some(17593881),
9045                Some(17593882),
9046                Some(17593883),
9047                Some(17593884),
9048                Some(17593885),
9049                Some(17593886),
9050                Some(17593887),
9051                Some(17593888),
9052                Some(17593889),
9053                Some(17593890),
9054                Some(17593891),
9055                Some(17593892),
9056                Some(17593893),
9057                Some(17593894),
9058                Some(17593895),
9059                Some(17593896),
9060                Some(17593897),
9061                Some(17593898),
9062                Some(17593899),
9063                Some(17593900),
9064                Some(17593901),
9065                Some(17593902),
9066                Some(17593903),
9067                Some(17593904),
9068                Some(17593905),
9069                Some(17593906),
9070                Some(17593907),
9071                None,
9072                None,
9073                None,
9074                None,
9075                None,
9076                None,
9077                None
9078            ]
9079        );
9080        let rp: Vec<_> = it
9081            .next()
9082            .unwrap()
9083            .unwrap()
9084            .reference_positions_full()
9085            .collect();
9086        assert_eq!(
9087            rp,
9088            vec![
9089                None,
9090                None,
9091                None,
9092                None,
9093                None,
9094                None,
9095                None,
9096                None,
9097                None,
9098                None,
9099                None,
9100                Some(17596476),
9101                Some(17596477),
9102                Some(17596478),
9103                Some(17596479),
9104                Some(17596480),
9105                Some(17596481),
9106                Some(17596482),
9107                None,
9108                Some(17596483),
9109                Some(17596484),
9110                Some(17596485),
9111                Some(17596486),
9112                Some(17596487),
9113                Some(17596488),
9114                Some(17596489),
9115                Some(17596490),
9116                Some(17596491),
9117                Some(17596492),
9118                Some(17596493),
9119                Some(17596494),
9120                Some(17596495),
9121                Some(17596496),
9122                Some(17596497),
9123                Some(17596498),
9124                Some(17596499),
9125                Some(17596500),
9126                Some(17596501),
9127                Some(17596502),
9128                Some(17596503),
9129                Some(17596504),
9130                Some(17596505),
9131                Some(17596506),
9132                Some(17596507),
9133                Some(17596508),
9134                Some(17596509),
9135                Some(17596510),
9136                Some(17596511),
9137                Some(17596512),
9138                Some(17596513),
9139                Some(17596514)
9140            ]
9141        );
9142        let rp: Vec<_> = it
9143            .next()
9144            .unwrap()
9145            .unwrap()
9146            .reference_positions_full()
9147            .collect();
9148        assert_eq!(
9149            rp,
9150            vec![
9151                None,
9152                None,
9153                None,
9154                None,
9155                None,
9156                Some(17624012),
9157                Some(17624013),
9158                Some(17624014),
9159                Some(17624015),
9160                Some(17624016),
9161                Some(17624017),
9162                Some(17624018),
9163                Some(17624019),
9164                Some(17624020),
9165                Some(17625913),
9166                Some(17625914),
9167                Some(17625915),
9168                Some(17625916),
9169                Some(17625917),
9170                Some(17625918),
9171                Some(17625919),
9172                Some(17625920),
9173                Some(17625921),
9174                Some(17625922),
9175                Some(17625923),
9176                Some(17625924),
9177                Some(17625925),
9178                Some(17625926),
9179                Some(17625927),
9180                Some(17625928),
9181                Some(17625929),
9182                Some(17625930),
9183                Some(17625931),
9184                Some(17625932),
9185                Some(17625933),
9186                Some(17625934),
9187                Some(17625935),
9188                Some(17625936),
9189                Some(17625937),
9190                Some(17625938),
9191                Some(17625939),
9192                Some(17625940),
9193                Some(17625941),
9194                Some(17625942),
9195                Some(17625943),
9196                Some(17625944),
9197                Some(17625945),
9198                Some(17625946),
9199                Some(17625947),
9200                Some(17625948),
9201                Some(17625949)
9202            ]
9203        );
9204        let rp: Vec<_> = it
9205            .next()
9206            .unwrap()
9207            .unwrap()
9208            .reference_positions_full()
9209            .collect();
9210        assert_eq!(
9211            rp,
9212            vec![
9213                None,
9214                None,
9215                Some(17624012),
9216                Some(17624013),
9217                Some(17624014),
9218                Some(17624015),
9219                Some(17624016),
9220                Some(17624017),
9221                Some(17624018),
9222                Some(17624019),
9223                Some(17624020),
9224                Some(17625913),
9225                Some(17625914),
9226                Some(17625915),
9227                Some(17625916),
9228                Some(17625917),
9229                Some(17625918),
9230                Some(17625919),
9231                Some(17625920),
9232                Some(17625921),
9233                Some(17625922),
9234                Some(17625923),
9235                Some(17625924),
9236                Some(17625925),
9237                Some(17625926),
9238                Some(17625927),
9239                Some(17625928),
9240                Some(17625929),
9241                Some(17625930),
9242                Some(17625931),
9243                Some(17625932),
9244                Some(17625933),
9245                Some(17625934),
9246                Some(17625935),
9247                Some(17625936),
9248                Some(17625937),
9249                Some(17625938),
9250                Some(17625939),
9251                Some(17625940),
9252                Some(17625941),
9253                Some(17625942),
9254                Some(17625943),
9255                Some(17625944),
9256                Some(17625945),
9257                Some(17625946),
9258                Some(17625947),
9259                Some(17625948),
9260                Some(17625949),
9261                Some(17625950),
9262                Some(17625951),
9263                Some(17625952)
9264            ]
9265        );
9266        let rp: Vec<_> = it
9267            .next()
9268            .unwrap()
9269            .unwrap()
9270            .reference_positions_full()
9271            .collect();
9272        assert_eq!(
9273            rp,
9274            vec![
9275                None,
9276                Some(31796700),
9277                Some(31796701),
9278                Some(31796702),
9279                Some(31796703),
9280                Some(31796704),
9281                Some(31796705),
9282                Some(31796706),
9283                Some(31796710),
9284                Some(31796711),
9285                Some(31796712),
9286                Some(31796713),
9287                Some(31796714),
9288                Some(31796715),
9289                Some(31796716),
9290                Some(31796717),
9291                Some(31796718),
9292                Some(31796719),
9293                Some(31796720),
9294                Some(31796721),
9295                Some(31796722),
9296                Some(31796723),
9297                Some(31796724),
9298                Some(31796725),
9299                Some(31796726),
9300                Some(31796727),
9301                Some(31796728),
9302                Some(31799014),
9303                Some(31799015),
9304                Some(31799016),
9305                Some(31799017),
9306                Some(31799018),
9307                Some(31799019),
9308                Some(31799020),
9309                Some(31799021),
9310                Some(31799022),
9311                Some(31799023),
9312                Some(31799024),
9313                Some(31799025),
9314                Some(31799026),
9315                Some(31799027),
9316                Some(31799028),
9317                Some(31799029),
9318                Some(31799030),
9319                Some(31799031),
9320                Some(31799032),
9321                Some(31799033),
9322                Some(31799034),
9323                Some(31799035),
9324                Some(31799036),
9325                Some(31799037)
9326            ]
9327        );
9328        let rp: Vec<_> = it
9329            .next()
9330            .unwrap()
9331            .unwrap()
9332            .reference_positions_full()
9333            .collect();
9334        assert_eq!(
9335            rp,
9336            vec![
9337                Some(36722692),
9338                Some(36722693),
9339                Some(36722694),
9340                Some(36722695),
9341                Some(36722696),
9342                Some(36722697),
9343                Some(36722698),
9344                Some(36722699),
9345                Some(36722700),
9346                Some(36722701),
9347                Some(36722702),
9348                Some(36722703),
9349                Some(36722704),
9350                Some(36722705),
9351                Some(36723505),
9352                Some(36723506),
9353                Some(36723507),
9354                Some(36723508),
9355                Some(36723509),
9356                Some(36723510),
9357                Some(36723511),
9358                Some(36723512),
9359                Some(36723513),
9360                Some(36723514),
9361                Some(36723515),
9362                Some(36723516),
9363                Some(36723517),
9364                Some(36723518),
9365                Some(36723519),
9366                Some(36723520),
9367                Some(36723521),
9368                Some(36723522),
9369                Some(36723523),
9370                Some(36723524),
9371                Some(36723525),
9372                Some(36723526),
9373                Some(36723527),
9374                Some(36723528),
9375                Some(36723529),
9376                Some(36723530),
9377                Some(36723531),
9378                Some(36723532),
9379                Some(36737414),
9380                Some(36737415),
9381                Some(36737416),
9382                Some(36737417),
9383                Some(36737418),
9384                Some(36737419),
9385                Some(36737420),
9386                None,
9387                None
9388            ]
9389        );
9390        let rp: Vec<_> = it
9391            .next()
9392            .unwrap()
9393            .unwrap()
9394            .reference_positions_full()
9395            .collect();
9396        assert_eq!(
9397            rp,
9398            vec![
9399                None,
9400                None,
9401                None,
9402                None,
9403                Some(44587963),
9404                Some(44587964),
9405                Some(44587965),
9406                Some(44587966),
9407                Some(44587967),
9408                Some(44587968),
9409                Some(44587969),
9410                Some(44587970),
9411                Some(44587971),
9412                Some(44587972),
9413                Some(44587973),
9414                Some(44587974),
9415                Some(44587975),
9416                Some(44587976),
9417                Some(44587977),
9418                Some(44587978),
9419                Some(44587979),
9420                Some(44587980),
9421                Some(44587981),
9422                Some(44587982),
9423                Some(44587983),
9424                Some(44589680),
9425                Some(44589681),
9426                Some(44589682),
9427                Some(44589683),
9428                Some(44589684),
9429                Some(44589685),
9430                Some(44589686),
9431                Some(44589687),
9432                Some(44589688),
9433                Some(44589689),
9434                Some(44589690),
9435                Some(44589691),
9436                Some(44589692),
9437                Some(44589693),
9438                Some(44589694),
9439                Some(44589695),
9440                Some(44589696),
9441                Some(44589697),
9442                Some(44589698),
9443                Some(44589699),
9444                Some(44589700),
9445                Some(44589701),
9446                Some(44589702),
9447                Some(44592034),
9448                Some(44592035),
9449                Some(44592036)
9450            ]
9451        );
9452    }
9453
9454    #[test]
9455    fn test_reference_start_end() {
9456        let mut bam = bam::Reader::from_path("./test/test_spliced_reads.bam").unwrap();
9457        let mut it = bam.records();
9458        let read = it.next().unwrap().unwrap();
9459        assert_eq!(read.reference_start(), 16050676);
9460        assert_eq!(read.reference_end(), 16050721);
9461        let read = it.next().unwrap().unwrap();
9462        assert_eq!(read.reference_start(), 16096878);
9463        assert_eq!(read.reference_end(), 16096931);
9464        let read = it.next().unwrap().unwrap();
9465        assert_eq!(read.reference_start(), 16097145);
9466        assert_eq!(read.reference_end(), 16097198);
9467        let read = it.next().unwrap().unwrap();
9468        assert_eq!(read.reference_start(), 16117350);
9469        assert_eq!(read.reference_end(), 16117401);
9470        let read = it.next().unwrap().unwrap();
9471        assert_eq!(read.reference_start(), 16118483);
9472        assert_eq!(read.reference_end(), 16118534);
9473        let read = it.next().unwrap().unwrap();
9474        assert_eq!(read.reference_start(), 16118499);
9475        assert_eq!(read.reference_end(), 16118550);
9476        let read = it.next().unwrap().unwrap();
9477        assert_eq!(read.reference_start(), 16118499);
9478        assert_eq!(read.reference_end(), 16118550);
9479        let read = it.next().unwrap().unwrap();
9480        assert_eq!(read.reference_start(), 16118499);
9481        assert_eq!(read.reference_end(), 16118550);
9482        let read = it.next().unwrap().unwrap();
9483        assert_eq!(read.reference_start(), 16123411);
9484        assert_eq!(read.reference_end(), 16123462);
9485        let read = it.next().unwrap().unwrap();
9486        assert_eq!(read.reference_start(), 16123417);
9487        assert_eq!(read.reference_end(), 16123462);
9488        let read = it.next().unwrap().unwrap();
9489        assert_eq!(read.reference_start(), 16165860);
9490        assert_eq!(read.reference_end(), 16165901);
9491        let read = it.next().unwrap().unwrap();
9492        assert_eq!(read.reference_start(), 16180871);
9493        assert_eq!(read.reference_end(), 16180922);
9494        let read = it.next().unwrap().unwrap();
9495        assert_eq!(read.reference_start(), 16189705);
9496        assert_eq!(read.reference_end(), 16189756);
9497        let read = it.next().unwrap().unwrap();
9498        assert_eq!(read.reference_start(), 16231271);
9499        assert_eq!(read.reference_end(), 16231322);
9500        let read = it.next().unwrap().unwrap();
9501        assert_eq!(read.reference_start(), 16237657);
9502        assert_eq!(read.reference_end(), 16237708);
9503        let read = it.next().unwrap().unwrap();
9504        assert_eq!(read.reference_start(), 16255012);
9505        assert_eq!(read.reference_end(), 16255054);
9506        let read = it.next().unwrap().unwrap();
9507        assert_eq!(read.reference_start(), 16255391);
9508        assert_eq!(read.reference_end(), 16255442);
9509        let read = it.next().unwrap().unwrap();
9510        assert_eq!(read.reference_start(), 16255392);
9511        assert_eq!(read.reference_end(), 16255442);
9512        let read = it.next().unwrap().unwrap();
9513        assert_eq!(read.reference_start(), 16256084);
9514        assert_eq!(read.reference_end(), 16256129);
9515        let read = it.next().unwrap().unwrap();
9516        assert_eq!(read.reference_start(), 16256224);
9517        assert_eq!(read.reference_end(), 16256272);
9518        let read = it.next().unwrap().unwrap();
9519        assert_eq!(read.reference_start(), 16325199);
9520        assert_eq!(read.reference_end(), 16325241);
9521        let read = it.next().unwrap().unwrap();
9522        assert_eq!(read.reference_start(), 16352865);
9523        assert_eq!(read.reference_end(), 16352903);
9524        let read = it.next().unwrap().unwrap();
9525        assert_eq!(read.reference_start(), 16352968);
9526        assert_eq!(read.reference_end(), 16353012);
9527        let read = it.next().unwrap().unwrap();
9528        assert_eq!(read.reference_start(), 16414998);
9529        assert_eq!(read.reference_end(), 16415044);
9530        let read = it.next().unwrap().unwrap();
9531        assert_eq!(read.reference_start(), 17031591);
9532        assert_eq!(read.reference_end(), 17031638);
9533        let read = it.next().unwrap().unwrap();
9534        assert_eq!(read.reference_start(), 17057382);
9535        assert_eq!(read.reference_end(), 17057432);
9536        let read = it.next().unwrap().unwrap();
9537        assert_eq!(read.reference_start(), 17092766);
9538        assert_eq!(read.reference_end(), 17095000);
9539        let read = it.next().unwrap().unwrap();
9540        assert_eq!(read.reference_start(), 17092782);
9541        assert_eq!(read.reference_end(), 17095016);
9542        let read = it.next().unwrap().unwrap();
9543        assert_eq!(read.reference_start(), 17092782);
9544        assert_eq!(read.reference_end(), 17095016);
9545        let read = it.next().unwrap().unwrap();
9546        assert_eq!(read.reference_start(), 17137287);
9547        assert_eq!(read.reference_end(), 17137320);
9548        let read = it.next().unwrap().unwrap();
9549        assert_eq!(read.reference_start(), 17306238);
9550        assert_eq!(read.reference_end(), 17306286);
9551        let read = it.next().unwrap().unwrap();
9552        assert_eq!(read.reference_start(), 17561868);
9553        assert_eq!(read.reference_end(), 17561913);
9554        let read = it.next().unwrap().unwrap();
9555        assert_eq!(read.reference_start(), 17566078);
9556        assert_eq!(read.reference_end(), 17577961);
9557        let read = it.next().unwrap().unwrap();
9558        assert_eq!(read.reference_start(), 17566108);
9559        assert_eq!(read.reference_end(), 17578701);
9560        let read = it.next().unwrap().unwrap();
9561        assert_eq!(read.reference_start(), 17566111);
9562        assert_eq!(read.reference_end(), 17578704);
9563        let read = it.next().unwrap().unwrap();
9564        assert_eq!(read.reference_start(), 17566111);
9565        assert_eq!(read.reference_end(), 17578704);
9566        let read = it.next().unwrap().unwrap();
9567        assert_eq!(read.reference_start(), 17566111);
9568        assert_eq!(read.reference_end(), 17578704);
9569        let read = it.next().unwrap().unwrap();
9570        assert_eq!(read.reference_start(), 17566111);
9571        assert_eq!(read.reference_end(), 17578704);
9572        let read = it.next().unwrap().unwrap();
9573        assert_eq!(read.reference_start(), 17566112);
9574        assert_eq!(read.reference_end(), 17578705);
9575        let read = it.next().unwrap().unwrap();
9576        assert_eq!(read.reference_start(), 17566113);
9577        assert_eq!(read.reference_end(), 17578706);
9578        let read = it.next().unwrap().unwrap();
9579        assert_eq!(read.reference_start(), 17566113);
9580        assert_eq!(read.reference_end(), 17578706);
9581        let read = it.next().unwrap().unwrap();
9582        assert_eq!(read.reference_start(), 17579733);
9583        assert_eq!(read.reference_end(), 17581250);
9584        let read = it.next().unwrap().unwrap();
9585        assert_eq!(read.reference_start(), 17581369);
9586        assert_eq!(read.reference_end(), 17583029);
9587        let read = it.next().unwrap().unwrap();
9588        assert_eq!(read.reference_start(), 17581370);
9589        assert_eq!(read.reference_end(), 17583030);
9590        let read = it.next().unwrap().unwrap();
9591        assert_eq!(read.reference_start(), 17581370);
9592        assert_eq!(read.reference_end(), 17583030);
9593        let read = it.next().unwrap().unwrap();
9594        assert_eq!(read.reference_start(), 17582911);
9595        assert_eq!(read.reference_end(), 17583056);
9596        let read = it.next().unwrap().unwrap();
9597        assert_eq!(read.reference_start(), 17588621);
9598        assert_eq!(read.reference_end(), 17589209);
9599        let read = it.next().unwrap().unwrap();
9600        assert_eq!(read.reference_start(), 17588621);
9601        assert_eq!(read.reference_end(), 17589209);
9602        let read = it.next().unwrap().unwrap();
9603        assert_eq!(read.reference_start(), 17588621);
9604        assert_eq!(read.reference_end(), 17589209);
9605        let read = it.next().unwrap().unwrap();
9606        assert_eq!(read.reference_start(), 17591770);
9607        assert_eq!(read.reference_end(), 17591821);
9608        let read = it.next().unwrap().unwrap();
9609        assert_eq!(read.reference_start(), 17593855);
9610        assert_eq!(read.reference_end(), 17593904);
9611        let read = it.next().unwrap().unwrap();
9612        assert_eq!(read.reference_start(), 17593863);
9613        assert_eq!(read.reference_end(), 17593908);
9614        let read = it.next().unwrap().unwrap();
9615        assert_eq!(read.reference_start(), 17596476);
9616        assert_eq!(read.reference_end(), 17596515);
9617        let read = it.next().unwrap().unwrap();
9618        assert_eq!(read.reference_start(), 17624012);
9619        assert_eq!(read.reference_end(), 17625950);
9620        let read = it.next().unwrap().unwrap();
9621        assert_eq!(read.reference_start(), 17624012);
9622        assert_eq!(read.reference_end(), 17625953);
9623        let read = it.next().unwrap().unwrap();
9624        assert_eq!(read.reference_start(), 31796700);
9625        assert_eq!(read.reference_end(), 31799038);
9626        let read = it.next().unwrap().unwrap();
9627        assert_eq!(read.reference_start(), 36722692);
9628        assert_eq!(read.reference_end(), 36737421);
9629        let read = it.next().unwrap().unwrap();
9630        assert_eq!(read.reference_start(), 44587963);
9631        assert_eq!(read.reference_end(), 44592037);
9632    }
9633
9634    #[test]
9635    fn test_infer_seq_len() {
9636        use std::convert::TryFrom;
9637        let mut bam = bam::Reader::from_path("./test/test_spliced_reads.bam").unwrap();
9638        for read in bam.records() {
9639            let read = read.unwrap();
9640            assert_eq!(read.seq_len_from_cigar(false), 51);
9641            assert_eq!(read.seq_len_from_cigar(true), 51);
9642        }
9643
9644        let mut read = bam::Record::new();
9645        for (input_cigar, supposed_length_wo_hard_clip, supposed_length_with_hard_clip) in &[
9646            ("40M", 40, 40),
9647            ("40=", 40, 40),
9648            ("40X", 40, 40),
9649            ("20M5I20M", 45, 45),
9650            ("20M5D20M", 40, 40),
9651            ("5H35M", 35, 40),
9652            ("5S35M", 40, 40),
9653            ("35M5H", 35, 40),
9654            ("35M5S", 40, 40),
9655            ("", 0, 0),
9656        ] {
9657            read.set(
9658                b"test",
9659                Some(&CigarString::try_from(*input_cigar).unwrap()),
9660                b"agtc",
9661                b"BBBB",
9662            );
9663            assert_eq!(
9664                &read.seq_len_from_cigar(false),
9665                supposed_length_wo_hard_clip
9666            );
9667            assert_eq!(
9668                &read.seq_len_from_cigar(true),
9669                supposed_length_with_hard_clip
9670            );
9671        }
9672    }
9673}