how to sort unique seq from fasta files
Hi, i have 300 fasta files and each file contain 3000-4000 amino acid seq, i want to know statistics of each file like how many number of common and unique seq are there in each fasta files?
Thank You!
• 1,732 views
•
link
2 answers
seqkit common finds common sequences of multiple files by id/name/sequence
seqkit common --by-seq --ignore-case --only-positive-strand \
--infile-list <(find dir/ -name "*.fasta" ) -o common.fa
seqkit grep can exlude a list of records via ID/name/sequence/sequence, common sequences here.
# common sequences, one record per line
seqkit seq --seq --line-width 0 common.fa -o common.fa.txt
# output dir
mkdir -p uniq
for f in dir/*; do
b=$(basename $f);
seqkit grep --by-seq --only-positive-strand --invert-match \
--pattern-file common.fa.txt $f -o uniq/$b
done
The method above compares sequence by the whole bases/amino acids (exact match), you may also use clustering methods, which might be more reasonable for proteins.
• 0 views
•
link
Log in to answer this question.