lh3 / seqtk

Toolkit for processing sequences in FASTA/Q formats
MIT License
1.37k stars 308 forks source link

position index in rename #84

Open dridk opened 7 years ago

dridk commented 7 years ago

rename option is really usefull. it would be greate to have an index variable to put anywhere in the string name. For exemple :

  seqtk rename <file.fasta> "sample_{INDEX} ; foo=32" 

it will rename the header as following :

> sample_1;foo=32 
ACGTATAT
> sample_2;foo=32
TACGAA
tseemann commented 6 years ago

This would be good.

Ideally you could use a C-style printf argument like sample_%05d;foo=32

It's a reasonable simple pull request if I had more time: https://github.com/lh3/seqtk/blob/master/seqtk.c#L190-L192