Skip to content

Commit

Permalink
add no_duplex option
Browse files Browse the repository at this point in the history
  • Loading branch information
sfchen committed Oct 13, 2021
1 parent a4ce3db commit 46a9df7
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ options:
-r, --ref reference fasta file name (should be an uncompressed .fa/.fasta file) (string)
-b, --bed bed file to specify the capturing region, none by default (string [=])
-x, --duplex_only only output duplex consensus sequences, which means single stranded consensus sequences will be discarded.
--no_duplex don't merge single stranded consensus sequences to duplex consensus sequences.
-u, --umi_prefix the prefix for UMI, if it has. None by default. Check the README for the defails of UMI formats. (string [=auto])
-s, --supporting_reads only output consensus reads/pairs that merged by >= <supporting_reads> reads/pairs. The valud should be 1~10, and the default value is 1. (int [=1])
-a, --ratio_threshold if the ratio of the major base in a cluster is less than <ratio_threshold>, it will be further compared to the reference. The valud should be 0.5~1.0, and the default value is 0.8 (double [=0.8])
Expand Down
2 changes: 1 addition & 1 deletion src/cluster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ vector<Pair*> Cluster::clusterByUMI(int umiDiffThreshold, Stats* preStats, Stats
vector<Pair*> resultConsensusPairs;
int singleConsesusCount = 0;
int duplexConsensusCount = 0;
if(hasUMI) {
if(hasUMI && !mOptions->disableDuplex) {
// make duplex consensus read pairs
while(singleConsensusPairs.size() > 0) {
Pair* p1 = singleConsensusPairs.back();
Expand Down
5 changes: 5 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ int main(int argc, char* argv[]){
cmd.add<string>("ref", 'r', "reference fasta file name (should be an uncompressed .fa/.fasta file)", true, "");
cmd.add<string>("bed", 'b', "bed file to specify the capturing region, none by default", false, "");
cmd.add("duplex_only", 'x', "only output duplex consensus sequences, which means single stranded consensus sequences will be discarded.");
cmd.add("no_duplex", 0, "don't merge single stranded consensus sequences to duplex consensus sequences.");

// UMI
cmd.add<string>("umi_prefix", 'u', "the prefix for UMI, if it has. None by default. Check the README for the defails of UMI formats.", false, "auto");
Expand Down Expand Up @@ -76,6 +77,10 @@ int main(int argc, char* argv[]){
opt.duplexMismatchThreshold = cmd.get<int>("duplex_diff_threshold");
opt.debug = cmd.exist("debug");
opt.duplexOnly = cmd.exist("duplex_only");
opt.disableDuplex = cmd.exist("no_duplex");
if(opt.duplexOnly && opt.disableDuplex) {
error_exit("You cannot enable both duplex_only and no_duplex");
}

// reporting
opt.jsonFile = cmd.get<string>("json");
Expand Down
1 change: 1 addition & 0 deletions src/options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Options::Options(){
coverageStep = 10000;

duplexOnly = false;
disableDuplex = false;
}

bool Options::validate() {
Expand Down
1 change: 1 addition & 0 deletions src/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class Options{
int bedCoverageStep;

bool duplexOnly;
bool disableDuplex;
};

#endif

0 comments on commit 46a9df7

Please sign in to comment.