Skip to content

Commit

Permalink
evaluate secondary alignments
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasrausch committed Aug 21, 2018
1 parent 9d57fb2 commit 0b2afc7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/bamstats.h
Expand Up @@ -362,7 +362,9 @@ namespace bamstats
} else {
++itRg->second.rc.mappedchr[refIndex];
}
continue;
if (rec->core.flag & BAM_FSECONDARY) {
if (!c.secondary) continue;
} else continue;
}
++itRg->second.qc.qcount[(int32_t) rec->core.qual];
++itRg->second.rc.mappedchr[refIndex];
Expand Down
6 changes: 6 additions & 0 deletions src/qc.h
Expand Up @@ -54,6 +54,7 @@ struct ConfigQC {
bool singleRG;
bool isHaplotagged;
bool isMitagged;
bool secondary;
std::string rgname;
std::string sampleName;
std::string format;
Expand All @@ -77,6 +78,7 @@ int qc(int argc, char **argv) {
("bed,b", boost::program_options::value<boost::filesystem::path>(&c.regionFile), "bed file with target regions (optional)")
("format,f", boost::program_options::value<std::string>(&c.format)->default_value("tsv"), "output format [tsv|json]")
("outfile,o", boost::program_options::value<boost::filesystem::path>(&c.outfile)->default_value("qc.tsv.gz"), "gzipped output file")
("secondary,s", "evaluate secondary alignments")
;

boost::program_options::options_description rgopt("Read-group options");
Expand Down Expand Up @@ -111,6 +113,10 @@ int qc(int argc, char **argv) {
return 1;
}

// Secondary alignments
if (vm.count("secondary")) c.secondary = true;
else c.secondary = false;

// Ignore read groups
if (vm.count("ignore")) {
c.ignoreRG = true;
Expand Down

0 comments on commit 0b2afc7

Please sign in to comment.