@@ -558,14 +558,14 @@ auto readPairsAndFragments(alias hashFunc=simpleHash, R)
558
558
(reads, table_size_log2, overflow_list_size, tmp_dir, task_pool);
559
559
}
560
560
561
- // ///////////////////////////////////////////////////////////////////////////////
562
- // / no more than 32767 libraries and 16383 reference sequences are supported ////
563
- // ///////////////////////////////////////////////////////////////////////////////
561
+ // /////////////////////////////////////////////////////////////////////////////////////////
562
+ // / no more than 536 million libraries and 2 billion reference sequences are supported ////
563
+ // /////////////////////////////////////////////////////////////////////////////////////////
564
564
565
565
// 8 bytes
566
566
struct SingleEndBasicInfo {
567
- mixin (bitfields! (short , " library_id" , 16 ,
568
- ushort , " ref_id" , 14 ,
567
+ mixin (bitfields! (int , " library_id" , 30 ,
568
+ uint , " ref_id" , 32 ,
569
569
ubyte , " reversed" , 1 ,
570
570
ubyte , " paired" , 1 ));
571
571
int coord;
@@ -575,7 +575,7 @@ struct SingleEndBasicInfo {
575
575
reversed == other.reversed && library_id == other.library_id;
576
576
}
577
577
}
578
- static assert (SingleEndBasicInfo.sizeof == 8 );
578
+ static assert (SingleEndBasicInfo.sizeof == 16 );
579
579
580
580
struct SingleEndInfo {
581
581
SingleEndBasicInfo basic_info;
@@ -585,13 +585,13 @@ struct SingleEndInfo {
585
585
}
586
586
587
587
struct PairedEndsInfo {
588
- mixin (bitfields! (short , " library_id" , 16 ,
589
- ushort , " ref_id1" , 14 ,
588
+ mixin (bitfields! (long , " library_id" , 30 ,
589
+ uint , " ref_id1" , 32 ,
590
590
ubyte , " reversed1" , 1 ,
591
591
ubyte , " reversed2" , 1 ));
592
592
int coord1;
593
593
int coord2;
594
- ushort ref_id2;
594
+ uint ref_id2;
595
595
596
596
uint score; // sum of base qualities that are >= 15
597
597
ulong idx1, idx2;
@@ -601,7 +601,7 @@ struct PairedEndsInfo {
601
601
// HACK! HACK! HACK! use the fact that the structures are almost
602
602
// the same except the one bit meaning 'paired' instead of 'reversed2'.
603
603
auto p = cast (ubyte * )(&result);
604
- p[0 .. 8 ] = (cast (ubyte * )(&this ))[0 .. 8 ];
604
+ p[0 .. 16 ] = (cast (ubyte * )(&this ))[0 .. 16 ];
605
605
result.paired = true ;
606
606
return result;
607
607
}
@@ -675,7 +675,7 @@ class ReadGroupIndex {
675
675
}
676
676
++ i;
677
677
}
678
- enforce(n_libs <= 32767 , " More than 32767 libraries are unsupported" );
678
+ enforce(n_libs <= 536870911 , " More than 536870911 libraries are unsupported" );
679
679
}
680
680
681
681
// / -1 if read group with such name is not found in the header
@@ -762,6 +762,7 @@ SingleEndBasicInfo basicInfo(E)(auto ref E e) {
762
762
bool samePosition (E1 , E2 )(auto ref E1 e1, auto ref E2 e2) {
763
763
static if (is (E1 == PairedEndsInfo) && is (E2 == PairedEndsInfo)) {
764
764
return * cast (ulong * )(&e1) == * cast (ulong * )(&e2) &&
765
+ e1.coord1 == e2.coord1 &&
765
766
e1.ref_id2 == e2.ref_id2 && e1.coord2 == e2.coord2;
766
767
} else {
767
768
return basicInfo (e1).samePosition(basicInfo(e2));
@@ -1232,7 +1233,6 @@ int markdup_main(string[] args) {
1232
1233
// Set up the BAM reader and pass in the thread pool
1233
1234
auto bam = new MultiBamReader(args[1 .. $- 1 ], taskPool);
1234
1235
auto n_refs = bam.reference_sequences.length;
1235
- enforce(n_refs < 16384 , " More than 16383 reference sequences are unsupported" );
1236
1236
1237
1237
auto rg_index = new ReadGroupIndex(bam.header);
1238
1238
0 commit comments