Entering edit mode
9.0 years ago
mbk0asis
▴
700
Hello
I'm trying to add some texts next to the existing fasta headers.
The fasta file contains 100 mRNA sequences, and additional information are saved in a separate file.
Input 1:
>NM_001133328
ggccattacggccggggctcccgctcgccctgaacctagtacctgcagccatg
Input 2:
NM_001133328 chr2b + 107030810 107070838 ATIC
Output;
>NM_001133328 chr2b + 107030810 107070838 ATIC
ggccattacggccggggctcccgctcgccctgaacctagtacctgcagccatg
I tried using 'awk' and 'while' commands, but couldn't figure it out.
Here's the command:
cat Input2 | while read line; do awk '/^>/ {$0=$0 "'$line'"}1' Input1 ; done | head
and the error message
awk: cmd. line:1: ^ unterminated string
awk: cmd. line:1: /^>/ {$0=$0 " NM_001168566
awk: cmd. line:1: ^ syntax error
Can anyone help me?
Thank you!