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.

Enhancement request: trim but keep adaptor, --action=trimupto

See original GitHub issue

I have a usecase in mind were rather than adapter or primer sequence which I want to match and remove, I have markers for a region of interest, and I want the (possibly inexactly matched) marker to be retained in the output.

Currently there are four action modes (correct as of cutadapt v2.8):

$ cutadapt -h | grep "\-\-action" -A 4
  --action {trim,mask,lowercase,none}
                        What to do with found adapters. mask: replace with 'N'
                        characters; lowercase: convert to lowercase; none:
                        leave unchanged (useful with --discard-untrimmed).
                        Default: trim

Would you consider a new action mode, suggested name trimupto (trim up to) or trimuntil, as follows:

  --action {trim,mask,lowercase,trimupto,none}
                        What to do with found adapters. mask: replace with 'N'
                        characters; lowercase: convert to lowercase; trimupto:
                        trim up to but retaining the adapter; none: leave
                        unchanged (useful with --discard-untrimmed).
                        Default: trim

Left adapter example:

$ for ACTION in trim mask lowercase none; do echo; echo "Using --action $ACTION:"; cutadapt -g AAAAAA -o - example.fasta --quiet --discard-untrimmed --action $ACTION; done

Using --action trim:
>example
XXXXXXXXXXXGGGGGGRRRRRRR

Using --action mask:
>example
NNNNNNNNNNNNNNXXXXXXXXXXXGGGGGGRRRRRRR

Using --action lowercase:
>example
llllllllaaaaaaXXXXXXXXXXXGGGGGGRRRRRRR

Using --action none:
>example
LLLLLLLLAAAAAAXXXXXXXXXXXGGGGGGRRRRRRR

Proposed output:

Using --action trimupto:
>example
AAAAAAXXXXXXXXXXXGGGGGGRRRRRRR

Using left and right adapter:

$ for ACTION in trim mask lowercase none; do echo; echo "Using --action $ACTION:"; cutadapt -g AAAAAA...GGGGGG -o - example.fasta --quiet --discard-untrimmed --action $ACTION; done

Using --action trim:
>example
XXXXXXXXXXX

Using --action mask:
>example
NNNNNNNNNNNNNNXXXXXXXXXXXNNNNNNNNNNNNN

Using --action lowercase:
>example
llllllllaaaaaaXXXXXXXXXXXggggggrrrrrrr

Using --action none:
>example
LLLLLLLLAAAAAAXXXXXXXXXXXGGGGGGRRRRRRR

Proposed output:

Using --action trimupto:
>example
AAAAAAXXXXXXXXXXXGGGGGG

Right adapter example:

$ for ACTION in trim mask lowercase none; do echo; echo "Using --action $ACTION:"; cutadapt -a GGGGGG -o - example.fasta --quiet --discard-untrimmed --action $ACTION; done

Using --action trim:
>example
LLLLLLLLAAAAAAXXXXXXXXXXX

Using --action mask:
>example
LLLLLLLLAAAAAAXXXXXXXXXXXNNNNNNNNNNNNN

Using --action lowercase:
>example
LLLLLLLLAAAAAAXXXXXXXXXXXggggggrrrrrrr

Using --action none:
>example
LLLLLLLLAAAAAAXXXXXXXXXXXGGGGGGRRRRRRR

Proposed output:

Using --action trimupto:
>example
LLLLLLLLAAAAAAXXXXXXXXXXXGGGGGG

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
marilouboddecommented, Dec 3, 2020

Thanks a lot! It looks like this should do exactly what I was hoping for; I will try it out tomorrow!

On 2020-12-03 13:45, Marcel Martin wrote:

I wanted to comment here, but the auto-close happened before I got around to it …

Yes, this is now implemented as --action=retain. I hope the behavior is as you both requested. I had suggested earlier that a special marker in the adapter specification would be a good way to do this, but I realized that implementing this as a different action actually is a lot easier, and not adding extra notation makes it easier for the users.

Documentation is at https://cutadapt.readthedocs.io/en/latest/guide.html#action .

@peterjc [1] The retain actually comes from you because you wrote

I want the […] marker to be retained in the output (emphasis mine). It’s a word I rarely use otherwise, so that makes it easy to search for in the documentation. I’ll release Cutadapt 3.1 with this feature included soon.

– You are receiving this because you commented. Reply to this email directly, view it on GitHub [2], or unsubscribe [3].

Links:

[1] https://github.com/peterjc [2] https://github.com/marcelm/cutadapt/issues/443#issuecomment-738003167 [3] https://github.com/notifications/unsubscribe-auth/ANC4QXDSKDOB3XZBFQP3VT3SS6JBFANCNFSM4K5PIVBQ

1reaction
peterjccommented, Dec 3, 2020

Lovely - I’m on leave right now, but hopefully I’ll get to try this out next month. Reading the documentation you’ve added, it should do what I was hoping for.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is Hi's Enhancement Request functionality available OOTB?
It seems that Hi's Enhancement Requests are FTASKs, but I can't seem to find them. Might they be available in a plugin by...
Read more >
How to Monitor Enhancement Requests via My Oracle Support
The note answers commonly asked questions around Enhancements Requests (ERs):. - How do I monitor ER in My Oracle Support?
Read more >
SCEIS Enhancement Requests
The Enhancement Request form is the first step in submitting a request for enhancements and modifications to the SCEIS System. Once the form...
Read more >
OneStream Excel Enhancement Requests
Hello, Our Organization is currently going through a Planning implementation of OneStream. We have provided a list of enhancement requests to.
Read more >
How do I find, view and support Enhancement Requests?
I keep seeing references to "Enhancement Requests", invitations to support them and going to "GTAC". (I don't know what GTAC is.) ...
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