Changing format using awk command
1
1
Entering edit mode
8.6 years ago
sp ▴ 20

I am trying to convert tab limited "name-seq" format to ">name \n seq\n". I think I can use "awk" function will do the job, but need your help. Thanks for your help!

For example,

From;

CHP2_ABL1_1 ACGACAAGTGGGAGATGGAAC

CHP2_ABL1_2 TAACTAGTCAAGTACTTACCCACTGAAA

TO;

>CHP2_ABL1_1
ACGACAAGTGGGAGATGGAAC

>CHP2_ABL1_2
TAACTAGTCAAGTACTTACCCACTGAAA

sequence • 1.4k views
ADD COMMENT
3
Entering edit mode
8.6 years ago
biocyberman ▴ 870

Yes, oh my gawk

gawk -F'\t' '{print ">"$1"\n"$2}' your.tsv
ADD COMMENT
0
Entering edit mode

Thanks a lot! I need to take some time and learn gawk. It seems really useful tool.

ADD REPLY
0
Entering edit mode

It is really easy and quick tool for transforming table-like data. I use it a lot. But beware, not to be so short to the level of cryptic. You will curse yourself in the future :D Consider mark my answer "accepted" by the way

ADD REPLY
0
Entering edit mode

I will keep that in mind. Your answer "accepted".

ADD REPLY

Login before adding your answer.

Traffic: 2590 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