Entering edit mode
2.6 years ago
zhichusun
▴
10
I have a fasta file which contains multiple contigs
>DEHFGCMO_00205
>MDDGIGEH_00111
>FLCICGHF_00226
>FLCICGHF_00253
>DEHFGCMO_01539
>MDDGIGEH_00625
I want to split the contigs based on the first few letters of their names and aggregate them into different fasta files e.g. 1.fasta
>DEHFGCMO_00205
>DEHFGCMO_01539
2.fasta
>MDDGIGEH_00111
>MDDGIGEH_00625
3.fasta
>FLCICGHF_00226
>FLCICGHF_00253
what should I do? Very grateful for your help.
Assuming that sequences are single line and sequence names/ids follow similar pattern: