From b677e33dc4fb70edd4d956ca9093f4e0fcc0fb87 Mon Sep 17 00:00:00 2001 From: Sameer Padhye Date: Fri, 30 Aug 2024 14:50:03 -0400 Subject: [PATCH] gen comm mat update --- R/helper.gen.comm.mat.R | 2 +- man/bold.analyze.diversity.Rd | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/R/helper.gen.comm.mat.R b/R/helper.gen.comm.mat.R index 80c9d032..4fb3b0d5 100644 --- a/R/helper.gen.comm.mat.R +++ b/R/helper.gen.comm.mat.R @@ -166,7 +166,7 @@ gen.comm.mat<-function(bold.df, !!taxon.rank)%>% dplyr::filter(!is.na(bin_uri))%>% tidyr::drop_na(!!site.cat)%>% - dplyr::filter(!(!!site.cat==""))%>% + #dplyr::filter(!(!!site.cat==""))%>% dplyr::arrange(!!site.cat) bin.comm.trial=bin.comm.trial[!is.na(bin.comm.trial[[taxon.rank]]), ] diff --git a/man/bold.analyze.diversity.Rd b/man/bold.analyze.diversity.Rd index eb54c685..4d7e9099 100644 --- a/man/bold.analyze.diversity.Rd +++ b/man/bold.analyze.diversity.Rd @@ -78,7 +78,7 @@ This function creates a biodiversity profile of the downloaded data using \code{ The community matrix generated by the function is used to create richness profiles using \code{BAT::alpha.accum()} and Preston and Shannon diversity analyses using \code{vegan::prestondistr()} and \code{vegan::diversity()} respectively. The \code{BAT::alpha.accum()} currently offers various richness estimators, including Observed diversity (Obs); Singletons (S1); Doubletons (S2); Uniques (Q1); Duplicates (Q2); Jackknife1 abundance (Jack1ab); Jackknife1 incidence (Jack1in); Jackknife2 abundance (Jack2ab); Jackknife2 incidence (Jack2in); Chao1 and Chao2. The results depend on the input data (true abundances vs counts vs incidences) and users should be careful in the subsequent interpretation. Preston plots are generated using the data from the \code{prestondistr} results in \code{ggplot2} featuring cyan bars for observed species (or equivalent taxonomic group) and orange dots for expected counts. The \code{presence.absence} argument converts the counts (or abundances) to 1s and 0s. This dataset can then be directly used as input data for biodiversity analysis functions from packages like vegan. Beta diversity values are calculated using \code{BAT::beta()} function, which partitions the data using the Podani & Schmera (2011)/Carvalho et al. (2012) approach partitioning the beta diversity into ’species replacement’ and ’richness difference’ components. These results are stored as distance matrices in the output. -\emph{Note on the community matrix}: Each cell in this matrix contains the counts (or abundances) of the specimens which sequence have an assigned BIN, in a given a site category (\code{site.cat}) or a grid (\code{grids.cat}). These counts can be generated at any taxonomic hierarchical level, applicable to one or multiple taxa including ’bin_uri’. The \code{site.cat} can refer to any geographic field, and metadata on these fields can be checked using the \code{bold.fields.info()}. If, \code{grids.cat} = TRUE, grids are generated based on BIN occurrence data (latitude, longitude) with grid size determined by the user in square meters using the \code{gridsize} argument. Rows lacking latitude and longitude data are removed, while NULL entries for site.cat are allowed if they have a latitude and longitude value. This is because grids are drawn based on the bounding boxes which only use latitude and longitude values +\emph{Note on the community matrix}: Each cell in this matrix contains the counts (or abundances) of the specimens whose sequences have an assigned BIN, in a given a site category (\code{site.cat}) or a grid (\code{grids.cat}). These counts can be generated at any taxonomic hierarchical level, applicable to one or multiple taxa including ’bin_uri’. The \code{site.cat} can refer to any geographic field, and metadata on these fields can be checked using the \code{bold.fields.info()}. If, \code{grids.cat} = TRUE, grids are generated based on BIN occurrence data (latitude, longitude) with grid size determined by the user in square meters using the \code{gridsize} argument. Rows lacking latitude and longitude data are removed, while NULL entries for site.cat are allowed if they have a latitude and longitude value. This is because grids are drawn based on the bounding boxes which only use latitude and longitude values \emph{Important Note}: Results, including species counts, adapt based on taxon.rank argument although the output label remains ‘species’ in some instances (\code{preston.res}). } \examples{