diff --git a/bio/bam/baseinfo.d b/bio/bam/baseinfo.d index aca9772..fab276c 100644 --- a/bio/bam/baseinfo.d +++ b/bio/bam/baseinfo.d @@ -30,6 +30,7 @@ import bio.bam.read; import bio.bam.tagvalue; import bio.bam.iontorrent.flowcall; import bio.bam.md.core; +import bio.bam.cigar; import std.range; import std.conv; diff --git a/bio/bam/read.d b/bio/bam/read.d index 342fd7d..adffada 100644 --- a/bio/bam/read.d +++ b/bio/bam/read.d @@ -1007,7 +1007,7 @@ private: assert(n < 16); // http://graphics.stanford.edu/~seander/bithacks.html#ConditionalSetOrClearBitsWithoutBranching ushort mask = cast(ushort)(1 << n); - _flag = (_flag & ~mask) | ((-cast(int)b) & mask); + _flag = (_flag & ~cast(int)(mask)) | ((-cast(int)b) & mask); } // If _chunk is still a slice, not an array, duplicate it. diff --git a/bio/core/utils/format.d b/bio/core/utils/format.d index 74bcfaf..6dca509 100644 --- a/bio/core/utils/format.d +++ b/bio/core/utils/format.d @@ -58,7 +58,7 @@ private { char* wstr=str; static if (isSigned!T) { - ulong uvalue = (value < 0) ? -value : value; + ulong uvalue = (value < 0) ? -cast(int)(value) : value; } else { ulong uvalue = value; } diff --git a/examples/calculate_gc_content_from_reference.d b/examples/calculate_gc_content_from_reference.d index 5b97af5..ded1c28 100644 --- a/examples/calculate_gc_content_from_reference.d +++ b/examples/calculate_gc_content_from_reference.d @@ -1,4 +1,9 @@ -// run example: rdmd -I.. calculate_gc_content_from_reference.d +// BioD depends on stream.d which is no longer included with phobos. +// To run this example from this directory, +// Clone the undead repository with +// git clone https://github.com:dlang/undeaD.git at the appropriate location and ensure +// it is available on your path +// Run example: rdmd -I.. -I../location_of_undead/src calculate_gc_content_from_reference.d import bio.bam.reader; import bio.bam.md.reconstruct : dna; diff --git a/examples/create_bam_from_scratch.d b/examples/create_bam_from_scratch.d index b011d93..16e2c66 100644 --- a/examples/create_bam_from_scratch.d +++ b/examples/create_bam_from_scratch.d @@ -1,9 +1,15 @@ -// run example: rdmd -I.. create_bam_from_scratch.d +// BioD depends on stream.d which is no longer included with phobos. +// To run this example from this directory, +// Clone the undead repository with +// git clone https://github.com:dlang/undeaD.git at the appropriate location and ensure +// it is available on your path +// Run example: rdmd -I.. -I../location_of_undead/src create_bam_from_scratch.d // this example shows how to create BAM files from scratch import bio.bam.read, bio.bam.referenceinfo, bio.sam.header; import bio.bam.reader, bio.bam.writer; import undead.stream, std.stdio; +import bio.bam.cigar; void main() { auto header = new SamHeader(); // First, create SAM header diff --git a/examples/iterate_tags.d b/examples/iterate_tags.d index 8883a3e..eea2ea6 100644 --- a/examples/iterate_tags.d +++ b/examples/iterate_tags.d @@ -1,4 +1,9 @@ -// run example: rdmd -I.. iterate_tags.d +// BioD depends on stream.d which is no longer included with phobos. +// To run this example from this directory, +// Clone the undead repository with +// git clone https://github.com:dlang/undeaD.git at the appropriate location and ensure +// it is available on your path +// Run example: rdmd -I.. -I../location_of_undead/src iterate_tags.d import bio.bam.reader, bio.bam.tagvalue; import std.stdio, std.datetime; diff --git a/examples/make_pileup.d b/examples/make_pileup.d index bf57643..b670bb0 100644 --- a/examples/make_pileup.d +++ b/examples/make_pileup.d @@ -1,4 +1,9 @@ -// run example: rdmd -I.. make_pileup.d +// BioD depends on stream.d which is no longer included with phobos. +// To run this example from this directory, +// Clone the undead repository with +// git clone https://github.com:dlang/undeaD.git at the appropriate location and ensure +// it is available on your path +// Run example: rdmd -I.. -I../location_of_undead/src make_pileup.d import bio.bam.reader; import bio.bam.pileup; diff --git a/examples/print_base_info.d b/examples/print_base_info.d index 31c0bb2..475e715 100644 --- a/examples/print_base_info.d +++ b/examples/print_base_info.d @@ -1,4 +1,9 @@ -// run example: rdmd -I.. print_base_info.d +// BioD depends on stream.d which is no longer included with phobos. +// To run this example from this directory, +// Clone the undead repository with +// git clone https://github.com:dlang/undeaD.git at the appropriate location and ensure +// it is available on your path +// Run example: rdmd -I.. -I../location_of_undead/src print_base_info.d import bio.bam.reader; import bio.bam.baseinfo; diff --git a/examples/read_bam_file.d b/examples/read_bam_file.d index aa823de..f6e8bfa 100644 --- a/examples/read_bam_file.d +++ b/examples/read_bam_file.d @@ -1,4 +1,9 @@ -// run example: rdmd -I.. example1.d +// BioD depends on stream.d which is no longer included with phobos. +// To run this example from this directory, +// Clone the undead repository with +// git clone https://github.com:dlang/undeaD.git at the appropriate location and ensure +// it is available on your path +// Run example: rdmd -I.. -I../location_of_undead/src read_bam_file.d import bio.bam.reader; import bio.bam.pileup; diff --git a/examples/transverse_multiple_bam_files.d b/examples/transverse_multiple_bam_files.d index 655623b..64fa956 100644 --- a/examples/transverse_multiple_bam_files.d +++ b/examples/transverse_multiple_bam_files.d @@ -1,4 +1,9 @@ -// run example: rdmd -I.. transverse_multiple_bam_files.d +// BioD depends on stream.d which is no longer included with phobos. +// To run this example from this directory, +// Clone the undead repository with +// git clone https://github.com:dlang/undeaD.git at the appropriate location and ensure +// it is available on your path +// Run example: rdmd -I.. -I../location_of_undead/src transverse_multiple_bam_files.d import bio.bam.multireader; import bio.bam.read : compareCoordinates;