This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Extract Sequences from Multiple sequence alignment containing special character like gap?

I have multiple sequence alignment files of DNA in FASTA which contain deletions and insertions. I want to extract sequences that only contain a gap (-). Are there any available programs to run it?

My input like this

>A
ATGCATGCATGCAGCATGC
>B
GCATGCAT---GCATACATGC
>C
ATGC-ATGCATGCATGCA---

Output should be

>B
GCATGCAT---GCATACATGC
>C
ATGC-ATGCATGCATGCA---

Thanks In Advance.

alignment sequence

1 answer

Try seqkit grep

seqkit grep -s -p  "-" in.fa > out.fa

Thank you very much, Shenwei.

Log in to answer this question.