Skip to content

Commit

Permalink
Fix BED mask length #29
Browse files Browse the repository at this point in the history
  • Loading branch information
lczech committed Sep 15, 2024
1 parent 304a3cd commit 7e1d3ce
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ include( "${CMAKE_CURRENT_LIST_DIR}/tools/cmake/DownloadDependency.cmake" )
# These are replaced by tools/cmake/update_dependencies.sh to the hashes that are currently checked out.
# Thus, do not replace the hashes manually!
SET( CLI11_COMMIT_HASH "5cb3efabce007c3a0230e4cc2e27da491c646b6c" ) #CLI11_COMMIT_HASH#
SET( genesis_COMMIT_HASH "5197621925aecee869d2681d64582adea8a0348d" ) #genesis_COMMIT_HASH#
SET( genesis_COMMIT_HASH "059e5b50a33c2826edd931435c11661c7a5b0985" ) #genesis_COMMIT_HASH#

# Call the github download function, which takes four arguments:
# - LIBPATH : Path to the libracy dir where dependencies are stored.
Expand Down
2 changes: 1 addition & 1 deletion libs/genesis
Submodule genesis updated 34 files
+1 −1 doc/doxygen/Doxyfile
+16 −0 doc/manual/supplement/acknowledgements.md
+15 −0 doc/manual/supplement/acknowledgements/d_06_min_enc_can_kmer.inc
+86 −3 lib/genesis/population/format/bed_reader.cpp
+29 −2 lib/genesis/population/format/bed_reader.hpp
+6 −2 lib/genesis/population/function/variant_input_stream.cpp
+8 −8 lib/genesis/population/genome_locus_set.cpp
+7 −0 lib/genesis/sequence.hpp
+34 −15 lib/genesis/sequence/formats/fasta_reader.cpp
+21 −7 lib/genesis/sequence/formats/fasta_reader.hpp
+50 −0 lib/genesis/sequence/kmer/alphabet.cpp
+206 −0 lib/genesis/sequence/kmer/alphabet.hpp
+51 −0 lib/genesis/sequence/kmer/bitfield.cpp
+251 −0 lib/genesis/sequence/kmer/bitfield.hpp
+372 −0 lib/genesis/sequence/kmer/canonical_encoding.hpp
+403 −0 lib/genesis/sequence/kmer/extractor.hpp
+363 −0 lib/genesis/sequence/kmer/function.hpp
+265 −0 lib/genesis/sequence/kmer/kmer.hpp
+294 −0 lib/genesis/sequence/kmer/microvariant_scanner.hpp
+30 −29 lib/genesis/tree/iterator/postorder.hpp
+1 −0 lib/genesis/utils.hpp
+249 −0 lib/genesis/utils/containers/bitpacked_vector.hpp
+2 −2 lib/genesis/utils/core/version.hpp
+49 −5 lib/genesis/utils/math/bitvector.cpp
+15 −1 lib/genesis/utils/math/bitvector.hpp
+102 −36 lib/genesis/utils/math/bitvector/operators.cpp
+72 −10 lib/genesis/utils/math/bitvector/operators.hpp
+3 −3 lib/genesis/utils/math/common.hpp
+1 −1 lib/genesis/utils/threading/thread_pool.hpp
+4 −0 test/data/population/mask.bed
+94 −0 test/src/population/bed_reader.cpp
+757 −0 test/src/sequence/kmer.cpp
+303 −0 test/src/utils/containers/bitpacked_vector.cpp
+117 −24 test/src/utils/math/bitvector.cpp
14 changes: 10 additions & 4 deletions src/options/variant_filter_mask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ void VariantFilterMaskOptions::prepare_sample_masks_() const
// Add the masks from bed files.
if( *filter_mask_sample_bed_list_.option ) {
// We need a dict to invert
auto ref_dict = ref_genome_opts_->get_reference_dict();
auto const ref_dict = ref_genome_opts_->get_reference_dict();
if( filter_mask_sample_bed_inv_.value && !ref_dict ) {
throw CLI::ValidationError(
filter_mask_sample_bed_inv_.option->get_name(),
Expand All @@ -433,7 +433,10 @@ void VariantFilterMaskOptions::prepare_sample_masks_() const
LOG_MSG2 << " - " << sample_file_pair.first << ": " << sample_file_pair.second;
assert( sample_masks_( sample_file_pair.first ).count() == 0 );
sample_masks_[ sample_file_pair.first ] = std::make_shared<GenomeLocusSet>(
BedReader().read_as_genome_locus_set( from_file( sample_file_pair.second ))
BedReader().read_as_genome_locus_set(
from_file( sample_file_pair.second ),
ref_dict
)
);
if( filter_mask_sample_bed_inv_.value ) {
sample_masks_[ sample_file_pair.first ]->invert( *ref_dict );
Expand Down Expand Up @@ -481,11 +484,14 @@ void VariantFilterMaskOptions::prepare_total_mask_() const
// Add the mask from a bed file.
if( *filter_mask_total_bed_.option ) {
LOG_MSG2 << "Reading mask BED file " << filter_mask_total_bed_.value;
auto const ref_dict = ref_genome_opts_->get_reference_dict();
total_mask_ = std::make_shared<GenomeLocusSet>(
BedReader().read_as_genome_locus_set( from_file( filter_mask_total_bed_.value ))
BedReader().read_as_genome_locus_set(
from_file( filter_mask_total_bed_.value ),
ref_dict
)
);
if( filter_mask_total_bed_inv_.value ) {
auto ref_dict = ref_genome_opts_->get_reference_dict();
if( !ref_dict ) {
throw CLI::ValidationError(
filter_mask_total_bed_inv_.option->get_name(),
Expand Down

0 comments on commit 7e1d3ce

Please sign in to comment.