marcelm / cutadapt

Cutadapt removes adapter sequences from sequencing reads
https://cutadapt.readthedocs.io
MIT License
502 stars 125 forks source link

Add --trimmed-poly-a-only for poly-a as --trimmed-only for adapter #740

Open a92932000 opened 7 months ago

a92932000 commented 7 months ago

I want a option for keeping or discarding PE read with poly-A/T in R1/R2 after using "--poly-a" option, but "--trimmed-only" or "--discard-untrimmed" option is only work for adapter trimming

Example of "--trimmed-only" and "--poly-a" as below:

cutadapt --trimmed-only --poly-a --pair-filter=any test_1P.fq test_2P.fq -o test_1P.trim.fq -p test_2P.trim.fq
This is cutadapt 4.5 with Python 3.9.6
Command line parameters: --trimmed-only --poly-a --pair-filter=any test_1P.fq test_2P.fq -o test_1P.trim.fq -p test_2P.trim.fq
Processing paired-end reads on 1 core ...
Done           00:00:00            10 reads @ 949.2 µs/read;   0.06 M reads/minute
Finished in 0.023 s (2337.050 µs/read; 0.03 M reads/minute).

=== Summary ===

Total read pairs processed:                 10

== Read fate breakdown ==
Pairs discarded as untrimmed:               10 (100.0%)
Pairs written (passing filters):             0 (0.0%)

Total basepairs processed:         2,174 bp
  Read 1:         1,351 bp
  Read 2:           823 bp
Poly-A-trimmed:                      242 bp (11.1%)
  Read 1:            54 bp
  Read 2:           188 bp
Total written (filtered):              0 bp (0.0%)
  Read 1:             0 bp
  Read 2:             0 bp

=== R1 poly-A trimmed ===

length  count
0       8
21      1
33      1

=== R2 poly-A trimmed ===

length  count
0       7
20      1
46      1
122     1