I have a fasta file with multiple headers:
`>contig00001_len=155988_cov=17.1_corr=0_origname=NODE_1_length_155988_cov_17.103139_sw=shovill-spades/1.1.0_date=20240120
AATTCTAACAGGTCAGATATTTCTACAATAGCATCGCGAATACCACCAATATA
contig00001_len=155988_cov=17.1_corr=0_origname=NODE_1_length_155988_cov_17.103139_sw=shovill-spades/1.1.0_date=20240120
TTTCCCCATTGTTTCGACTAACTCTTGATCGATCGTTACAGCTTTGATTTCTT`
I want to replace the headers to
E.coli_32A_chromosome_contig_1
E.coli_32A_chromosome_contig_2
and so on
I tried this command
sed 's/^>contig[0-9]*_([^_]*)_([^_]*)_([^_]*)_([^_]*)_([^_]*)_([^_]*)_([^_]*)/>E.coli_32A_chromosome_contig_1_2_3_4_5_6_7/' fasta_file_32A.fasta > modified_fasta.fasta
but it does not work properly with me
any suggestion will be appreciated
thank you
user26311901 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.