How to reduce the number of sequences in a Multiple Sequence Alignment?
The bioconductor package &quot;ShortRead&quot;  might be what you are after.
It has a function &quot;clean&quot; to remove sequences with ambiguous bases. It also can remove duplicates if you need to.