Hi,
I'm trying to rename all the sequences, my purpose is to add the taxonomy to each accession number in query.
The original ones look like this:
>YP_003612801.1
MTDYLLLFVGTVLVNNFVLVKFLGLCPFMGVSKKLETAMGMGLATTFVMTMASICAWLIDTWILIPLGLV
YLRTLAFILVIAVVVQFTEMVVRKTSPALYRLLGIFLPLITTNCAVLGVALLNINLGHNFMQSALYGFSA
AVGFSLVMVLFASIRERLAAADIPAPFRGNAIALVTAGLMSLAFMGFSGLVKL
After I run my script it looks like this
>YP_003612801.1
_Firmicutes_Clostridia_Clostridiales
MTDYLLLFVGTVLVNNFVLVKFLGLCPFMGVSKKLETAMGMGLATTFVMTMASICAWLIDTWILIPLGLV
YLRTLAFILVIAVVVQFTEMVVRKTSPALYRLLGIFLPLITTNCAVLGVALLNINLGHNFMQSALYGFSA
AVGFSLVMVLFASIRERLAAADIPAPFRGNAIALVTAGLMSLAFMGFSGLVKL
I don't know why there are the empty lines among different lines and I want the taxonomy be appended to the same line to the accession number instead of the new line , so this is what i want:
>YP_003612801.1_Firmicutes_Clostridia_Clostridiales
MTDYLLLFVGTVLVNNFVLVKFLGLCPFMGVSKKLETAMGMGLATTFVMTMASICAWLIDTWILIPLGLV
YLRTLAFILVIAVVVQFTEMVVRKTSPALYRLLGIFLPLITTNCAVLGVALLNINLGHNFMQSALYGFSA
AVGFSLVMVLFASIRERLAAADIPAPFRGNAIALVTAGLMSLAFMGFSGLVKL
If I want to run in python does anyone know it?
Your script is doing something wonky, and without looking at your script, we can't help you. Also, please use the formatting bar (especially the
code
option) to present your post better. I've done it for you this time.Thanks , I just formatted it!