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

The '>' symbol in the FASTA file is being interpreted as a redirect command. #51

Open
famiji opened this issue Oct 16, 2023 · 3 comments

Comments

@famiji
Copy link

famiji commented Oct 16, 2023

Hello, I am new to bioinformatics and recently discovered that Rush offers support for custom-defined variables and advanced embedded replacement strings. I have realized the convenience of using single-line commands to process sequences in a shell environment. However, while learning through examples, I encountered an issue when trying to execute the following command:
echo -ne ">seq1\nactg\n>seq2\nAAAA\n>seq3\nCCCC"|rush
It get the right result,but when i try:
echo -ne ">seq1\nactg\n>seq2\nAAAA\n>seq3\nCCCC"|rush echo {}
image
As shown in the picture, this command only prints out the sequence lines, but the description line is not output, instead generating an empty file with the description line as the file name.
So I tried the following command again and the result was the same:
image
It appears that the issue I encountered is related to the interpretation of the redirect command (>) by the echo command. Logically, enclosing the redirect command in quotation marks should prevent this problem. Additionally, I tried using the parallel command and obtained the correct result.
image
Is the situation described above a result of my incorrect usage of Rush?
image

@shenwei356
Copy link
Owner

shenwei356 commented Oct 16, 2023

Oh, I never noticed that. In rush, the {} is replaced with the input as it is. So you need to wrap the input with quotes.

$ echo -ne ">s\nactg\n" | rush  'echo "{}"'
>s
actg

parallel seems to detect the symbol > and add quotes for the input.

@famiji
Copy link
Author

famiji commented Oct 16, 2023

So I need to be careful when using rushto handle the content of FASTA file

@shenwei356
Copy link
Owner

I don't recommend directly processing fasta content with rush, please use tools like seqkit.

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

2 participants