This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to turn a column into a character string (to execute filterbyname.sh of the BBTools suite)

Hi all,

I'm not a super routine bash user and didn't find a solution for my problem via Google.

I want to extract FASTAs from a multi FASTA using filterbyname.sh of the BBTools suite. I found in the manual, that the names=file.txt input file should contain a character string.

I have a column of gene IDs. Alternatively, I already enclosed the IDs with double quotes. I´m trying to convert that column into a string. I tried the following commands and some variants, but it doesn't work.. :(

sed 's/\n/,/g' ensgene-of-interest.txt > ensgene-of-interest2.txt

cat ensgene-of-interest.txt | tr "\n" "\",\"" > ensgene-of-interest2.txt
cat ensgene-of-interest.txt | tr "\n" "\"" "," "\"" > ensgene-of-interest2.txt

Thanks a lot for your help :)

bbtools filterbyname.sh bash

Hi Pierre, I´m really sorry if I oversaw something. I double-checked the links you sent and I found that I either upvoted or answered to the comments. Is there an additional action I have to take?

validate the correct answers by clicking the green mark on the left .

Ella, why did you delete this post?

Because I triple-checked old posts of mine after Pierres comment, found that my problem was caused by re-doing an old mistake (not reducing very complex FASTA headers when mapping), felt stupid, and then deleted the post. :'D Sorry, very stressful thesis wrap-up times..

No worries. Please go ahead and delete this post again.

1 answer

If your ensgene-of-interest.txt file has one entry per line, you're already set. Make sure there's proper overlap between the FASTA and the names - and choose a value for substring= mindfully.

Log in to answer this question.