Entering edit mode
9.3 years ago
nicolas.dussex
▴
30
Hi,
I would like to replace the first filed my headers in my fasta file and concatenate it to the 2nd field (my gene ID), such a, I start with this:
> maker-scaffold_0-snap-gene-0.23-mRNA-1 gene=maker-scaffold_0-snap-gene-0.23
ATGGTGAAGCTCGTGGCGTTCTCGCCGTTCCGCTCGGCGCAGAGCGCGCTGGAGAACATGAACGCCGTGT
CCGAGGGGGTCCTGCACGAGGACCTGCGGCTGCTGCTGGACACGGCGCTGCCCCCCAAGAGGAA....
and get this:
>Species1_gene=maker-scaffold_0-snap-gene-0.23
ATGGTGAAGCTCGTGGCGTTCTCGCCGTTCCGCTCGGCGCAGAGCGCGCTGGAGAACATGAACGCCGTGT
CCGAGGGGGTCCTGCACGAGGACCTGCGGCTGCTGCTGGACACGGCGCTGCCCCCCAAGAGGAA....
I tried this:
awk ' { $2="Species1_" $2; print }
but it adds Species 1 at the end of each line including the sequence. I assume I shouldn't be too complicated but don't seem to find the solution.
Thanks a lot!