I have a large fasta file of 16S sequences and I want to retrieve sequences using a list of organism names. Do you know a script capable of doing it?

EDIT:

Headers look like that:

```
>S000000859 Bacillus sp. USC14; AF346495
sequence
>S000001027 Paenibacillus borealis; KN25; AJ011325
sequence
```

And I have a list like the following:

```
Paenibacilus borealis
Paenibacillus sp. 1-18
Paenibacillus sp. 1-49
Paenibacillus sp. A9
Paenibacillus sp. Aloe-11
```

I want to retrieve those sequences that match with names present in the list.
You can do this easily by installing the FAST: Fast Analysis of Sequences Toolbox ([publication][1])([github][2]).

You can install it by using this command (only use sudo if you need to):

    (sudo) perl -MCPAN -e 'install FAST'

Once it is installed here is a small bash script to do what you need:

```
#!/bin/bash

while read line ;do
    cat original_fasta.fa | fasgrep -di "$line"  >> reduced_fasta_file.fa
done < species.txt
```

 [1]: http://journal.frontiersin.org/article/10.3389/fgene.2015.00172/abstract
 [2]: https://github.com/tlawrence3/FAST