#' sqlite_view_cdhits
#'
#' Create a view containing coverage information based on cdhits table.
#'
#' @param cdhit_dbtype dbtype
#' @param cdhit_fraction fraction
#' @param view_name viewname
#'
#' @return
#' @export
#'
#' @examples
#' sqlite_view_cdhits(cdhit_dbtype = "nt", cdhit_fraction = 975)
sqlite_view_cdhits <- function(view_name = "cds_100",
cdhit_dbtype = "nt",
cdhit_fraction=100) {
sql_query <-sprintf('
CREATE VIEW IF NOT EXISTS %s
AS
SELECT cds.*, cds_count.n
FROM cdhits cds
JOIN
(SELECT clstr_id, COUNT(*) AS n
FROM cdhits cds
GROUP BY clstr_id) cds_count
ON cds.clstr_id = cds_count.clstr_id
WHERE cds.is_clstr_ref = 1
AND cds.fraction = %s
AND cds.dbtype = "%s";', view_name, cdhit_fraction, cdhit_dbtype)
sql_query
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.