# How do I create the .pkl required to run metaphlan?

**URL:** <https://forum.biobakery.org/t/how-do-i-create-the-pkl-required-to-run-metaphlan/4698>\
**Category:** MetaPhlAn\
**Created:** [January 24, 2023, 12:23am UTC](https://forum.biobakery.org/t/how-do-i-create-the-pkl-required-to-run-metaphlan/4698 "2023-01-24T00:23:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnchase](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/johnchase/32/1905_2.png) [@johnchase](https://forum.biobakery.org/u/johnchase)\
**Post date:** [January 24, 2023, 12:23am UTC](https://forum.biobakery.org/t/how-do-i-create-the-pkl-required-to-run-metaphlan/4698/1 "2023-01-24T00:23:21Z")

</div>

I have created a bowtie database with the following command

```auto
bowtie2-build --large-index -f chocophlan-small.fna chocophlan-small-bt2l

```

This works and creates a set of files:

```auto
chocophlan-small-bt2l.1.bt2l
chocophlan-small-bt2l.2.bt2l
chocophlan-small-bt2l.3.bt2l
chocophlan-small-bt2l.4.bt2l
chocophlan-small-bt2l.rev.1.bt2l 
chocophlan-small-bt2l.rev.2.bt2l

```

However, when running this through metaphlan I get an error:

```auto
metaphlan sample-1_0_L001_R1_001_humann --offline --bowtie2db chocophlan-small --index chocophlan-small-bt2l --stat_q 0.2 --add_viruses --unclassified_estimation -o sample-1_0_L001_R1_001_metaphlan_bugs_list.tsv --input_type fastq --bowtie2out sample-1_0_L001_R1_001_metaphlan_bowtie2.txt

Error message returned from metaphlan :
Error: Unable to find the mpa_pkl file at: mpa_pklExiting...

```

Is this something I can create?

---

<div class="post-metadata">

**Author:** ![aitor.blancomiguez](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/aitor.blancomiguez/32/86_2.png) [@aitor.blancomiguez](https://forum.biobakery.org/u/aitor.blancomiguez)\
**Post date:** [January 31, 2023, 8:48am UTC](https://forum.biobakery.org/t/how-do-i-create-the-pkl-required-to-run-metaphlan/4698/2 "2023-01-31T08:48:33Z")

</div>

Hi @johnchase  
Additionally to the bowtie2 database, you should create the database pickle file containing the information of the taxa and markers present in your bowtie2 database and with the name `chocophlan-small-bt2l.pkl` More info here: [MetaPhlAn 4 · biobakery/MetaPhlAn Wiki · GitHub](https://github.com/biobakery/MetaPhlAn/wiki/MetaPhlAn-4#customizing-the-database)

---

<div class="post-metadata">

**Author:** ![johnchase](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/johnchase/32/1905_2.png) [@johnchase](https://forum.biobakery.org/u/johnchase)\
**Post date:** [February 8, 2023, 4:28pm UTC](https://forum.biobakery.org/t/how-do-i-create-the-pkl-required-to-run-metaphlan/4698/3 "2023-02-08T16:28:39Z")

</div>

Thank you, this is what I was looking for!
