Hi there,
I have a fasta file with the format like this:
@t0000001 2137624
TGGAATGTAAAGAAGTATGTAT
@t0000002 926007
TGTGCACGGCACACACCACGTCGACGTT
@t0000003 854045
TGAGGTAGTAGGTTGTATAGTT
@t0000004 544348
TGTGAACGGCAGACACCACGTCAGTGTT
@t0000007 286256
TGTGAACGGCAGACACCACGTCAGTGTTG
@t0000005 261735
TGTGCACGGCACACACCACGTCGACGTTT
@t0000006 174866
TGTGCACGGCACACACCACGTCGACGTTC
@t0000011 135896
GGAACACCGGGTGCAGTAGACAT
now I would like to change the title into
@t0000001_hd_2137624
@t0000002_hd_926007
@t0000003_hd_854045
...
to meet the demands of fasta file format in mirdeep2,
is there any command line or software could do this ? I searched the internet but comes no solutions.
Thank you very much. Sean
Thanks verymuch genomax2, i followed your command but no changes happened to my file (as below), could you please help figure out the problem?
it seems a tab separated headers, just replace single space to regular expression,
sed -e 's/\s/\_hd\_/g' -e 's/^@t/>t/g' your_file > new_file
It works, thank you so much Ptasad, :)
BTW, could you pls tell me why you what the \s represents in the 's/\s/_hd_/g' command?
it is representation for all type of spaces