I have two files one that looks like this:
FILE1
>comp0_c0_seq1 len=392 path=[1:0-391]
ATGAG...
>comp1_c0_seq1 len=399 path=[1:0-398]
AAGGA...
>comp1_c1_seq1 len=589 path=[1319:0-588]
TATAT...
>comp2_c0_seq2 len=340 path=[1:0-339]
GGAGT...
>comp2_c1_seq1 len=312 path=[924:0-311]
GGTTA...
>comp2_c1_seq2 len=312 path=[924:0-311]
TTATT...
>comp4_c0_seq1 len=800 path=[1:0-581 1284:582-799]
AGAGA...
>comp6_c0_seq1 len=245 path=[815:0-151 745:152-244]
GATTA...
And a second file
FILE2
>contig_1
>contig_2
>contig_3
>contig_4
>contig_5
>contig_6
>contig_7
>contig_8
I can't find a pattern in FILE1 so I could easily replace the >comp0_c0_seq1 part with >contig_1 and so on. FILE2 has no sequences, only the headers
I've been trying with sed and awk but I haven't succeed
the output I wish to get is:
>contig_1 len=392 path=[1:0-391]
ATGAG...
>contig_2 len=399 path=[1:0-398]
AAGGA...
>contig_3 len=589 path=[1319:0-588]
TATAT...
>contig_4 len=340 path=[1:0-339]
GGAGT...
>contig_5 len=312 path=[924:0-311]
GGTTA...
>contig_6 len=312 path=[924:0-311]
TTATT...
>contig_7 len=800 path=[1:0-581 1284:582-799]
AGAGA...
>contig_8 len=245 path=[815:0-151 745:152-244]
GATTA...
The files I'm working with are >30,000 contigs long, with very large sequences in between them.
comp[\d]_c[\d]_seq[\d]andcontig_[\d]valid regexes for your problem?