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
ADD COMMENT
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.

ADD COMMENT
0
Entering edit mode

Is there a possibility of changing the header of sequences ?

ADD REPLY
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
ADD REPLY
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
$ awk 'NR==2,/channel_231_read_27_template/{sub(/channel_231_read_27_template/, "channel_231_read_27_template_3")} 1' your_file
ADD REPLY
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

ADD REPLY
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.

ADD REPLY

Login before adding your answer.

Traffic: 2702 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6