I have a FASTA header that looks like this:
>7c8250ef-c89f-4d42-9d48-12c8fe245fb2 runid=606f271fc97598006ba5a922136a2c304cef75a5 sampleid=Pool12-1 read=19008 ch=301 start_time=2021-07-03T08:48:18Z barcode=barcode01
And I am able to change it to the desired output here:
>7c8250ef-c89f-4d42-9d48-12c8fe245fb2_001
Using this command:
grep '^>' 001_old.fasta | cut -d ' ' -f 1,8 | sed '/^>/s/$/_001/' > 001_new.fasta
However it completely deletes the DNA sequence for that read and only outputs the names of the headers to the new fasta file:
>7c8250ef-c89f-4d42-9d48-12c8fe245fb2_001
>815440d5-e033-446c-b7dd-5fad4105184a_001
>d36a0fea-101d-4bd9-bee4-adec7fe4d43c_001
>38ca9eb8-bbd2-4d0a-ab06-79d134ad46f1_001
...
I think it has something to do with the cut
command I'm using. I tried just doing 1 but that gave the same output so I figured if I included the 8th position of text after a space it would work but again no dice. If someone could help me to include the DNA sequence under the FASTA header in this new file that would be great.