Skip to content

Conversation

Copy link

Copilot AI commented Oct 11, 2025

Summary

This PR documents that the issue described in #132 regarding polyA trimming order has already been resolved. No code changes were needed.

Background

The original issue reported that poly-A tails were remaining in 3' RNA-seq reads with polyT priming. This occurred because polyX trimming was happening before adapter trimming, meaning:

  1. PolyX trimming would run first, but couldn't detect poly-A tails hidden behind adapters
  2. Adapter trimming would then remove adapters, exposing the poly-A tails
  3. The poly-A tails would remain in the final output

Resolution

The fix was already implemented in commit c2872e7 (February 14, 2019), which reordered the processing steps. The current processing order in both seprocessor.cpp and peprocessor.cpp is:

  1. Quality trimming and global trimming
  2. polyG trimming (step 7)
  3. Adapter trimming by overlap analysis (step 8)
  4. Adapter trimming by sequence (step 9)
  5. polyX trimming (step 10) ← Now correctly positioned after adapter trimming
  6. Max length trimming (step 11)

This ensures that:

  • Adapters are removed first, exposing any hidden poly-A/poly-T sequences
  • PolyX trimming then removes these exposed poly-A/poly-T tails from the 3' end
  • Users get clean reads for 3' RNA-seq with polyT priming

Verification

  • ✅ All existing unit tests pass
  • ✅ Code review confirms polyX trimming occurs after adapter trimming in both SE and PE modes
  • ✅ README.md documents the correct processing order

The implementation correctly addresses the issue - no further changes needed.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • esm.ubuntu.com
    • Triggering command: /usr/lib/apt/methods/https (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>shouldn't poly A trimming happen after adaptor trimming?</issue_title>
<issue_description>I'm working with 3' RNA-seq with polyT priming. in the resulting reads I still get poly A tails. I think this is happening because the adaptor is trimmed after the polyA trimming. shouldn't it happen in the other order?</issue_description>

<agent_instructions>try to fix this issue, make polyA trimming to get clean reads</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@sfchen What's your command? Did you enable polyX trimming by `--trim_poly_x` @sfchen Currently the order is: ``` 1, UMI preprocessing (--umi) 2, global trimming at front (--trim_front) 3, global trimming at tail (--trim_tail) 4, quality pruning at 5' (--cut_front) 5, quality pruning by sliding window (--cut_right) 6, quality pruning at 3' (--cut_tail) 7, trim polyG (--trim_poly_g, enabled by default for NovaSeq/NextSeq data) 8, trim polyX (--trim_poly_x) 9, trim adapter by overlap analysis (enabled by default for PE data) 10, trim adapter by adapter sequence (--adapter_sequence, --adapter_sequence_r2. For PE data, this step is skipped if last step succeeded) 11, trim to max length (---max_len) ```

As @whhyh1314 pointed out, I may add options to change the orders. But before that you can change the order in the source.</comment_new>
<comment_new>@sfchen
Probably putting polyX trimming after adapter trimming is a better solution.</comment_new>
<comment_new>@sfchen
After consideration, I think polyX trimming after adapter trimming is better.

I submitted a commit to change the order, please try the latest 0.19.7 and update here.</comment_new>
<comment_new>@sfchen
Could you please upload a poly-A data for me to test?</comment_new>
<comment_new>@sfchen
global trimming is used to fix sequencer artifacts, for example --trim_tail=1 to cut the 151 cycle for 150 PE sequencing.</comment_new>

Fixes #132


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI changed the title [WIP] Fix poly A trimming order after adaptor trimming Verify polyX trimming occurs after adapter trimming (already fixed) Oct 11, 2025
Copilot AI requested a review from sfchen October 11, 2025 07:13
Copilot finished work on behalf of sfchen October 11, 2025 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

shouldn't poly A trimming happen after adaptor trimming?

2 participants