Commit 560e286a authored by Haowen Zhang's avatar Haowen Zhang
Browse files

Use reference to make code easier to read.

Remove some commented code.
parent 69e90046
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -219,7 +219,7 @@ void Chromap::MapSingleEndReads() {

  MappingWriter<MappingRecord> mapping_writer(mapping_parameters_,
                                              barcode_length_,
                                              /*custom_rid_rank=*/nullptr);
                                              pairs_custom_rid_rank_);

  mapping_writer.OutputHeader(num_reference_sequences, reference);

@@ -609,9 +609,7 @@ void Chromap::MapPairedEndReads() {

  MappingWriter<MappingRecord> mapping_writer(
      mapping_parameters_, barcode_length_,
      mapping_parameters_.mapping_output_format == MAPPINGFORMAT_PAIRS
          ? &pairs_custom_rid_rank_
          : nullptr);
      pairs_custom_rid_rank_);
  mapping_writer.OutputHeader(num_reference_sequences, reference);

  uint32_t num_mappings_in_mem = 0;
+1 −12
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ template <typename MappingRecord>
class MappingGenerator {
 public:
  MappingGenerator() = delete;

  MappingGenerator(const MappingParameters &mapping_parameters,
                   const std::vector<int> &pairs_custom_rid_rank)
      : mapping_parameters_(mapping_parameters),
@@ -199,19 +200,7 @@ class MappingGenerator {
      int force_mapq, uint8_t &mapq1, uint8_t &mapq2);

  const MappingParameters mapping_parameters_;
  // const int error_threshold_;
  const int NUM_VPU_LANES_;
  // const int match_score_;
  // const int mismatch_penalty_;
  // const std::vector<int> gap_open_penalties_;
  // const std::vector<int> gap_extension_penalties_;
  // const int max_num_best_mappings_;
  // const int max_insert_size_;
  // const int min_read_length_;
  // const int drop_repetitive_reads_;
  // const bool is_bulk_data_;
  // const bool split_alignment_;
  // const MappingOutputFormat mapping_output_format_;
  const std::vector<int> pairs_custom_rid_rank_;
};

+2 −3
Original line number Diff line number Diff line
@@ -31,11 +31,10 @@ class MappingWriter {

  MappingWriter(const MappingParameters mapping_parameters,
                const uint32_t cell_barcode_length,
                const std::vector<int> *custom_rid_rank)
                const std::vector<int> &custom_rid_rank)
      : mapping_parameters_(mapping_parameters),
        cell_barcode_length_(cell_barcode_length),
        custom_rid_rank_(custom_rid_rank != nullptr ? *custom_rid_rank
                                                    : std::vector<int>()) {
        custom_rid_rank_(custom_rid_rank) {
    if (!mapping_parameters_.barcode_translate_table_file_path.empty()) {
      barcode_translator_.SetTranslateTable(
          mapping_parameters_.barcode_translate_table_file_path);