<metaproperty="og:title"content="Use predefined reference data set — mo_source"/>
<metaproperty="og:description"content="These functions can be used to predefine your own reference to be used in as.mo and consequently all mo_* functions like mo_genus and mo_gramstain."/>
<p>These functions can be used to predefine your own reference to be used in <code><ahref='as.mo.html'>as.mo</a></code> and consequently all <code>mo_*</code> functions like <code><ahref='mo_property.html'>mo_genus</a></code> and <code><ahref='mo_property.html'>mo_gramstain</a></code>.</p>
<p>The reference file can be a text file seperated with commas (CSV) or pipes, an Excel file (old 'xls' format or new 'xlsx' format) or an R object file (extension '.rds'). To use an Excel file, you need to have the <code>readxl</code> package installed.</p>
<p><code>set_mo_source</code> will check the file for validity: it must be a <code>data.frame</code>, must have a column named <code>"mo"</code> which contains values from <code>microorganisms$mo</code> and must have a reference column with your own defined values. If all tests pass, <code>set_mo_source</code> will read the file into R and export it to <code>"~/.mo_source.rds"</code>. This compressed data file will then be used at default for MO determination (function <code><ahref='as.mo.html'>as.mo</a></code> and consequently all <code>mo_*</code> functions like <code><ahref='mo_property.html'>mo_genus</a></code> and <code><ahref='mo_property.html'>mo_gramstain</a></code>). The location of the original file will be saved as option with <code><ahref='https://www.rdocumentation.org/packages/base/topics/options'>options</a>(mo_source = path)</code>. Its timestamp will be saved with <code><ahref='https://www.rdocumentation.org/packages/base/topics/options'>options</a>(mo_source_datetime = ...)</code>.</p>
<p><code>get_mo_source</code> will return the data set by reading <code>"~/.mo_source.rds"</code> with <code><ahref='https://www.rdocumentation.org/packages/base/topics/readRDS'>readRDS</a></code>. If the original file has changed (the file defined with <code>path</code>), it will call <code>set_mo_source</code> to update the data file automatically.</p>
<p>Reading an Excel file (<code>.xlsx</code>) with only one row has a size of 8-9 kB. The compressed file will have a size of 0.1 kB and can be read by <code>get_mo_source</code> in only a couple of microseconds (a millionth of a second).</p>
<h2class="hasAnchor"id="read-more-on-our-website-"><aclass="anchor"href="#read-more-on-our-website-"></a>Read more on our website!</h2>
On our website <ahref='https://msberends.gitlab.io/AMR'>https://msberends.gitlab.io/AMR</a> you can find <ahref='https://msberends.gitlab.io/AMR/articles/AMR.html'>a comprehensive tutorial</a> about how to conduct AMR analysis, the <ahref='https://msberends.gitlab.io/AMR/reference'>complete documentation of all functions</a> (which reads a lot easier than here in R) and <ahref='https://msberends.gitlab.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>.</p>
<li><ahref="#read-more-on-our-website-">Read more on our website!</a></li>
<li><ahref="#examples">Examples</a></li>
</ul>
</div>
</div>
<footer>
<divclass="copyright">
<p>Developed by <ahref='https://www.rug.nl/staff/m.s.berends/'>Matthijs S. Berends</a>, <ahref='https://www.rug.nl/staff/c.f.luz/'>Christian F. Luz</a>, <ahref='https://www.rug.nl/staff/c.glasner/'>Corinna Glasner</a>, <ahref='https://www.rug.nl/staff/a.w.friedrich/'>Alex W. Friedrich</a>, <ahref='https://www.rug.nl/staff/b.sinha/'>Bhanu N. M. Sinha</a>.</p>
</div>
<divclass="pkgdown">
<p>Site built with <ahref="https://pkgdown.r-lib.org/">pkgdown</a> 1.3.0.</p>