Entering edit mode
5.1 years ago
selplat21
▴
20
I have a concatenated fasta file for a series of genbank entries with different headers. I need to edit the fasta headers to all say "BCH" in place of the header up to and including the space after "Archilocus alexandri".
For example, DQ432746.1 Archilochus alexandri voucher B02923 cytochrome oxidase subunit 1 (COI) gene, partial cds; mitochondrial
should be
BCH voucher B02923 cytochrome oxidase subunit 1 (COI) gene, partial cds; mitochondrial
>DQ432746.1 Archilochus alexandri voucher B02923 cytochrome oxidase subunit 1 (COI) gene, partial cds; mitochondrial
GGCTGGAATAGTTGGAACCTCTCTAAGCCTACTAATCCGAGCGGAACTCGGCCAGCCAGGCACCCTCCTA
GGGGACGACCAAATTTATAATGTGATCGTCACTGCCCATGCCTTCGTAATAATCTTCTTCATAGTTATAC
CAATTATAATCGGAGGCTTTGGAAACTGATTAGTTCCCCTCATAATTGGAGCCCCCGACATAGCATTCCC
ACGTATAAATAACATAAGCTTCTGACTCCTACCACCATCGTTCCTCTTACTCCTTGCTTCCTCTACTGTC
GAAGCAGGCGCAGGCACGGGATGAACTGTATACCCCCCTCTGGCCGGCAACTTAGCCCACGCAGGAGCAT
CAGTAGACCTAGCCATCTTCTCCTTGCACCTGTCAGGCATCTCATCAATCCTAGGAGCAATTAACTTCAT
TACCACCGCAATCAATATAAAACCACCCGCCCTATCTCAATACCAAACCCCCCTATTTGTTTGATCCGTC
CTCATTACTGCCGTCCTACTCCTTCTTTCACTCCCAGTACTTGCTGCCGGAATTACCATGCTACTCACAG
ACCGAAACC
>KX011590.1 Archilochus alexandri cytochrome oxidase subunit I (COI) gene, partial cds; mitochondrial
TAAGCCTACTAATCCGAGCAGAACTCGGCCAGCCAGGCACCCTCCTAGGGGACGACCAAATTTATAATGT
GATCGTCACTGCTCATGCCTTCGTAATAATCTTCTTCATAGTTATACCAATTATAATCGGAGGCTTTGGA
AACTGATTAGTCCCCCTCATAATTGGAGCCCCCGACATAGCATTCCCACGTATAAATAACATAAGCTTCT
GACTCCTACCACCATCGTTCCTCTTACTCCTTGCTTCCTCTACTATCGAAGCAGGCGCAGGCACGGGATG
AACTGTATACCCCCCTCTAGCCGGCAACTTAGCCCACGCAGGAGCATCAGTAGACCTAGCCATCTTCTCC
TTACACCTATCAGGCATCTCATCAATCCTAGGAGCAATTAACTTCATTACCACCGCAATCAATATAAAAC
CACCCGCCCTATCTCAATACCAAACCCCCCTATTTGTTTGATCCGTCCTCATTACTGCCGTCCTACTCCT
TCTTTCACTCCCAGTACTTGCTGCCGGAATTACCATGCTACTCACAGACCGAAACCTAAACACCACATTT
TTCGACCCCGCTGGAGGAGGAGACCCCATCCTCTATCAGCACTTATTCTGATTCTT
>KJ602592.1 Archilochus alexandri voucher LSUMZ_B-21848 ornithine decarboxylase gene, exons 6 through 8 and partial cds
GCGTGCAAAAGAACTTGACCTTGCCATTGTTGGAGTTAGGTGAGTTGATATCATCAAAATTAAGATTTCT
TTAAATGGTCTGCCTGACAATAGAGGAGTGTATGGTGACTTGAGTTTTGTACAGACTTCTTGATGAGTCT
GCCAAATAGCAACTGATGTTTTGTATCTTTGTAGTTTCCATGTTGGAAGTGGATGTACTGACCCTGAGAC
CTTTGTTCAAGCCATTTCTGATGCCCGCTGTGTGTTTGATATGGGAGTAAGTAGCTCTGCTCTGCTTTCT
CTGTTTCTGCTGCTCAGCTGATGTGGCAAAACTGACTCTTACATGTTTTAAAGCTAGCTAAGTTACTAAT
TTCATGTTGGAATTGTTGAGTCGTGATGGCTTATCTTGACCTGTTCTGCAAAACTCACTTCTATATGTAG
TTAAAATAATCAGCTCAAACTGAAGTGACTTGAACATGATGAATTAGCTCTGTTCCAATATTAATGAAAT
TACTTTGCATTACTTTTTAAGCAAAAATAATAACATAACTGCTTTCTTGACAGTATTGCTGTTAATCTCT
TCTCAGGCTGAACTTGGCTTCRACATGTGTCTGCTTGATATTG
Any help would be greatly appreciated!
What have you tried? You've learned about regex?
This is great! Thanks so much!