update fasta header and gff3 file
0
0
Entering edit mode
3.0 years ago

hi, I need to change the header of several files and update the gff3 files

I need to add a string at the end of all headers something like :

sed 's />.*/&_ string /' file.fasta> outfile.fasta

the names of the scaffolds are in the first column, so I tried to update the gffs with:

awk '{$ 1 = $ 1 "_string"} 1' file.gff3> outfile.gff3

but the final file is unformatted, loses \ t for all columns, that is, the final result is just a single column I tried :

awk '{$ 1 = $ 1 "_string \ t"} 1' file.gff3> outfile.gff3

but resolves only to separate the first and second columns, as expected

Any suggestion? obs: I know I need to do these commands only for lines that don't start #, I will probably use python for this.

fasta gff awk header python • 664 views
ADD COMMENT
0
Entering edit mode

Have you tried using '{OFS="\t"}' option in awk ??

ADD REPLY

Login before adding your answer.

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