Commit 5e717302 authored by Haowen Zhang's avatar Haowen Zhang
Browse files

Revert "Merge branch 'master' of github.com:haowenz/chromap"

This reverts commit 3e13f0e0, reversing
changes made to 7048db2e.
parent 3e13f0e0
Loading
Loading
Loading
Loading
+1 −14
Original line number Diff line number Diff line
@@ -20,7 +20,6 @@ struct _mm_history {
	std::vector<std::pair<uint64_t, uint64_t> > minimizers;
	std::vector<Candidate> positive_candidates;
	std::vector<Candidate> negative_candidates;
        uint32_t repetitive_seed_length;
};

template <typename MappingRecord>
@@ -490,7 +489,7 @@ void Chromap<MappingRecord>::MapPairedEndReads() {
  SequenceBatch read_batch1_for_loading(read_batch_size_);
  SequenceBatch read_batch2_for_loading(read_batch_size_);
  SequenceBatch barcode_batch_for_loading(read_batch_size_);
  mm_cache mm_to_candidates_cache(2000003);
  mm_cache mm_to_candidates_cache(1000003);
  mm_to_candidates_cache.SetKmerLength(kmer_size_);
  struct _mm_history *mm_history1 = new struct _mm_history[read_batch_size_];
  struct _mm_history *mm_history2 = new struct _mm_history[read_batch_size_];
@@ -1223,18 +1222,6 @@ void Chromap<MappingRecord>::MapSingleEndReads() {
  SequenceBatch read_batch_for_loading(read_batch_size_);
  SequenceBatch barcode_batch(read_batch_size_);
  SequenceBatch barcode_batch_for_loading(read_batch_size_);
  mm_cache mm_to_candidates_cache(2000003);
  mm_to_candidates_cache.SetKmerLength(kmer_size_);
  struct _mm_history *mm_history = new struct _mm_history[read_batch_size_];
  read_batch_for_loading.InitializeLoading(read_file1_path_);
  if (!is_bulk_data_) {
    barcode_batch_for_loading.InitializeLoading(barcode_file_path_);
  }
  double real_start_mapping_time = Chromap<>::GetRealTime();
  uint32_t num_loaded_reads_for_loading = 0;
  uint32_t num_loaded_reads = LoadSingleEndReadsWithBarcodes(&read_batch_for_loading, &barcode_batch_for_loading);
  read_batch_for_loading.SwapSequenceBatch(read_batch);
  barcode_batch_for_loading.SwapSequenceBatch(barcode_batch);
  mappings_on_diff_ref_seqs_.reserve(num_reference_sequences);
  deduped_mappings_on_diff_ref_seqs_.reserve(num_reference_sequences);
  for (uint32_t i = 0; i < num_reference_sequences; ++i) {
+2 −6
Original line number Diff line number Diff line
@@ -14,7 +14,6 @@ struct _mm_cache_entry {
  int weight;
  unsigned short finger_print_cnt[FINGER_PRINT_SIZE];
  int finger_print_cnt_sum;
  uint32_t repetitive_seed_length;
};

class mm_cache {
@@ -85,7 +84,7 @@ class mm_cache {
  }

  // Return the hash entry index. -1 if failed.
  int Query(const std::vector<std::pair<uint64_t, uint64_t> > &minimizers, std::vector<Candidate> &pos_candidates, std::vector<Candidate> &neg_candidates, uint32_t &repetitive_seed_length, uint32_t read_len) {
  int Query(const std::vector<std::pair<uint64_t, uint64_t> > &minimizers, std::vector<Candidate> &pos_candidates, std::vector<Candidate> &neg_candidates, uint32_t read_len) {
    int i;
    int msize = minimizers.size();
    uint64_t h = 0;
@@ -96,7 +95,6 @@ class mm_cache {
    if (direction == 1) {
      pos_candidates = cache[hidx].positive_candidates;
      neg_candidates = cache[hidx].negative_candidates;
      repetitive_seed_length = cache[hidx].repetitive_seed_length;
      int size = pos_candidates.size();
      int shift = (int)minimizers[0].second >> 1;
      for (i = 0; i < size; ++i)
@@ -118,14 +116,13 @@ class mm_cache {
      neg_candidates = cache[hidx].positive_candidates;
      for (i = 0; i < size; ++i)
        neg_candidates[i].position = cache[hidx].positive_candidates[i].position - shift + read_len - 1;
      repetitive_seed_length = cache[hidx].repetitive_seed_length;
      return hidx;
    } else {
      return -1;
    }
  }

  void Update(const std::vector<std::pair<uint64_t, uint64_t> > &minimizers, std::vector<Candidate> &pos_candidates, std::vector<Candidate> &neg_candidates, uint32_t repetitive_seed_length) {
  void Update(const std::vector<std::pair<uint64_t, uint64_t> > &minimizers, std::vector<Candidate> &pos_candidates, std::vector<Candidate> &neg_candidates) {
    int i;
    int msize = minimizers.size();

@@ -170,7 +167,6 @@ class mm_cache {
      std::vector<Candidate>().swap(cache[hidx].negative_candidates);
      cache[hidx].positive_candidates = pos_candidates;
      cache[hidx].negative_candidates = neg_candidates;
      cache[hidx].repetitive_seed_length = repetitive_seed_length;

      // adjust the candidate position.
      int size = cache[hidx].positive_candidates.size();