# Filter sequence collections and alignments by length

Let’s load a collection of globin sequences. Note that we must have a the molecular type specified.

## Remove sequences shorter than a minimum length

Creating the `min_length` app and providing a positional argument specifying the minimum length allows us to filter an alignment, removing sequences which do not satisfy our threshold.

For instance, we can remove sequences from the globin alignment which are shorter than 240 amino acids long.

## Using the `min_length` app to filter multiple alignments

`min_length` is a useful app to use in data processing pipelines where downstream analysis requires sequences that exceed a given length.

In the following example, we compose a process that loads alignments and removes aligments less than 300 nucleotides in length, before writing them to a data store. We apply this process to a data store of the fasta files in the data directory. We restrict this data store to two members as a minimum example.

previous

Remove duplicated sequences from an alignment

next

Sample an alignment to a fixed length