diff --git a/src/bam/record.rs b/src/bam/record.rs index ebedc3b18..fc580b033 100644 --- a/src/bam/record.rs +++ b/src/bam/record.rs @@ -2858,6 +2858,19 @@ mod alignment_cigar_tests { } } + #[test] + fn test_read_orientation_supplementary() { + let mut bam = Reader::from_path(&"test/test_orientation_supplementary.sam").unwrap(); + + for res in bam.records() { + let record = res.unwrap(); + assert_eq!( + record.read_pair_orientation(), + SequenceReadPairOrientation::F2R1 + ); + } + } + #[test] pub fn test_cigar_parsing_non_ascii_error() { let cigar_str = "43ጷ"; diff --git a/test/test_orientation_supplementary.sam b/test/test_orientation_supplementary.sam new file mode 100644 index 000000000..acf52140b --- /dev/null +++ b/test/test_orientation_supplementary.sam @@ -0,0 +1,35 @@ +@HD VN:1.3 SO:coordinate +@SQ SN:chr10 LN:135374737 +@SQ SN:chr11 LN:134452384 +@SQ SN:chr12 LN:132349534 +@SQ SN:chr13 LN:114142980 +@SQ SN:chr14 LN:106368585 +@SQ SN:chr15 LN:100338915 +@SQ SN:chr16 LN:88827254 +@SQ SN:chr17 LN:78774742 +@SQ SN:chr18 LN:76117153 +@SQ SN:chr19 LN:63811651 +@SQ SN:chr1 LN:247249719 +@SQ SN:chr20 LN:62435964 +@SQ SN:chr21 LN:46944323 +@SQ SN:chr22 LN:49691432 +@SQ SN:chr2 LN:242951149 +@SQ SN:chr3 LN:199501827 +@SQ SN:chr4 LN:191273063 +@SQ SN:chr5 LN:180857866 +@SQ SN:chr6 LN:170899992 +@SQ SN:chr7 LN:158821424 +@SQ SN:chr8 LN:146274826 +@SQ SN:chr9 LN:140273252 +@SQ SN:chrM LN:16571 +@SQ SN:chrX LN:154913754 +@SQ SN:chrY LN:57772954 +@RG ID:tumor SM:tumor +@PG ID:bwa PN:bwa VN:0.7.16a-r1187-dirty CL:resources/bwa mem -t 8 -Y -R @RG\tID:tumor\tSM:tumor index/hg18/genome reads/simulated.tumor.1.fastq reads/simulated.tumor.2.fastq +@PG ID:samtools PN:samtools PP:bwa VN:1.20 CL:samtools sort -n -o tests/resources/testcases/test16/tumor.bam.namesorted.bam tests/resources/testcases/test16/tumor.bam +@PG ID:samtools.1 PN:samtools PP:samtools VN:1.20 CL:samtools fixmate tests/resources/testcases/test16/tumor.bam.namesorted.bam tests/resources/testcases/test16/tumor.bam.fixed.bam +@PG ID:samtools.2 PN:samtools PP:samtools.1 VN:1.20 CL:samtools sort -o tests/resources/testcases/test16/tumor.bam tests/resources/testcases/test16/tumor.bam.fixed.bam +@PG ID:samtools.3 PN:samtools PP:samtools.2 VN:1.20 CL:samtools view -H tumor.bam +sim_Som2-5-1_chr1_1_1b5889 163 chr1 938 60 100M = 1143 264 CACTATACCACTTGAATGCTCAGAAGAAAAAAAAAAGAATTCAGAATATGTGTATTAAAATGGGTACAATAATGAGTAAAAAACTTGAAAGAAGCTGGAG GFGDECGFE?AA>FGADEEF)BDC>FDEC5EEBFEEB?D@BGDCAB:FBGGDE;DF-CBDDCD+>:ED@#?=?#>EADE,B#?A#FFC;CC@#:5DBA## NM:i:1 MD:Z:69A30 AS:i:95 XS:i:23 ZT:Z:95,1,72,72,0,0,69,0,1,0,0,0,1379,0 RG:Z:tumor MQ:i:60 MC:Z:59M41S +sim_Som2-5-1_chr1_1_1b5889 83 chr1 1143 60 59M41S = 938 -264 ATCTTTCCTTTATCAACTATTGGTGTTAACCTTTGATTATATTTTTGCATAAGCATACAAAATATTGATCTTTAATTATACTAAGGAATCAATAGCCAAA F:##.##D#DFDA5D#*#:D?E7B?.>?GA>6?=CE:EEBEDAE=AF:5GF:G#ABGDGGAGEG=DAE?FF?GG7AGEG-BDEGDAGEDDEDF=>F5E*@ NM:i:2 MD:Z:2G13A42 AS:i:51 XS:i:20 SA:Z:chr1,73497948,-,58S42M,60,1; ZT:Z:51,2,31,11,0,0,42,0,3,0,0,0,419,0 RG:Z:tumor MQ:i:60 MC:Z:100M +sim_Som2-5-1_chr1_1_1b5889 2131 chr1 1263 60 58S42M = 938 -367 ATCTTTCCTTTATCAACTATTGGTGTTAACCTTTGATTATATTTTTGCATAAGCATACAAAATATTGATCTTTAATTATACTAAGGAATCAATAGCCAAA F:##.##D#DFDA5D#*#:D?E7B?.>?GA>6?=CE:EEBEDAE=AF:5GF:G#ABGDGGAGEG=DAE?FF?GG7AGEG-BDEGDAGEDDEDF=>F5E*@ NM:i:1 MD:Z:40C1 MC:Z:100M AS:i:40 XS:i:0 SA:Z:chr1,73497828,-,59M41S,60,2; ZT:Z:40,1,40,40,0,0,40,0,0,0,0,0,400,0 RG:Z:tumor