Entering edit mode
5.5 years ago
AP
▴
80
Hello everyone,
I have a fasta file like this in multiple lines
>jgi|Necha2|9923|gw1.3.792.1
CGTGGCCAGGCTCTTTATATTCGCTCACTCTTCGAGGCCAACCGCAATGTGACTGATCCGAGACACCAAA
GAGCTCTGTTGACGGAGACAGAGAAGCTACTGGAGAGCTGGAAGCACCCCGATCCCTACACGCCCCCGAC
TGCTCCCGGAGGCTCAAAGTTCGAGCGAAACCTGCCATCGCCTATCCTCGACCGTGAGCCG
>jgi|Necha2|59698|estExt_Genewise1.C_sca_3_chr4_2_00004
CAATTGTCATCACCACGACGCTCTCCGACTCATCCATTCGTCGCAAAGTCTCACCAGACTCACTCACTTC
TTTTTTCACCCAAACCACCCCAACCAACCCACTTTCAAAATGACTGGCGGCGGCAAGTCTGGCGGCAAGG
CCTCTGGTTCCAAGAACGCGCAATCGCGTTCTTCCAAGGCTGGTCTCGCGTTCCCTGTTGGTCGTGTCCA
CCGTCTTCTCCGAAAGGGCAACTACGCTCAGCGTGTCGGTGCCGGTGCCCCTGTGTACCTCGCTGCCGTC
CTTGAGTATCTTGCTGCCGAAATCCTCGAGTTGGCTGGCAACGCTGCCCGTGACAACAAGAAGACCCGTA
How can I change this into format like this with fasta sequence in just one line
>jgi|Necha2|9923|gw1.3.792.1
CGTGGCCAGGCTCTTTATATTCGCTCACTCTTCGAGGCCAACCGCAATGTGACTGATCCGAGACACCAAAGAGCTCTGTTGACGGAGACAGAGAAGCTACTGGAGAGCTGGAAGCACCCCGATCCCTACACGCCCCCGAC
>jgi|Necha2|59698|estExt_Genewise1.C_sca_3_chr4_2_00004
CAATTGTCATCACCACGACGCTCTCCGACTCATCCATTCGTCGCAAAGTCTCACCAGACTCACTCACTTCTTTTTTCACCCAAACCACCCCAACCAACCCACTTTCAAAATGACTGGCGGCGGCAAGTCTGGCGGCAAGGCCTCTGGTTCCAAGAACGCGCAATCGCGTTCTTCCAAGGCTGGTCTCGCGTTCCCTGTTGGTCGTGTCCACCGTCTTCTCCGAAAGGGCAACTACGCTCAGCGTGTCGGTGCCGGTGCCCCTGTGTACCTCGCTGCCGTCCTTGAGTATCTTGCTGCCGAAATCCTCGAGTTGGCTGGCAACGCTGCCCGTGACAACAAGAAGACCCGTA
Thank you, Ambika
What have you tried?
I tried this awk command
It gives me the fasta file with single line
but I think what I need is one line with the name, gene and scaffold details and next line with the sequence.
Try changing from
\t
to\n
:Or seqkit with global flags:
For example:
I think I figure it out with the sed command. I just replaced the space that I had with that output.fa file with a line using this code.
That's great! What you needed in your earlier
awk
was to either use>
as the record separator and manipulate the file or substitute\n
with''
(replace with nothing, essentially removing the new line) on all lines not starting with a>