diff --git a/README.md b/README.md index aaea0e7..421d3bf 100644 --- a/README.md +++ b/README.md @@ -335,60 +335,65 @@ options: -i, --in1 read1 input file name (string) -o, --out1 read1 output file name (string [=]) -I, --in2 read2 input file name (string [=]) - -O, --out2 read2 output file name (string [=]) - --unpaired1 for PE input, if read1 passed QC but read2 not, it will be written to unpaired1. Default is to discard it. (string [=]) - --unpaired2 for PE input, if read2 passed QC but read1 not, it will be written to unpaired2. If --unpaired2 is same as --unpaired1 (default mode), both unpaired reads will be written to this same file. (string [=]) - --failed_out specify the file to store reads that cannot pass the filters. (string [=]) - --overlapped_out for each read pair, output the overlapped region if it has no any mismatched base. (string [=]) - -m, --merge for paired-end input, merge each pair of reads into a single read if they are overlapped. The merged reads will be written to the file given by --merged_out, the unmerged reads will be written to the files specified by --out1 and --out2. The merging mode is disabled by default. - --merged_out in the merging mode, specify the file name to store merged output, or specify --stdout to stream the merged output (string [=]) - --include_unmerged in the merging mode, write the unmerged or unpaired reads to the file specified by --merge. Disabled by default. + -O, --out2 read2 output file name (string [=]) + --unpaired1 for PE input, if read1 passed QC but read2 not, it will be written to unpaired1. Default is to discard it. (string [=]) + --unpaired2 for PE input, if read2 passed QC but read1 not, it will be written to unpaired2. If --unpaired2 is same as --unpaired1 (default mode), both unpaired reads will be written to this same file. (string [=]) + --failed_out specify the file to store reads that cannot pass the filters. (string [=]) + --overlapped_out for each read pair, output the overlapped region if it has no any mismatched base. (string [=]) + -m, --merge for paired-end input, merge each pair of reads into a single read if they are overlapped. The merged reads will be written to the file given by --merged_out, the unmerged reads will be written to the files specified by --out1 and --out2. The merging mode is disabled by default. + --merged_out in the merging mode, specify the file name to store merged output, or specify --stdout to stream the merged output (string [=]) + --include_unmerged in the merging mode, write the unmerged or unpaired reads to the file specified by --merge. Disabled by default. -6, --phred64 indicate the input is using phred64 scoring (it'll be converted to phred33, so the output will still be phred33) -z, --compression compression level for gzip output (1 ~ 9). 1 is fastest, 9 is smallest, default is 4. (int [=4]) - --stdin input from STDIN. If the STDIN is interleaved paired-end FASTQ, please also add --interleaved_in. - --stdout output passing-filters reads to STDOUT. This option will result in interleaved FASTQ output for paired-end input. Disabled by default. - --interleaved_in indicate that is an interleaved FASTQ which contains both read1 and read2. Disabled by default. + --stdin input from STDIN. If the STDIN is interleaved paired-end FASTQ, please also add --interleaved_in. + --stdout output passing-filters reads to STDOUT. This option will result in interleaved FASTQ output for paired-end input. Disabled by default. + --interleaved_in indicate that is an interleaved FASTQ which contains both read1 and read2. Disabled by default. --reads_to_process specify how many reads/pairs to be processed. Default 0 means process all reads. (int [=0]) --dont_overwrite don't overwrite existing files. Overwritting is allowed by default. - --fix_mgi_id the MGI FASTQ ID format is not compatible with many BAM operation tools, enable this option to fix it. - + --fix_mgi_id the MGI FASTQ ID format is not compatible with many BAM operation tools, enable this option to fix it. + # adapter trimming options -A, --disable_adapter_trimming adapter trimming is enabled by default. If this option is specified, adapter trimming is disabled - -a, --adapter_sequence the adapter for read1. For SE data, if not specified, the adapter will be auto-detected. For PE data, this is used if R1/R2 are found not overlapped. (string [=auto]) - --adapter_sequence_r2 the adapter for read2 (PE data only). This is used if R1/R2 are found not overlapped. If not specified, it will be the same as (string [=]) - --adapter_fasta specify a FASTA file to trim both read1 and read2 (if PE) by all the sequences in this FASTA file (string [=]) - --detect_adapter_for_pe by default, the adapter sequence auto-detection is enabled for SE data only, turn on this option to enable it for PE data. - + -a, --adapter_sequence the adapter for read1. For SE data, if not specified, the adapter will be auto-detected. For PE data, this is used if R1/R2 are found not overlapped. (string [=auto]) + --adapter_sequence_r2 the adapter for read2 (PE data only). This is used if R1/R2 are found not overlapped. If not specified, it will be the same as (string [=]) + --adapter_fasta specify a FASTA file to trim both read1 and read2 (if PE) by all the sequences in this FASTA file (string [=]) + --detect_adapter_for_pe by default, the adapter sequence auto-detection is enabled for SE data only, turn on this option to enable it for PE data. + --adapter_mm_freq allowed mismatched within every n bases to detect adapter. 8 by defaults. (int [=8]) + # global trimming options - -f, --trim_front1 trimming how many bases in front for read1, default is 0 (int [=0]) - -t, --trim_tail1 trimming how many bases in tail for read1, default is 0 (int [=0]) - -b, --max_len1 if read1 is longer than max_len1, then trim read1 at its tail to make it as long as max_len1. Default 0 means no limitation (int [=0]) - -F, --trim_front2 trimming how many bases in front for read2. If it's not specified, it will follow read1's settings (int [=0]) - -T, --trim_tail2 trimming how many bases in tail for read2. If it's not specified, it will follow read1's settings (int [=0]) - -B, --max_len2 if read2 is longer than max_len2, then trim read2 at its tail to make it as long as max_len2. Default 0 means no limitation. If it's not specified, it will follow read1's settings (int [=0]) + -f, --trim_front1 trimming how many bases in front for read1, default is 0 (int [=0]) + -t, --trim_tail1 trimming how many bases in tail for read1, default is 0 (int [=0]) + -b, --max_len1 if read1 is longer than max_len1, then trim read1 at its tail to make it as long as max_len1. Default 0 means no limitation (int [=0]) + -F, --trim_front2 trimming how many bases in front for read2. If it's not specified, it will follow read1's settings (int [=0]) + -T, --trim_tail2 trimming how many bases in tail for read2. If it's not specified, it will follow read1's settings (int [=0]) + -B, --max_len2 if read2 is longer than max_len2, then trim read2 at its tail to make it as long as max_len2. Default 0 means no limitation. If it's not specified, it will follow read1's settings (int [=0]) # polyG tail trimming, useful for NextSeq/NovaSeq data -g, --trim_poly_g force polyG tail trimming, by default trimming is automatically enabled for Illumina NextSeq/NovaSeq data - --poly_g_min_len the minimum length to detect polyG in the read tail. 10 by default. (int [=10]) + --poly_g_min_len the minimum length to detect polyG in the read tail. 10 by default. (int [=10]) + --poly_g_mm_freq allowed mismatched within every n bases to detect polyG. 8 by defaults. (int [=8]) + --poly_g_mm_max the maximum number of mismatched allowed in detecting polyG. 5 by defaults. (int [=5]) -G, --disable_trim_poly_g disable polyG tail trimming, by default trimming is automatically enabled for Illumina NextSeq/NovaSeq data # polyX tail trimming - -x, --trim_poly_x enable polyX trimming in 3' ends. - --poly_x_min_len the minimum length to detect polyX in the read tail. 10 by default. (int [=10]) - + -x, --trim_poly_x enable polyX trimming in 3' ends. + --poly_x_min_len the minimum length to detect polyX in the read tail. 10 by default. (int [=10]) + --poly_x_mm_freq allowed mismatched within every n bases to detect polyX. 8 by defaults. (int [=8]) + --poly_x_mm_max the maximum number of mismatched allowed in detecting polyX. 5 by defaults. (int [=5]) + # per read cutting by quality options - -5, --cut_front move a sliding window from front (5') to tail, drop the bases in the window if its mean quality < threshold, stop otherwise. - -3, --cut_tail move a sliding window from tail (3') to front, drop the bases in the window if its mean quality < threshold, stop otherwise. - -r, --cut_right move a sliding window from front to tail, if meet one window with mean quality < threshold, drop the bases in the window and the right part, and then stop. - -W, --cut_window_size the window size option shared by cut_front, cut_tail or cut_sliding. Range: 1~1000, default: 4 (int [=4]) - -M, --cut_mean_quality the mean quality requirement option shared by cut_front, cut_tail or cut_sliding. Range: 1~36 default: 20 (Q20) (int [=20]) - --cut_front_window_size the window size option of cut_front, default to cut_window_size if not specified (int [=4]) - --cut_front_mean_quality the mean quality requirement option for cut_front, default to cut_mean_quality if not specified (int [=20]) - --cut_tail_window_size the window size option of cut_tail, default to cut_window_size if not specified (int [=4]) - --cut_tail_mean_quality the mean quality requirement option for cut_tail, default to cut_mean_quality if not specified (int [=20]) - --cut_right_window_size the window size option of cut_right, default to cut_window_size if not specified (int [=4]) - --cut_right_mean_quality the mean quality requirement option for cut_right, default to cut_mean_quality if not specified (int [=20]) - + -5, --cut_front move a sliding window from front (5') to tail, drop the bases in the window if its mean quality < threshold, stop otherwise. + -3, --cut_tail move a sliding window from tail (3') to front, drop the bases in the window if its mean quality < threshold, stop otherwise. + -r, --cut_right move a sliding window from front to tail, if meet one window with mean quality < threshold, drop the bases in the window and the right part, and then stop. + -W, --cut_window_size the window size option shared by cut_front, cut_tail or cut_sliding. Range: 1~1000, default: 4 (int [=4]) + -M, --cut_mean_quality the mean quality requirement option shared by cut_front, cut_tail or cut_sliding. Range: 1~36 default: 20 (Q20) (int [=20]) + --cut_front_window_size the window size option of cut_front, default to cut_window_size if not specified (int [=4]) + --cut_front_mean_quality the mean quality requirement option for cut_front, default to cut_mean_quality if not specified (int [=20]) + --cut_tail_window_size the window size option of cut_tail, default to cut_window_size if not specified (int [=4]) + --cut_tail_mean_quality the mean quality requirement option for cut_tail, default to cut_mean_quality if not specified (int [=20]) + --cut_right_window_size the window size option of cut_right, default to cut_window_size if not specified (int [=4]) + --cut_right_mean_quality the mean quality requirement option for cut_right, default to cut_mean_quality if not specified (int [=20]) + # quality filtering options -Q, --disable_quality_filtering quality filtering is enabled by default. If this option is specified, quality filtering is disabled -q, --qualified_quality_phred the quality value that a base is qualified. Default 15 means phred quality >=Q15 is qualified. (int [=15]) @@ -396,51 +401,50 @@ options: -n, --n_base_limit if one read's number of N base is >n_base_limit, then this read/pair is discarded. Default is 5 (int [=5]) -e, --average_qual if one read's average quality score =1000), a sequential number prefix will be added to output name ( 0001.out.fq, 0002.out.fq...), disabled by default (long [=0]) -d, --split_prefix_digits the digits for the sequential number padding (1~10), default is 4, so the filename will be padded as 0001.xxx, 0 to disable padding (int [=4]) - + # help -?, --help print this message ``` diff --git a/src/adaptertrimmer.cpp b/src/adaptertrimmer.cpp index cca780f..6764b59 100644 --- a/src/adaptertrimmer.cpp +++ b/src/adaptertrimmer.cpp @@ -45,7 +45,7 @@ bool AdapterTrimmer::trimByOverlapAnalysis(Read* r1, Read* r2, FilterResult* fr, return false; } -bool AdapterTrimmer::trimByMultiSequences(Read* r, FilterResult* fr, vector& adapterList, bool isR2, bool incTrimmedCounter) { +bool AdapterTrimmer::trimByMultiSequences(Read* r, FilterResult* fr, vector& adapterList, bool isR2, int allowOneMismatchForEach, bool incTrimmedCounter) { int matchReq = 4; if(adapterList.size() > 16) matchReq = 5; @@ -69,8 +69,7 @@ bool AdapterTrimmer::trimByMultiSequences(Read* r, FilterResult* fr, vectorlength(); int alen = adapterseq.length(); @@ -141,6 +140,7 @@ bool AdapterTrimmer::test() { "+", "///EEEEEEEEEEEEEEEEEEEEEEEEEE////EEEEEEEEEEEEE////E////E"); string adapter = "TTTTCCACGGGGATACTACTG"; + bool trimmed = AdapterTrimmer::trimBySequence(&r, NULL, adapter); if (r.mSeq.mStr != "TTTTAACCCCCCCCCCCCCCCCCCCCCCCCCCCCAATTTTAAAA") return false; @@ -161,4 +161,4 @@ bool AdapterTrimmer::test() { } return true; -} \ No newline at end of file +} diff --git a/src/adaptertrimmer.h b/src/adaptertrimmer.h index 0ab8904..ff372a0 100644 --- a/src/adaptertrimmer.h +++ b/src/adaptertrimmer.h @@ -17,12 +17,11 @@ class AdapterTrimmer{ static bool trimByOverlapAnalysis(Read* r1, Read* r2, FilterResult* fr, int diffLimit, int overlapRequire, double diffPercentLimit); static bool trimByOverlapAnalysis(Read* r1, Read* r2, FilterResult* fr, OverlapResult ov, int frontTrimmed1 = 0, int frontTrimmed2 = 0); - static bool trimBySequence(Read* r1, FilterResult* fr, string& adapter, bool isR2 = false, int matchReq = 4); - static bool trimByMultiSequences(Read* r1, FilterResult* fr, vector& adapterList, bool isR2 = false, bool incTrimmedCounter = true); + static bool trimBySequence(Read* r1, FilterResult* fr, string& adapter, bool isR2 = false, int allowOneMismatchForEach = 8, int matchReq = 4); + static bool trimByMultiSequences(Read* r1, FilterResult* fr, vector& adapterList, bool isR2 = false, int allowOneMismatchForEach = 8, bool incTrimmedCounter = true); static bool test(); - }; -#endif \ No newline at end of file +#endif diff --git a/src/main.cpp b/src/main.cpp index d07c803..89a2885 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -58,6 +58,7 @@ int main(int argc, char* argv[]){ cmd.add("adapter_sequence_r2", 0, "the adapter for read2 (PE data only). This is used if R1/R2 are found not overlapped. If not specified, it will be the same as ", false, "auto"); cmd.add("adapter_fasta", 0, "specify a FASTA file to trim both read1 and read2 (if PE) by all the sequences in this FASTA file", false, ""); cmd.add("detect_adapter_for_pe", 0, "by default, the auto-detection for adapter is for SE data input only, turn on this option to enable it for PE data."); + cmd.add("adapter_mm_freq", 0, "allowed mismatched within every n bases to detect adapter. 8 by defaults.", false, 8); // trimming cmd.add("trim_front1", 'f', "trimming how many bases in front for read1, default is 0", false, 0); @@ -71,10 +72,14 @@ int main(int argc, char* argv[]){ cmd.add("trim_poly_g", 'g', "force polyG tail trimming, by default trimming is automatically enabled for Illumina NextSeq/NovaSeq data"); cmd.add("poly_g_min_len", 0, "the minimum length to detect polyG in the read tail. 10 by default.", false, 10); cmd.add("disable_trim_poly_g", 'G', "disable polyG tail trimming, by default trimming is automatically enabled for Illumina NextSeq/NovaSeq data"); - + cmd.add("poly_g_mm_freq", 0, "allowed mismatched within every n bases to detect polyG. 8 by defaults.", false, 8); + cmd.add("poly_g_mm_max", 0, "the maximum number of mismatched allowed in detecting polyG. 5 by defaults.", false, 5); + // polyX tail trimming cmd.add("trim_poly_x", 'x', "enable polyX trimming in 3' ends."); cmd.add("poly_x_min_len", 0, "the minimum length to detect polyX in the read tail. 10 by default.", false, 10); + cmd.add("poly_x_mm_freq", 0, "allowed mismatched within every n bases to detect polyX. 8 by defaults.", false, 8); + cmd.add("poly_x_mm_max", 0, "the maximum number of mismatched allowed in detecting polyX. 5 by defaults.", false, 5); // cutting by quality cmd.add("cut_front", '5', "move a sliding window from front (5') to tail, drop the bases in the window if its mean quality < threshold, stop otherwise."); @@ -192,6 +197,7 @@ int main(int argc, char* argv[]){ opt.adapter.detectAdapterForPE = cmd.exist("detect_adapter_for_pe"); opt.adapter.sequence = cmd.get("adapter_sequence"); opt.adapter.sequenceR2 = cmd.get("adapter_sequence_r2"); + opt.adapter.allowOneMismatchForEach = cmd.get("adapter_mm_freq"); opt.adapter.fastaFile = cmd.get("adapter_fasta"); if(opt.adapter.sequenceR2=="auto" && !opt.adapter.detectAdapterForPE && opt.adapter.sequence != "auto") { opt.adapter.sequenceR2 = opt.adapter.sequence; @@ -233,6 +239,8 @@ int main(int argc, char* argv[]){ opt.polyXTrim.enabled = true; } opt.polyXTrim.minLen = cmd.get("poly_x_min_len"); + opt.polyXTrim.allowOneMismatchForEach = cmd.get("poly_x_mm_freq"); + opt.polyXTrim.maxMismatch = cmd.get("poly_x_mm_max"); // sliding window cutting by quality diff --git a/src/options.h b/src/options.h index b4f3029..358102a 100644 --- a/src/options.h +++ b/src/options.h @@ -82,10 +82,14 @@ class PolyGTrimmerOptions { PolyGTrimmerOptions() { enabled = false; minLen = 10; + allowOneMismatchForEach = 8; + maxMismatch = 5; } public: bool enabled; int minLen; + int allowOneMismatchForEach; + int maxMismatch; }; class PolyXTrimmerOptions { @@ -93,10 +97,14 @@ class PolyXTrimmerOptions { PolyXTrimmerOptions() { enabled = false; minLen = 10; + allowOneMismatchForEach = 8; + maxMismatch = 5; } public: bool enabled; int minLen; + int allowOneMismatchForEach; + int maxMismatch; }; class UMIOptions { @@ -194,6 +202,7 @@ class AdapterOptions { public: AdapterOptions() { enabled = true; + allowOneMismatchForEach = 8; hasSeqR1 = false; hasSeqR2 = false; detectAdapterForPE = false; @@ -204,6 +213,7 @@ class AdapterOptions { string sequenceR2; string detectedAdapter1; string detectedAdapter2; + int allowOneMismatchForEach; vector seqsInFasta; string fastaFile; bool hasSeqR1; @@ -376,4 +386,4 @@ class Options{ }; -#endif \ No newline at end of file +#endif diff --git a/src/peprocessor.cpp b/src/peprocessor.cpp index 5859e97..849a832 100644 --- a/src/peprocessor.cpp +++ b/src/peprocessor.cpp @@ -371,7 +371,9 @@ bool PairEndProcessor::processPairEnd(ReadPairPack* pack, ThreadConfig* config){ if(r1 != NULL && r2!=NULL) { if(mOptions->polyGTrim.enabled) - PolyX::trimPolyG(r1, r2, config->getFilterResult(), mOptions->polyGTrim.minLen); + PolyX::trimPolyG(r1, r2, config->getFilterResult(), mOptions->polyGTrim.minLen, mOptions->polyGTrim.allowOneMismatchForEach, mOptions->polyGTrim.maxMismatch); + if(mOptions->polyXTrim.enabled) + PolyX::trimPolyX(r1, r2, config->getFilterResult(), mOptions->polyXTrim.minLen, mOptions->polyXTrim.allowOneMismatchForEach, mOptions->polyXTrim.maxMismatch); } bool isizeEvaluated = false; if(r1 != NULL && r2!=NULL && (mOptions->adapter.enabled || mOptions->correction.enabled)){ @@ -416,11 +418,6 @@ bool PairEndProcessor::processPairEnd(ReadPairPack* pack, ThreadConfig* config){ isizeEvaluated = true; } - if(r1 != NULL && r2!=NULL) { - if(mOptions->polyXTrim.enabled) - PolyX::trimPolyX(r1, r2, config->getFilterResult(), mOptions->polyXTrim.minLen); - } - if(r1 != NULL && r2!=NULL) { if( mOptions->trim.maxLen1 > 0 && mOptions->trim.maxLen1 < r1->length()) r1->resize(mOptions->trim.maxLen1); diff --git a/src/polyx.cpp b/src/polyx.cpp index 0b30575..d88fa61 100644 --- a/src/polyx.cpp +++ b/src/polyx.cpp @@ -8,15 +8,12 @@ PolyX::PolyX(){ PolyX::~PolyX(){ } -void PolyX::trimPolyG(Read* r1, Read* r2, FilterResult* fr, int compareReq) { - trimPolyG(r1, fr, compareReq); - trimPolyG(r2, fr, compareReq); +void PolyX::trimPolyG(Read* r1, Read* r2, FilterResult* fr, int compareReq, int allowOneMismatchForEach, int maxMismatch) { + trimPolyG(r1, fr, compareReq, allowOneMismatchForEach, maxMismatch); + trimPolyG(r2, fr, compareReq, allowOneMismatchForEach, maxMismatch); } -void PolyX::trimPolyG(Read* r, FilterResult* fr, int compareReq) { - const int allowOneMismatchForEach = 8; - const int maxMismatch = 5; - +void PolyX::trimPolyG(Read* r, FilterResult* fr, int compareReq, int allowOneMismatchForEach, int maxMismatch) { const char* data = r->mSeq.mStr.c_str(); int rlen = r->length(); @@ -41,15 +38,12 @@ void PolyX::trimPolyG(Read* r, FilterResult* fr, int compareReq) { } } -void PolyX::trimPolyX(Read* r1, Read* r2, FilterResult* fr, int compareReq) { - trimPolyX(r1, fr, compareReq); - trimPolyX(r2, fr, compareReq); +void PolyX::trimPolyX(Read* r1, Read* r2, FilterResult* fr, int compareReq, int allowOneMismatchForEach, int maxMismatch) { + trimPolyX(r1, fr, compareReq, allowOneMismatchForEach, maxMismatch); + trimPolyX(r2, fr, compareReq, allowOneMismatchForEach, maxMismatch); } -void PolyX::trimPolyX(Read* r, FilterResult* fr, int compareReq) { - const int allowOneMismatchForEach = 8; - const int maxMismatch = 5; - +void PolyX::trimPolyX(Read* r, FilterResult* fr, int compareReq, int allowOneMismatchForEach, int maxMismatch) { const char* data = r->mSeq.mStr.c_str(); int rlen = r->length(); @@ -123,8 +117,8 @@ bool PolyX::test() { "///EEEEEEEEEEEEEEEEEEEEEEEEEE////EEEEEEEEEEEEE////E////E"); FilterResult fr(NULL, false); - PolyX::trimPolyX(&r, &fr, 10); + PolyX::trimPolyX(&r, NULL, 10, 8, 5); r.print(); return r.mSeq.mStr == "ATTTT" && fr.getTotalPolyXTrimmedReads() == 1 && fr.getTotalPolyXTrimmedBases() == 51; -} \ No newline at end of file +} diff --git a/src/polyx.h b/src/polyx.h index a1dbac9..51ad649 100644 --- a/src/polyx.h +++ b/src/polyx.h @@ -15,14 +15,14 @@ class PolyX{ PolyX(); ~PolyX(); - static void trimPolyG(Read* r1, Read* r2, FilterResult* fr, int compareReq); - static void trimPolyG(Read* r1, FilterResult* fr, int compareReq); - static void trimPolyX(Read* r1, Read* r2, FilterResult* fr, int compareReq); - static void trimPolyX(Read* r1, FilterResult* fr, int compareReq); + static void trimPolyG(Read* r1, Read* r2, FilterResult* fr, int compareReq, int allowOneMismatchForEach, int maxMismatch); + static void trimPolyG(Read* r1, FilterResult* fr, int compareReq, int allowOneMismatchForEach, int maxMismatch); + static void trimPolyX(Read* r1, Read* r2, FilterResult* fr, int compareReq, int allowOneMismatchForEach, int maxMismatch); + static void trimPolyX(Read* r1, FilterResult* fr, int compareReq, int allowOneMismatchForEach, int maxMismatch); static bool test(); }; -#endif \ No newline at end of file +#endif diff --git a/src/seprocessor.cpp b/src/seprocessor.cpp index a9c968f..cfca749 100644 --- a/src/seprocessor.cpp +++ b/src/seprocessor.cpp @@ -212,6 +212,7 @@ bool SingleEndProcessor::processSingleEnd(ReadPack* pack, ThreadConfig* config){ continue; } + // fix MGI if(mOptions->fixMGI) { or1->fixMGI(); @@ -227,7 +228,7 @@ bool SingleEndProcessor::processSingleEnd(ReadPack* pack, ThreadConfig* config){ if(r1 != NULL) { if(mOptions->polyGTrim.enabled) - PolyX::trimPolyG(r1, config->getFilterResult(), mOptions->polyGTrim.minLen); + PolyX::trimPolyG(r1, config->getFilterResult(), mOptions->polyGTrim.minLen, mOptions->polyGTrim.allowOneMismatchForEach, mOptions->polyGTrim.maxMismatch); } if(r1 != NULL && mOptions->adapter.enabled){ @@ -242,9 +243,10 @@ bool SingleEndProcessor::processSingleEnd(ReadPack* pack, ThreadConfig* config){ if(r1 != NULL) { if(mOptions->polyXTrim.enabled) - PolyX::trimPolyX(r1, config->getFilterResult(), mOptions->polyXTrim.minLen); + PolyX::trimPolyX(r1, config->getFilterResult(), mOptions->polyXTrim.minLen, mOptions->polyXTrim.allowOneMismatchForEach, mOptions->polyXTrim.maxMismatch); } + if(r1 != NULL) { if( mOptions->trim.maxLen1 > 0 && mOptions->trim.maxLen1 < r1->length()) r1->resize(mOptions->trim.maxLen1);