How to turn a column into a character string (to execute filterbyname.sh of the BBTools suite)
1
0
Entering edit mode
9 months ago
ella • 0

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 • 904 views
ADD COMMENT
0
Entering edit mode

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?

ADD REPLY
1
Entering edit mode

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

ADD REPLY
0
Entering edit mode

Ella, why did you delete this post?

ADD REPLY
0
Entering edit mode

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..

ADD REPLY
0
Entering edit mode

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

ADD REPLY
1
Entering edit mode
9 months ago
Ram 44k

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.

ADD COMMENT

Login before adding your answer.

Traffic: 2516 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6