---
layout: post
title: "Comparing and optimizing performance of phyloytypr to mothur (CC304)"
blurb: "purrr, furrr, and data files in packages"
author: "PD Schloss"
date: 2024-10-07 9:00
comments: false
youtube: Qsl-opeguFI
start_hash: a8c0036bd218e3451caab57198e594c7ad1ba332
end_hash: 8e5497e3693c2153ac97420881c19e9cfdf0c45d
---

Pat compares the performance of phylotypr to mothur and finds that mothur is faster. After revisiting his code he is able to use Rfast's rowsums instead of colsums to match mothur's performance with one processor using the purrr package. Then he shows how to use the furrr package to parallelize the R code. Finally, he shows how to include data files into a package and write a function to access the data in the file. This episode is part of an ongoing effort to develop an R package that implements the naive Bayesian classifier for classifying 16S rRNA gene sequences.

<iframe style="margin: 0 auto;display:block;" width="560" height="315" src="https://www.youtube.com/embed/{{ page.youtube }}" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

## Code

You can browse the state of the repositories at the

* [beginning of the episode](https://github.com/riffomonas/phylotypr/tree/{{page.start_hash}})
* [end of the episode](https://github.com/riffomonas/phylotypr/tree/{{page.end_hash}})
