Skip to content

Commit

Permalink
bug fix for chimeras again.
Browse files Browse the repository at this point in the history
  • Loading branch information
brendanf committed Oct 27, 2019
1 parent 1a96d6c commit ce91d68
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
@@ -1,7 +1,7 @@
Package: tzara
Type: Package
Title: Cluster long amplicons using dada2 denoising on variable regions
Version: 0.0.7.2
Version: 0.0.7.3
Authors@R: person(given = "Brendan", family = "Furneaux",
email = "brendan.furneaux@gmail.com",
role = c("aut", "cre"))
Expand Down
12 changes: 10 additions & 2 deletions R/tzara.R
Expand Up @@ -906,6 +906,7 @@ reconstruct <- function(
region_table = region_table,
order = order,
sample_column = sample_column,
read_column = read_column,
chimera_offset = chimera_offset)

if (!is.null(raw_column)) {
Expand Down Expand Up @@ -1090,6 +1091,8 @@ assemble_region_table <- function(
#' which identifies different samples; if present, use
#' \code{\link[dada2]{isBimeraDenovoTable}} instead of
#' \code{\link[dada2]{isBimeraDenovo}}.
#' @param read_column (\code{character} scalar) column in region_table
#' which identifies different reads.
#' @param chimera_offset (\code{integer} scalar) use \code{1} if the first
#' region is conserved.
#' @param ... passed to \code{find_region_chimeras}.
Expand All @@ -1105,6 +1108,7 @@ find_all_region_chimeras <- function(
region_table,
order,
sample_column = NULL,
read_column = "read_id",
chimera_offset = 0,
...
) {
Expand All @@ -1117,6 +1121,7 @@ find_all_region_chimeras <- function(
find_region_chimeras,
region_table = region_table,
sample_column = sample_column,
read_column = read_column,
...
)
)
Expand All @@ -1134,12 +1139,15 @@ find_all_region_chimeras <- function(
#' which identifies different samples; if present, use
#' \code{\link[dada2]{isBimeraDenovoTable}} instead of
#' \code{\link[dada2]{isBimeraDenovo}}.
#' @param read_column (\code{character} scalar) column in region_table
#' which identifies different reads.
#' @param ... passed on to \code{\link[dada2]{isBimeraDenovoTable}} or
#' \code{\link[dada2]{isBimeraDenovo}}.
#'
#' @return an \code{character} vector giving the read IDs of
#' \code{region_table} which were detected as bimeras.
find_region_chimeras <- function(region_table, chimset, sample_column, ...) {
find_region_chimeras <- function(region_table, chimset, sample_column,
read_column, ...) {
seqs <- do.call(str_c, region_table[, chimset])
chimset_name <- paste(chimset, collapse = "--")
flog.trace("Searching for bimeras in regions %s.", chimset_name)
Expand Down Expand Up @@ -1167,7 +1175,7 @@ find_region_chimeras <- function(region_table, chimset, sample_column, ...) {
sum(seqs %in% names(chims)[chims], na.rm = TRUE),
sum(!is.na(seqs)),
chimset_name)
names(chims)[chims]
region_table[[read_column]][seqs %in% names(chims)[chims]]
}

block_consensus <- function(.x, .y, reg, reg2, reg2_raw, read_column, ...) {
Expand Down
5 changes: 4 additions & 1 deletion man/find_all_region_chimeras.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion man/find_region_chimeras.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ce91d68

Please sign in to comment.