MCPcopy Create free account
hub / github.com/OpenGene/fastp / processSingleEnd

Method processSingleEnd

src/seprocessor.cpp:197–325  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

195}
196
197bool SingleEndProcessor::processSingleEnd(ReadPack* pack, ThreadConfig* config){
198 // build output on stack strings, move to heap only when handing off to writers
199 string outstr, failedOut;
200 outstr.reserve(pack->count * 320);
201 int tid = config->getThreadId();
202
203 int readPassed = 0;
204 for(int p=0;p<pack->count;p++){
205
206 // original read1
207 Read* or1 = pack->data[p];
208
209 // stats the original read before trimming
210 config->getPreStats1()->statRead(or1);
211
212 // handling the duplication profiling
213 bool dedupOut = false;
214 if(mDuplicate) {
215 bool isDup = mDuplicate->checkRead(or1);
216 if(mOptions->duplicate.dedup && isDup)
217 dedupOut = true;
218 }
219
220 // filter by index
221 if(mOptions->indexFilter.enabled && mFilter->filterByIndex(or1)) {
222 recycleToPool(tid, or1);
223 continue;
224 }
225
226 // fix MGI
227 if(mOptions->fixMGI) {
228 or1->fixMGI();
229 }
230
231 // umi processing
232 if(mOptions->umi.enabled)
233 mUmiProcessor->process(or1);
234
235 int frontTrimmed = 0;
236 // trim in head and tail, and apply quality cut in sliding window
237 Read* r1 = mFilter->trimAndCut(or1, mOptions->trim.front1, mOptions->trim.tail1, frontTrimmed);
238
239 if(r1 != NULL) {
240 if(mOptions->polyGTrim.enabled)
241 PolyX::trimPolyG(r1, config->getFilterResult(), mOptions->polyGTrim.minLen);
242 }
243
244 bool isAdapterDimer = false;
245 if(r1 != NULL && mOptions->adapter.enabled){
246 bool trimmed = false;
247 if(mOptions->adapter.hasSeqR1)
248 trimmed = AdapterTrimmer::trimBySequence(r1, config->getFilterResult(), mOptions->adapter.sequence, false);
249 if(mOptions->adapter.hasFasta) {
250 trimmed |= AdapterTrimmer::trimByMultiSequences(r1, config->getFilterResult(), mOptions->adapter.seqsInFasta, false);
251 }
252
253 if(trimmed )
254 config->getFilterResult()->incTrimmedAdapterRead(1);

Callers

nothing calls this directly

Calls 15

getThreadIdMethod · 0.80
statReadMethod · 0.80
getPreStats1Method · 0.80
checkReadMethod · 0.80
filterByIndexMethod · 0.80
fixMGIMethod · 0.80
trimAndCutMethod · 0.80
getFilterResultMethod · 0.80
incTrimmedAdapterReadMethod · 0.80
resizeMethod · 0.80
passFilterMethod · 0.80
appendToStringMethod · 0.80

Tested by

no test coverage detected