After annotating the genome, you probably want to assign new identifiers to some novel genes, and sometimes thousands of theme, like this:
|
|
I have come up to several ways to archive this:
Excel autofill function
This is probably the most common and easy way, even for people without any scripting experience. Using the ‘magic drag’ is easy for hundreds of identifiers, but will take some time create and copy thousands.
Vim Ctrl-A + recording function
- Step 1: enter “Smp_30001” in the first line
- Step 2: “Esc” back to the normal view; “qa” to start recording to a key
- Step 3: “Y” to copy the whole line, and “p” to paste to the next line
- Step 4: Ctrl-A to increase the number, now becomes “Smp_30002”;
- Step 5: “q” to finish recording
- Step 6: using or “3360@a” to repeat the “a” record and generate numbers of identifiers
- Step 7: “:%s/$/0/g” to add “0” at each line end
Shell seq command
This is the easiest way using one command:
|
|