Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

question: insert <tab> char with --rename? #669

Closed
eboyden opened this issue Jan 14, 2023 · 3 comments
Closed

question: insert <tab> char with --rename? #669

eboyden opened this issue Jan 14, 2023 · 3 comments

Comments

@eboyden
Copy link

eboyden commented Jan 14, 2023

Hi - is there a means to use --rename to insert a tab character? I tried \t and "\t", to no avail. This would be useful, for example, when extracting multiple pieces of information with Cutadapt and putting them all into separate SAM tags in the fastq comment, then using a compatible aligner to move the entire comment into the bam file. (The space after the read ID is fine, but every subsequent separator needs to be a tab.) If there's a convenient way to do this inside of Cutadapt then please let me know, if not it would be great to add this feature (e.g. {tab}). Thanks!

@y9c
Copy link
Contributor

y9c commented Mar 6, 2023

You can insert tab into the command line, rather \t, and the output will contain tab.

In linux shell, use Ctrl+V TAB to insert a tab.

@marcelm marcelm closed this as completed in 26e4eeb Mar 7, 2023
@marcelm
Copy link
Owner

marcelm commented Mar 7, 2023

Sorry for not responding earlier, this issue got lost among other notifications. @y9c is correct, but I agree it would be nicer with direct support for this in Cutadapt. I have therefore just added support for writing \t within the --rename template string. That should also be more readable in scripts than having a literal tab character in the file. Thank you for the suggestion!

This will be in Cutadapt 4.3.

marcelm added a commit that referenced this issue Mar 7, 2023
marcelm added a commit that referenced this issue Mar 7, 2023
@eboyden
Copy link
Author

eboyden commented Mar 7, 2023

Excellent, thanks! And yeah I know you can insert a literal TAB on the command line with Ctrl+V, and that does indeed work, but I agree that more explicit support is cleaner. TABs aren't always interpreted properly by text parsers, and if someone copy-pasted code and wasn't careful about it, it could become a string of spaces that would break things.

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

No branches or pull requests

3 participants