BLAT error sequnces
1
0
Entering edit mode
6.0 years ago
midox ▴ 270

Hello,
I use a BLAT alignment with two files.
But here is the error "Error: sequence name channel_231_read_27_template is repeated in the database, all nemes must be unique"

how to change the sequence header of a Fasta file?

or have you another idea.
Thanks

alignment Blat test • 1.2k views
0
Entering edit mode
6.0 years ago
GenoMax 107k

If there is only one offending header, edit it directly using an editor of choice otherwise use sed. If the sequences are repeated then take out one of the copies.

0
Entering edit mode

Is there a possibility of changing the header of sequences ?

0
Entering edit mode

Something like

$sed 's/channel_231_read_27_template/channel_231_read_27_template_2/' your_file > new_file  To replace only first instance $ sed '0,/channel_231_read_27_template/s/channel_231_read_27_template/channel_231_read_27_template_3/' your_file > new_file

0
Entering edit mode

I have three copies.

actually, they are not copies but just the same they header.

How I can change the headers?

$sed 's/channel_231_read_27_template/channel_231_read_27_template_2/' your_file > new_file  it changes the three headers by "channel_231_read_27_template_2" another solution? thanks ADD REPLY 0 Entering edit mode $ awk 'NR==1,/channel_231_read_27_template/{sub(/channel_231_read_27_template/, "channel_231_read_27_template_2")} 1' your_file

0
Entering edit mode

there is a lot of repetition.

I want to change the headers of all sequences.

do I change the headers in command line?

Thank you

0
Entering edit mode

I am not sure why your fasta headers are repeated in the file.

If the sequences are different then the headers should have been different to begin with. If the sequences are identical then you should be using a non-redundant copy with only one representative of each sequence in your files.

If you still want to proceed you will have to think of a programmatic way to get the headers and then iterate through them to change ones you want.