Skip to content

Commit 46a9df7

Browse files
committed
add no_duplex option
1 parent a4ce3db commit 46a9df7

File tree

5 files changed

+9
-1
lines changed

5 files changed

+9
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ options:
200200
-r, --ref reference fasta file name (should be an uncompressed .fa/.fasta file) (string)
201201
-b, --bed bed file to specify the capturing region, none by default (string [=])
202202
-x, --duplex_only only output duplex consensus sequences, which means single stranded consensus sequences will be discarded.
203+
--no_duplex don't merge single stranded consensus sequences to duplex consensus sequences.
203204
-u, --umi_prefix the prefix for UMI, if it has. None by default. Check the README for the defails of UMI formats. (string [=auto])
204205
-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])
205206
-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])

src/cluster.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ vector<Pair*> Cluster::clusterByUMI(int umiDiffThreshold, Stats* preStats, Stats
116116
vector<Pair*> resultConsensusPairs;
117117
int singleConsesusCount = 0;
118118
int duplexConsensusCount = 0;
119-
if(hasUMI) {
119+
if(hasUMI && !mOptions->disableDuplex) {
120120
// make duplex consensus read pairs
121121
while(singleConsensusPairs.size() > 0) {
122122
Pair* p1 = singleConsensusPairs.back();

src/main.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ int main(int argc, char* argv[]){
3333
cmd.add<string>("ref", 'r', "reference fasta file name (should be an uncompressed .fa/.fasta file)", true, "");
3434
cmd.add<string>("bed", 'b', "bed file to specify the capturing region, none by default", false, "");
3535
cmd.add("duplex_only", 'x', "only output duplex consensus sequences, which means single stranded consensus sequences will be discarded.");
36+
cmd.add("no_duplex", 0, "don't merge single stranded consensus sequences to duplex consensus sequences.");
3637

3738
// UMI
3839
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");
@@ -76,6 +77,10 @@ int main(int argc, char* argv[]){
7677
opt.duplexMismatchThreshold = cmd.get<int>("duplex_diff_threshold");
7778
opt.debug = cmd.exist("debug");
7879
opt.duplexOnly = cmd.exist("duplex_only");
80+
opt.disableDuplex = cmd.exist("no_duplex");
81+
if(opt.duplexOnly && opt.disableDuplex) {
82+
error_exit("You cannot enable both duplex_only and no_duplex");
83+
}
7984

8085
// reporting
8186
opt.jsonFile = cmd.get<string>("json");

src/options.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ Options::Options(){
3636
coverageStep = 10000;
3737

3838
duplexOnly = false;
39+
disableDuplex = false;
3940
}
4041

4142
bool Options::validate() {

src/options.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ class Options{
5757
int bedCoverageStep;
5858

5959
bool duplexOnly;
60+
bool disableDuplex;
6061
};
6162

6263
#endif

0 commit comments

Comments
 (0)