• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

MikkelSchubert / adapterremoval / #81

07 Apr 2025 10:01PM UTC coverage: 27.335% (-0.5%) from 27.836%
#81

push

travis-ci

web-flow
fixes/improvements to duplicate statistics (#106)

* fix duplication statistics gathering and add minimal regression tests
* add duplicate statistics plots to html report
* fixed wrongly escaped legend settings for this and other plots
* add implicit argument to `--report-duplication`
* support k/m/g suffixes for `--report-duplication` arguments

0 of 82 new or added lines in 6 files covered. (0.0%)

548 existing lines in 5 files now uncovered.

2719 of 9947 relevant lines covered (27.33%)

4053.34 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/main_adapter_rm.cpp
1
// SPDX-License-Identifier: GPL-3.0-or-later
2
// SPDX-FileCopyrightText: 2011 Stinus Lindgreen <stinus@binf.ku.dk>
3
// SPDX-FileCopyrightText: 2014 Mikkel Schubert <mikkelsch@gmail.com>
4
#include "demultiplexing.hpp" // for demultiplex_pe_reads, demultiplex_se_r...
5
#include "fastq_io.hpp"       // for gzip_split_fastq, post_process_fastq
6
#include "output.hpp"         // for outpuT_file, DEV_NULL
7
#include "reports.hpp"        // for write_html_report, write_json_report
8
#include "scheduler.hpp"      // for scheduler
9
#include "sequence_sets.hpp"  // for adapter_set
10
#include "simd.hpp"           // for size_t
11
#include "statistics.hpp"     // for trim_stats_ptr, trimming_statistics
12
#include "trimming.hpp"       // for pe_reads_processor, se_reads_processor
13
#include "userconfig.hpp"     // for userconfig, output_files, DEV_NULL
14
#include <cstring>            // for size_t
15
#include <limits>             // for numeric_limits
16
#include <memory>             // for make_shared
17
#include <string>             // for operator!=, basic_string, string
18
#include <vector>             // for vector
19

20
namespace adapterremoval {
21

22
int
23
remove_adapter_sequences(const userconfig& config)
×
24
{
25
  scheduler sch;
×
26

27
  statistics stats = statistics_builder()
×
28
                       .sample_rate(config.report_sample_rate)
×
29
                       .estimate_duplication(config.report_duplication)
×
30
                       .demultiplexing(config.samples.size())
×
31
                       .initialize();
×
32

33
  auto output = config.get_output_filenames();
×
34
  // Add write steps for demultiplexed and per-samples output
35
  output.add_write_steps(sch, config);
×
36

37
  post_demux_steps steps;
×
38

39
  // Step 4 - N: Trim and write (demultiplexed) reads
40
  for (size_t nth = 0; nth < output.samples().size(); ++nth) {
×
41
    stats.trimming.push_back(std::make_shared<trimming_statistics>());
×
42

43
    if (!config.is_adapter_trimming_enabled()) {
×
44
      steps.samples.push_back(
×
45
        sch.add<process_demultiplexed>(config,
×
46
                                       output.get_sample(nth),
47
                                       nth,
48
                                       stats.trimming.back()));
×
49
    } else if (config.paired_ended_mode) {
×
50
      steps.samples.push_back(
×
51
        sch.add<pe_reads_processor>(config,
×
52
                                    output.get_sample(nth),
53
                                    nth,
54
                                    stats.trimming.back()));
×
55
    } else {
56
      steps.samples.push_back(
×
57
        sch.add<se_reads_processor>(config,
×
58
                                    output.get_sample(nth),
59
                                    nth,
60
                                    stats.trimming.back()));
×
61
    }
62
  }
63

64
  // Step 3: Parse and demultiplex reads based on single or double indices
65
  size_t processing_step = std::numeric_limits<size_t>::max();
×
66
  if (config.is_demultiplexing_enabled()) {
×
67
    // Statistics and serialization of unidentified reads
68
    steps.unidentified =
×
69
      sch.add<processes_unidentified>(config, output, stats.demultiplexing);
×
70

71
    if (config.paired_ended_mode) {
×
72
      processing_step =
×
73
        sch.add<demultiplex_pe_reads>(config, steps, stats.demultiplexing);
×
74
    } else {
75
      processing_step =
×
76
        sch.add<demultiplex_se_reads>(config, steps, stats.demultiplexing);
×
77
    }
78
  } else {
79
    processing_step = steps.samples.back();
×
80
  }
81

82
  // Step 2: Post-process, validate, and collect statistics on FASTQ reads
83
  const size_t postproc_step =
×
84
    sch.add<post_process_fastq>(config, processing_step, stats);
×
85

86
  // Step 1: Read input file(s)
NEW
87
  read_fastq::add_steps(sch, config, postproc_step, stats);
×
88

89
  if (!sch.run(config.max_threads)) {
×
90
    return 1;
91
  }
92

93
  if (!write_json_report(config, stats, output.settings_json)) {
×
94
    return 1;
95
  }
96

97
  return !write_html_report(config, stats, output.settings_html);
×
98
}
99

100
} // namespace adapterremoval
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc