Skip to content

Commit

Permalink
new
Browse files Browse the repository at this point in the history
  • Loading branch information
zachary-foster committed May 17, 2017
1 parent d19a035 commit 984bbb2
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 0 deletions.
31 changes: 31 additions & 0 deletions scratch/arrange_taxa_gc_weirdness.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@



```{r}
install.packages("metacoder")
library(metacoder)
gctorture2(999)
#> [1] 0
arrange_taxa(unite_ex_data_3, desc(name))
#> Error in data[, colnames(data) %in% col_subset, drop = FALSE]: incorrect number of dimensions
```


## old metacoder, new dplyr

```{r}
install.packages("metacoder")
devtools::install_github("tidyverse/dplyr@v0.6.0-rc")
library(metacoder)
arrange_taxa(unite_ex_data_3, desc(name))
```


## new metacoder, old dplyr

```{r}
devtools::install_github("grunwaldlab/metacoder@dev")
devtools::install_github("tidyverse/dplyr@v0.5.0")
library(metacoder)
arrange_taxa(unite_ex_data_3, desc(name))
```
Binary file added scratch/example.phyloseq
Binary file not shown.
25 changes: 25 additions & 0 deletions scratch/issue_123--warning_for_invalid_class_regex.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

## Reproduce error

```{r, eval = FALSE}
devtools::install_github("grunwaldlab/metacoder@59c6555")
```


```{r}
library(metacoder)
file_path <- system.file("extdata", "unite_general_release.fasta", package = "metacoder")
sequences <- ape::read.FASTA(file_path)
unite_ex_data_3 <- extract_taxonomy(sequences,
regex = "^(.*)\\|(.*)\\|(.*)\\|.*\\|(.*)$",
key = c(seq_name = "obs_info", seq_id = "obs_info",
other_id = "obs_info", "class"),
class_regex = "^(.*)_not_here_(.*)$",
class_key = c(unite_rank = "taxon_info", "name"),
class_sep = ";")
```


## Verify fix


6 changes: 6 additions & 0 deletions scratch/issue_140.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
```{r}
library(metacoder)
heat_tree(unite_ex_data_3, node_size = n_obs, node_label = name, node_color = ifelse(n_supertaxa == 2, "red", "grey"))
heat_tree(unite_ex_data_3, node_size = n_obs, node_label = name, node_color = ifelse(n_supertaxa %in% 2:5, n_obs, "grey"))
```

0 comments on commit 984bbb2

Please sign in to comment.