leppott / BioMonTools

Tools for biomonitoring and bioassessment; metric calculation for benthic macroinvertebrates, fish, and periphyton.
https://leppott.github.io/BioMonTools/
MIT License
13 stars 5 forks source link

metric.values - do not calculate DNI taxa #96

Closed leppott closed 1 year ago

leppott commented 1 year ago

Describe the bug Some projects have started including "DNI" (Do Not Include) taxa in their final outputs for use with BioMonTools::metric.values().

These come in to play with taxa translations and using multiple OTUs for different indices with the same data. For example, water mites might be excluded in one OTU but included in another OTU.

To Reproduce Steps to reproduce the behavior: Include "DNI" in the Taxa_ID column.

Expected behavior The user expects the DNI taxa to not be included in the metric results. But wants to include them in the input. That is, the user doesn't want to make any adjustments after running the taxa translation function that may add the DNI entries to the data.

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Complicating things is the inclusion of 3 DNI metrics (pi_DNI, nt_DNI, and pt_DNI) [see Issue #90]. So can't blanket drop the records.

leppott commented 1 year ago

BioMonTools::taxa_translate() includes a parameter (taxaid_drop) to remove taxa from the output (e.g., DNI).

leppott commented 1 year ago

Calculate metrics with DNI taxa for DNI metrics. Calculate metrics without DNI taxa for all other metrics. Join to get the results.

Will need to do for both MTTI and regular metrics. Only benthic for now.

image