I am looking to edit the header of a fast file using python. I am converting the DNA sequence to an amino acid sequence and I need to add "-aa" where the first space in the header is located.
The header looks like this:
>ANIS1000.x1 ET TIME...
It needs to look like this:
>ANIS1000.x1-aa ET TIME...
I can locate the index of the space using this:
locate = dnaHeader.find(' ')
But then I cannot insert the '-aa' using the insert function:
dnaHeader = dnaHeader.insert(locate, ' ')
The error says 'str' object does not support item assignment.
Thanks!
Brian
The header looks like this:
>ANIS1000.x1 ET TIME...
It needs to look like this:
>ANIS1000.x1-aa ET TIME...
I can locate the index of the space using this:
locate = dnaHeader.find(' ')
But then I cannot insert the '-aa' using the insert function:
dnaHeader = dnaHeader.insert(locate, ' ')
The error says 'str' object does not support item assignment.
Thanks!
Brian
Comment