Skip to main content

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