extract-reads: add trim-right option
Closed this issue · 2 comments
Addition Description
trim a specified number of nucleotides off of the 3' end of sequences
Current Behavior
trunc-len trims to a fixed length, but does not trim an explicit number of nucleotides. This should be done to mirror what is done to query sequences during denoising (i.e., if trim-left-r is used in q2-dada2 denoise-paired, that same number of nt should be trimmed off of the 3' end of extracted reads to match the same read position + length).
Proposed Behavior
add a trim-right
parameter.
References
forum xref
I'm interested in this.
For my own notes, the stack appears to be
- main function is extract_reads(),
- which calls _gen_reads(),
- which uses array of skbio.DNA to get subsequence.
- Unit tests
I think this is within my range conceptually, but I'm a big noob wrt python style and API design.
Glad to hear you are interested! See how trim-left and trunc-len are used here:
q2-feature-classifier/q2_feature_classifier/_cutter.py
Lines 125 to 128 in b2b4789
Adding trim-right would just be a matter of adding a similar line between those two (so the order should probably be trim-left, trim-right, trunc-len; in practice trunc-len will very often trim over what trim-right cut, but trunc-len is not always used so this is when trim-right might make sense), and of course registering this parameter on up through the stack and adding a simple unit test.