This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to remove redundant sequences from fasta file ?

I've fasta file containing nucleotide sequences. How can I remove the redundant sequences?I'm trying to access cd-hit but web server is not available. Is there any other tool available for removing redundancy? I really appreciate any help or suggestion!

fasta cd-hit

seqkit rmdup can remove duplicated sequences in a fasta file.

printf '> A1\nATTG\n> A2\nTTTA\n> A3\nATTG' | seqkit rmdup -sP

> A1
ATTG
> A2
TTTA
[INFO] 1 duplicated records removed
$ printf '>A1\nATTG\n>A2\nTTTA\n>A3\nATTG\n' | awk '/^>/ NR > 1 {getline seq; print $0,seq}' | sort -uk2,2 | tr -s " " "\n"

works if sequence is in a single line.

0 answers

No answers yet.

Log in to answer this question.