If you get annoyed by the extra space after chr16:80372593-80373755 :
awk -F '|' '/^>/ { print substr($2, 1, length($2)-1) "\thello"}' jeter.fa
• 0 views
•
link
I have a fasta file like below, I like to seprate only coordinate and add one column with "hello" name.
>Human|chr16:80372593-80373755 | element 4 | positive | neural tube[6/10] | hindbrain (rhombencephalon)[10/10] | midbrain (mesencephalon)[10/10]
gtgaCAGAGACAGACAGTGACAGAGACAgattttagaatttgaacaaaggtaaataagag
>Human|chr16:78510608-78511944 | element 12 | positive | hindbrain (rhombencephalon)[9/11] | forebrain[9/11]
AAGCTAGCTAATTGCTTCTTCAGTTGaagacctaaatgagttttaaagtgaaatgcatat
Expect file:
chr16:80372593-80373755 hello
chr16:78510608-78511944 hello
Log in to answer this question.
what do you consider 'name' (== which of the fields in your fasta header?)
I like to add my favorite name.
Will change for each entry or stay the same?
it is the same name.