diff --git a/README.md b/README.md index a5771e1..ab97952 100644 --- a/README.md +++ b/README.md @@ -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 >= 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 , 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]) diff --git a/src/cluster.cpp b/src/cluster.cpp index 20d1e5f..fb893b0 100644 --- a/src/cluster.cpp +++ b/src/cluster.cpp @@ -116,7 +116,7 @@ vector Cluster::clusterByUMI(int umiDiffThreshold, Stats* preStats, Stats vector 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(); diff --git a/src/main.cpp b/src/main.cpp index 72bba8b..04eefe0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -33,6 +33,7 @@ int main(int argc, char* argv[]){ cmd.add("ref", 'r', "reference fasta file name (should be an uncompressed .fa/.fasta file)", true, ""); cmd.add("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("umi_prefix", 'u', "the prefix for UMI, if it has. None by default. Check the README for the defails of UMI formats.", false, "auto"); @@ -76,6 +77,10 @@ int main(int argc, char* argv[]){ opt.duplexMismatchThreshold = cmd.get("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("json"); diff --git a/src/options.cpp b/src/options.cpp index c157954..4454c30 100644 --- a/src/options.cpp +++ b/src/options.cpp @@ -36,6 +36,7 @@ Options::Options(){ coverageStep = 10000; duplexOnly = false; + disableDuplex = false; } bool Options::validate() { diff --git a/src/options.h b/src/options.h index 66acfee..2b29adb 100644 --- a/src/options.h +++ b/src/options.h @@ -57,6 +57,7 @@ class Options{ int bedCoverageStep; bool duplexOnly; + bool disableDuplex; }; #endif \ No newline at end of file