question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can I specify a required anchored R1 5' adapter with optional R1+R2 3' adapters without changing the pair filter setting?

See original GitHub issue

I’m using cutadapt 3.5 with Python 3.9.7, installed via conda.

I have paired-end data where there are 3’ adapters on both R1 and R2 that may or may not be found, and an anchored 5’ adapter on R1 that should always be there. I’d like to trim all of these and filter read pairs that don’t have that anchored adapter, but otherwise keep them (regardless of the trimming status of either of the other adapters).

Is there a way to get this behavior without using --pair-filter first? I ask because I apply other filters (quality cutoff and minimum length) that should apply with the default (--pair-filter any) behavior.

I also asked this in full pedantic detail here:

https://bioinformatics.stackexchange.com/questions/17893

example I used there:

  • required R1 5’ adapter: AAAAAAAA
  • R1 3’ adapter: TTTTTTTT
  • R2 3’ adapter: GGGGGGGG

input R1:

@read1 should be kept
AAAAAAAACGTCCTGGGATTTGTAATAATATTTTAGTTCTGAGCGACAAGTAAGGGATAATTTTTTTT
+
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
@read2 should be filtered
TACCAACTACATTTAGCTTCAGGCTAGTGATGCCCGCCGTCGGCACACTGGACACATGGCTTTTTTTT
+
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
@read3 should be kept
AAAAAAAACAATTTTTACTCTAGAAATGTCTGTGCTCATCACCCCGACACCGAATAGCTATGACTCAC
+
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF

input R2:

@read1
AGGCTCACCGCCACTGTTGTACCTTCCTATCGCCACTCTAAGATCTATGTAACCTCTCCCGGGGGGGG
+
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
@read2
TGAATAATACTGCGGTTTAATCGATATATTCGGGATTATGCAAGACACCCTACGTACTTAGGGGGGGG
+
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
@read3
TACTGGAGGGTACAAGCCCGGACTATCCACGGCGTCAGCTGGCTTAGCATTGAAGGTCGGCGGTGTGT
+
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF

intended output R1:

@read1 should be kept
CGTCCTGGGATTTGTAATAATATTTTAGTTCTGAGCGACAAGTAAGGGATAA
+
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
@read3 should be kept
CAATTTTTACTCTAGAAATGTCTGTGCTCATCACCCCGACACCGAATAGCTATGACTCAC
+
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF

intended output R2:

@read1
AGGCTCACCGCCACTGTTGTACCTTCCTATCGCCACTCTAAGATCTATGTAACCTCTCCC
+
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
@read3
TACTGGAGGGTACAAGCCCGGACTATCCACGGCGTCAGCTGGCTTAGCATTGAAGGTCGGCGGTGTGT
+
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
marcelmcommented, Oct 21, 2021

I have thought about this now for a bit and cannot come up with a good command-line syntax, so probably my recommendation will remain to run multiple Cutadapt processes in a pipe. I’ll close it now and wait for at least one other person to request that feature, and then I’ll think about this again.

1reaction
ressycommented, Oct 21, 2021

That’s totally clear now, thanks! Feel free to close this issue unless you want a reminder on your end.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Trimming in paired-end sequencing #597 - marcelm/cutadapt
I would like to know in paired-end sequencing I have R1 e.g. ... The option is ignored for anchored adapters since these do...
Read more >
When using cutadapt, can I specify an R2 adapter as optional ...
I found I can get the filtering I want with --pair-filter first , but then the other filtering criteria like quality and length...
Read more >
User guide — Cutadapt 4.2 documentation - Read the Docs
The 3' adapter in the last read is not trimmed because the anchored 5' adapter is required, but missing in the read. Linked...
Read more >
What sequences do I use for adapter trimming?
However, some third-party tools require the adapter sequence for trimming be specified separately. The recommended sequences to use for each Illumina kit ...
Read more >
Quality Control and Trimming of NGS sequences
Adapter1 is an anchored 5' adapter while the adapter2 can be either anchored or not. If you want to make sure that both...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found