My fastas look like:
>123456789.1
AGCT
>123456789.2
AGCT
>222221122.1
AGCT
The fasta does not have end of line characters so the sequence is all on one line. The fasta headers have a .1 .2 .3 and so on up to .8 at the end of them.
cat ids.txt
123456789 123456789.25/12/2019
222221122 222221122.03/03/2020
Desired Fasta:
>123456789.25/12/2019.1
AGCT
>123456789.25/12/2019.2
AGCT
>222221122 222221122.03/03/2020.1
So I'm trying to replace the text in the first column with the text in the second column (in this case adding dates into the headers), but preserving the .1 and .2 at the end of the headers.
Command:
./seqkit replace --pattern ' ^>(\w+).\d' --replacement ' {kv}' --kv-file ids.txt test.fasta --keep-key > test.out
test.out however prints the fasta but with the original headers, no error message, any ideas?
I'm working on Windows have used dos2unix
on all files
Input:
output: