Skip to content

Commit

Permalink
compatibility with new versions of tidyr
Browse files Browse the repository at this point in the history
  • Loading branch information
brendanf committed Nov 19, 2019
1 parent b078562 commit 0e4891c
Show file tree
Hide file tree
Showing 10 changed files with 84 additions and 34 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
@@ -1,7 +1,7 @@
Package: tzara
Type: Package
Title: Cluster long amplicons using dada2 denoising on variable regions
Version: 0.0.7.3
Version: 0.0.7.5
Authors@R: person(given = "Brendan", family = "Furneaux",
email = "brendan.furneaux@gmail.com",
role = c("aut", "cre"))
Expand Down Expand Up @@ -50,4 +50,4 @@ Suggests:
testthat (>= 2.1.0),
covr,
lintr
RoxygenNote: 6.1.1
RoxygenNote: 7.0.0
1 change: 1 addition & 0 deletions NAMESPACE
Expand Up @@ -8,6 +8,7 @@ S3method(dadamap,derep)
S3method(dadamap,list)
S3method(extract_region,ShortRead)
S3method(extract_region,character)
S3method(extract_region,list)
S3method(seqhash,XStringSet)
S3method(seqhash,character)
S3method(summarize_sread,ShortReadQ)
Expand Down
10 changes: 7 additions & 3 deletions R/tzara.R
Expand Up @@ -96,11 +96,13 @@ combine_derep <- function(dereps, .data = NULL, ...) {
# preserve the sequence names as "seq.id" if they are present
oldmap <- dereps
oldmap[["oldmap"]] <- lapply(oldmap[["derep"]], `[[`, "map")
nestedcols <- "oldmap"
if (all(vapply(oldmap[["derep"]], assertthat::has_name, TRUE, "names"))) {
oldmap[["seq.id"]] <- lapply(oldmap[["derep"]], `[[`, "names")
nestedcols <- c(nestedcols, "seq.id")
}
oldmap <- dplyr::select(oldmap, -"derep") %>%
tidyr::unnest() %>%
tidyr::unnest(cols = nestedcols) %>%
dplyr::group_by_at(gps) %>%
dplyr::mutate(idx = 1:dplyr::n()) %>%
dplyr::ungroup()
Expand All @@ -110,7 +112,7 @@ combine_derep <- function(dereps, .data = NULL, ...) {
dplyr::mutate_at("derep",
~purrr::map(., .f = ~tibble(seq = names(.$uniques),
n = .$uniques))) %>%
tidyr::unnest()
tidyr::unnest(cols = "derep")

# combine duplicate sequences among all files.
newuniques <- olduniques %>%
Expand All @@ -129,7 +131,7 @@ combine_derep <- function(dereps, .data = NULL, ...) {
dplyr::mutate(oldmap = seq_along(seq)) %>%
dplyr::ungroup(),
newuniques,
.by = "seq")
by = "seq")
}

out <- list()
Expand Down Expand Up @@ -701,6 +703,8 @@ extract_region.ShortRead <- function(seq, positions, region, region2 = region,
return(out)
}

#' @rdname extract_region
#' @export
extract_region.list <- function(seq, positions, region, region2 = region,
outfile = NULL, ...) {

Expand Down
13 changes: 9 additions & 4 deletions man/cluster_consensus.Rd

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

30 changes: 23 additions & 7 deletions man/extract_region.Rd

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

10 changes: 8 additions & 2 deletions man/find_all_region_chimeras.Rd

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

3 changes: 1 addition & 2 deletions man/find_region_chimeras.Rd

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

11 changes: 9 additions & 2 deletions man/map_or_consensus.Rd

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

30 changes: 22 additions & 8 deletions man/reconstruct.Rd

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

6 changes: 2 additions & 4 deletions man/seqhash.Rd

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

0 comments on commit 0e4891c

Please sign in to comment.