I have a sequence :
Code:
PH01000000G0240 P.he_genemodel_v1.0 CDS 120721 121773 . - . ID=PH01000000G0240.CDS;Parent=PH01000000G0240
PH01000001G0190 P.he_genemodel_v1.0 mRA 136867 137309 . - . ID=PH01000001G0190.mRNA;Parent=PH01000001G0190
.............................................
PH01278028G0010 P.he_genemodel_v1.0 CDS 27 501.. . - . ID=PH01278028G0010;Description="oereed"
PH01278104G0010 P.he_genemodel_v1.0 CDS 34 171 . - . ID=PH01278104G0010.CDS;Parent=PH01278104G0010
I want to replace PH0100000 by string but only in the first tab like
PH01000000 to string0
PH01000001 to string1
....
PH01278104 to string278104
PH01278028 to string278028
I want it to look like
Code:
string0G0240 P.he_genemodel_v1.0 CDS 120721 121773 . - . ID=PH01000000G0240.CDS;Parent=PH01000000G0240
string1G0190 P.he_genemodel_v1.0 mRA 136867 137309 . - . ID=PH01000001G0190.mRNA;Parent=PH01000001G0190
.............................................
string278028G0010 P.he_genemodel_v1.0 CDS 27 501.. . - . ID=PH01278028G0010;Description="oereed"
string278104G0010 P.he_genemodel_v1.0 CDS 34 171 . - . ID=PH01278104G0010.CDS;Parent=PH01278104G0010
I used sed command but it didnt work.
sed 's/^PH01\t/string\t/' infile > sortedfile
and then
sed 's/string0*/string/g' infile>sorted file
so tht it removes the extra 00 formed
so that any replacement of this form
PH01000000 to string00000
gets converted to this form
PH01000000 to string0
But none of my commands worked
Could some1 please help