always love toolkits
Question: How to remove the same sequences in the FASTA files? |
||
10
|
Some FASTA files (e.g., ESTs) have sequences with different IDs that nonetheless have the same sequence. I want to remove duplicate sequences based on the nucleotide sequence, rather than ID.HOW to do?Thankyou to all! |
|
6
|
There are quite a lot of utilities that will do this; usually they are found as part of larger software packages (often aimed at motif discovery). For example, RSA-tools contains the utility purge-sequence, MEME contains purge. So those are some terms for your web search. A roll-your own solution is quite easy if you store the sequences as hash keys (which have to be unique). For example using Bioperl SeqIO you could try something like:
This will write out a new FASTA file, myseqs.fa.uniq, with only unique sequences (but no record of the other IDs with that sequence). |
|
|
| ||
5
|
Depends on you application, but you may also try to filter out entries with the out same sequence but i.e. just 1bp shorter.
This should give you results.fasta purged from identical but equal in size / shorter sequences. |
|
4
|
Encode the sequences in hash using SHA-1 or MD5, and then check for collision. If you are familiar with Python, here is a useful recipe to start. |
|
|
| ||
4
|
According to SeqAnswers: WU-blast, EBI-Exonerate, and bioperl all have stand-alone programs to make an "nrdb" = non-redundant database of sequences. Note: WU-blast is now being distibuted commercially as AB-Blast - get a free personal license. Older archived versions can be found here. |
|
|
Strictly the nrdb program generates a non-identical database. The source for nrdb can be found in http://blast.advbiocomp.com/pub/nrdb/, no license required. This was a newer version than that bundled in WU-BLAST, no idea if this is still the case for AB-BLAST. Originally nrdb was used to produce NCBI's 'nr' and 'nt' databases. Of course 'nt' is no longer non-identical and 'nr' is produced using a slightly different process today, but nrdb is still a popular way to generate non-identical databases for use with BLAST. | ||
3
|
linearize the sequences: surround the fasta headers by '@' and '#' , remove the CR, replace '#' by CR and '@' by 't' sort this tab delimited file on the second column (the sequence) , with case-insensible option, only the uniq columns restore the fasta header and sequence
|
|
|
| ||
2
|
Already nice answers: I would recommend to try the CD-HIT version designed for EST / nucleotides (CD-HIT-EST and CD-HIT-EST-2D) for this purpose. |
|
|
| ||
2
|
I have to say that the remove of duplicate sequences is not at al trivial, especialy when you consider real data with sequencing/alignment errors. Also problematic is that sequences are identical, but do not sully overlap. I can say with certainty that CD-HIT-EST will filter some duplicates, but far from all. I am working on a pipeline that uses BLAST, filtering out those contigs that have significant similarity to more that just themselves. |
|
|
| ||
2
|
uclust is about the fastest and one of the most flexible. If your sequences are not exactly the same length, or you also want to cluster some sequences that are almost, but not exactly, the same then look carefully at the flexibility and options of the thing you choose. |
|
|
| ||
2
|
Works with big sets, aa/prot seq files (at the opposite to fastx-toolkit), very fast and simple to use: genometools:
|
|
|
| ||
0
|
for smaller sets try this:
|
|
|
and so readable too. ;) now which has "... all the visual appeal of oatmeal with fingernail clippings mixed in." ?? http://en.wikiquote.org/wiki/Larry_Wall | ||
What is your understanding of "the same" are your including approximate stringmatching?
In fact you might not want to remove all the duplicated sequences but collapse them into a single sequence. I guess you meant to say it like this but your question is not clearly stating it.