@@ -95,7 +95,6 @@ vector<Pair*> Cluster::clusterByUMI(int umiDiffThreshold, Stats* preStats, Stats
9595 // if(mPairs.size()>0 || subClusters.size()>0)
9696 // cerr << "UMI " << topUMI<< " " << topCount << "/" << c->mPairs.size() << endl;
9797 subClusters.push_back (c);
98- preStats->addMolecule (c->mPairs .size (), isPE);
9998 umiCount[topUMI] = 0 ;
10099 }
101100
@@ -133,6 +132,7 @@ vector<Pair*> Cluster::clusterByUMI(int umiDiffThreshold, Stats* preStats, Stats
133132 // merge p2 to p1
134133 int diff = duplexMerge (p1, p2);
135134 // cerr << " diff " << diff << endl;
135+ preStats->addMolecule (p1->mMergeReads + p2->mMergeReads , p1->mLeft && p1->mRight );
136136 if (diff <= mOptions ->duplexMismatchThreshold ) {
137137 if (p1->mMergeReads + p2->mMergeReads >= mOptions ->clusterSizeReq ) {
138138 duplexConsensusCount++;
@@ -154,6 +154,7 @@ vector<Pair*> Cluster::clusterByUMI(int umiDiffThreshold, Stats* preStats, Stats
154154 }
155155 // no duplex found, treat it as sscs
156156 if (!foundDuplex) {
157+ preStats->addMolecule (p1->mMergeReads , p1->mLeft && p1->mRight );
157158 if (!mOptions ->duplexOnly && p1->mMergeReads >= mOptions ->clusterSizeReq ) {
158159 singleConsesusCount++;
159160 p1->writeSscsDcsTag ();
@@ -168,6 +169,7 @@ vector<Pair*> Cluster::clusterByUMI(int umiDiffThreshold, Stats* preStats, Stats
168169 // no umi, no duplex
169170 for (int i=0 ;i<singleConsensusPairs.size (); i++) {
170171 Pair* p = singleConsensusPairs[i];
172+ preStats->addMolecule (p->mMergeReads , p->mLeft && p->mRight );
171173 if (!mOptions ->duplexOnly && p->mMergeReads >= mOptions ->clusterSizeReq ) {
172174 singleConsesusCount++;
173175 p->writeSscsDcsTag ();
0 commit comments