Commit 157e5b15 authored by Haowen Zhang's avatar Haowen Zhang Committed by swiftgenomics
Browse files

Rename two funcs to supplement candidates.

parent e5377e79
Loading
Loading
Loading
Loading
+20 −18
Original line number Original line Diff line number Diff line
@@ -162,18 +162,18 @@ int CandidateProcessor::SupplementCandidates(
      int negative_rescue_result = 0;
      int negative_rescue_result = 0;
      if (mate_positive_candidates->size() > 0) {
      if (mate_positive_candidates->size() > 0) {
        positive_rescue_result =
        positive_rescue_result =
            GenerateCandidatesFromRepetitiveReadWithMateInfo(
            GenerateCandidatesFromRepetitiveReadWithMateInfoOnOneStrand(
                error_threshold, index, *minimizers, *repetitive_seed_length,
                kNegative, search_range, error_threshold, index, *minimizers,
                *negative_hits, *augment_negative_candidates,
                *mate_positive_candidates, *repetitive_seed_length,
                *mate_positive_candidates, kNegative, search_range);
                *negative_hits, *augment_negative_candidates);
      }
      }


      if (mate_negative_candidates->size() > 0) {
      if (mate_negative_candidates->size() > 0) {
        negative_rescue_result =
        negative_rescue_result =
            GenerateCandidatesFromRepetitiveReadWithMateInfo(
            GenerateCandidatesFromRepetitiveReadWithMateInfoOnOneStrand(
                error_threshold, index, *minimizers, *repetitive_seed_length,
                kPositive, search_range, error_threshold, index, *minimizers,
                *positive_hits, *augment_positive_candidates,
                *mate_negative_candidates, *repetitive_seed_length,
                *mate_negative_candidates, kPositive, search_range);
                *positive_hits, *augment_positive_candidates);
      }
      }


      // If one of the strand did not supplement due to too many best candidate,
      // If one of the strand did not supplement due to too many best candidate,
@@ -262,13 +262,15 @@ void CandidateProcessor::ReduceCandidatesForPairedEndRead(
      filtered_negative_candidates1, filtered_positive_candidates2);
      filtered_negative_candidates1, filtered_positive_candidates2);
}
}


int CandidateProcessor::GenerateCandidatesFromRepetitiveReadWithMateInfo(
int CandidateProcessor::
    int error_threshold, const Index &index,
    GenerateCandidatesFromRepetitiveReadWithMateInfoOnOneStrand(
    const std::vector<Minimizer> &minimizers, uint32_t &repetitive_seed_length,
        const Strand strand, uint32_t search_range, int error_threshold,
    std::vector<uint64_t> &hits, std::vector<Candidate> &candidates,
        const Index &index, const std::vector<Minimizer> &minimizers,
    const std::vector<Candidate> &mate_candidates, const Strand strand,
        const std::vector<Candidate> &mate_candidates,
    uint32_t search_range) const {
        uint32_t &repetitive_seed_length, std::vector<uint64_t> &hits,
  int max_seed_count = index.CollectSeedHitsFromRepetitiveReadWithMateInfo(
        std::vector<Candidate> &candidates) const {
  int max_seed_count =
      index.GenerateCandidatePositionsFromRepetitiveReadWithMateInfo(
          error_threshold, minimizers, repetitive_seed_length, hits,
          error_threshold, minimizers, repetitive_seed_length, hits,
          mate_candidates, strand, search_range,
          mate_candidates, strand, search_range,
          min_num_seeds_required_for_mapping_, max_seed_frequencies_[0]);
          min_num_seeds_required_for_mapping_, max_seed_frequencies_[0]);
+5 −6
Original line number Original line Diff line number Diff line
@@ -46,13 +46,12 @@ class CandidateProcessor {
                                     std::vector<uint64_t> &hits,
                                     std::vector<uint64_t> &hits,
                                     std::vector<Candidate> &candidates) const;
                                     std::vector<Candidate> &candidates) const;


  int GenerateCandidatesFromRepetitiveReadWithMateInfo(
  int GenerateCandidatesFromRepetitiveReadWithMateInfoOnOneStrand(
      int error_threshold, const Index &index,
      const Strand strand, uint32_t search_range, int error_threshold,
      const std::vector<Minimizer> &minimizers,
      const Index &index, const std::vector<Minimizer> &minimizers,
      const std::vector<Candidate> &mate_candidates,
      uint32_t &repetitive_seed_length, std::vector<uint64_t> &hits,
      uint32_t &repetitive_seed_length, std::vector<uint64_t> &hits,
      std::vector<Candidate> &candidates,
      std::vector<Candidate> &candidates) const;
      const std::vector<Candidate> &mate_candidates, const Strand strand,
      uint32_t search_range) const;


  void MergeCandidates(int error_threshold, std::vector<Candidate> &c1,
  void MergeCandidates(int error_threshold, std::vector<Candidate> &c1,
                       std::vector<Candidate> &c2,
                       std::vector<Candidate> &c2,
+1 −1
Original line number Original line Diff line number Diff line
@@ -29,7 +29,7 @@
#include "temp_mapping.h"
#include "temp_mapping.h"
#include "utils.h"
#include "utils.h"


#define CHROMAP_VERSION "0.2.3-r435"
#define CHROMAP_VERSION "0.2.3-r436"


namespace chromap {
namespace chromap {


+1 −1
Original line number Original line Diff line number Diff line
@@ -459,7 +459,7 @@ int Index::GenerateCandidatePositions(
  return repetitive_seed_count;
  return repetitive_seed_count;
}
}


int Index::CollectSeedHitsFromRepetitiveReadWithMateInfo(
int Index::GenerateCandidatePositionsFromRepetitiveReadWithMateInfo(
    int error_threshold, const std::vector<Minimizer> &minimizers,
    int error_threshold, const std::vector<Minimizer> &minimizers,
    uint32_t &repetitive_seed_length, std::vector<uint64_t> &hits,
    uint32_t &repetitive_seed_length, std::vector<uint64_t> &hits,
    const std::vector<Candidate> &mate_candidates, const Strand strand,
    const std::vector<Candidate> &mate_candidates, const Strand strand,
+5 −5
Original line number Original line Diff line number Diff line
@@ -72,11 +72,11 @@ class Index {
      const CandidatePositionGeneratingConfig &generating_config,
      const CandidatePositionGeneratingConfig &generating_config,
      MappingMetadata &mapping_metadata) const;
      MappingMetadata &mapping_metadata) const;


  // Input a search range, for each best mate candidate, serach for minimizer
  // Input a search range, for each best mate candidate, serach for candidate
  // hits. Return the minimizer count of the best candidate if it finishes
  // positions for the read. Return the minimizer count of the best candidate if
  // normally. Or return a negative value if it stops early due to too many
  // it finishes normally. Or return a negative value if it stops early due to
  // candidates with low minimizer count.
  // too many candidates with low minimizer count.
  int CollectSeedHitsFromRepetitiveReadWithMateInfo(
  int GenerateCandidatePositionsFromRepetitiveReadWithMateInfo(
      int error_threshold, const std::vector<Minimizer> &minimizers,
      int error_threshold, const std::vector<Minimizer> &minimizers,
      uint32_t &repetitive_seed_length, std::vector<uint64_t> &hits,
      uint32_t &repetitive_seed_length, std::vector<uint64_t> &hits,
      const std::vector<Candidate> &mate_candidates, const Strand strand,
      const std::vector<Candidate> &mate_candidates, const Strand strand,