Skip to content

Commit

Permalink
Update files
Browse files Browse the repository at this point in the history
  • Loading branch information
masudermann committed Oct 16, 2024
1 parent ef1b229 commit db1af9b
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 0 deletions.
Binary file modified .DS_Store
Binary file not shown.
13 changes: 13 additions & 0 deletions R/R.Rproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Version: 1.0

RestoreWorkspace: Default
SaveWorkspace: Default
AlwaysSaveHistory: Default

EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8

RnwWeave: Sweave
LaTeX: pdfLaTeX
Binary file modified inst/.DS_Store
Binary file not shown.
80 changes: 80 additions & 0 deletions vignettes/06_pooled_amplicon_analysis.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
---
title: "Pooled amplicon example"
output:
rmarkdown::html_vignette:
fig_path: "man/figures"
vignette: >
%\VignetteIndexEntry{Pooled amplicon example}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---

```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "./"
)
```

## Demonstration of how to use demulticoder on a dataset that has pooled amplicoins (RPS10 and ITS)

Input metadata and primerinfo_params files are in data folder
```{r setup, include=FALSE}
#TODO-at some point switch to loading github repo version
devtools::load_all("~/demulticoder")
library("demulticoder")
```

### Step 1-Remove N's and create directory structure for downstream steps
```{r prepare reads}
outputs<-prepare_reads(
data_directory = "~/demulticoder_benchmarking/demulticoder_combined_analysis_rhode/data",
output_directory = "~/demulticoder_benchmarking/demulticoder_combined_analysis_rhode/outputs_trunq2_overlap12",
tempdir_path = "~/demulticoder_benchmarking/demulticoder_combined_analysis_rhode/temp_rhode2",
overwrite_existing = TRUE)
```

### Step 2-Run Cutadapt to remove primers and then trim reads with DADA2 filterAndTrim function
```{r Remove primers and trim reads}
cut_trim(
outputs,
cutadapt_path="/usr/bin/cutadapt",
overwrite_existing = FALSE)
```

### Step 3-Core ASV inference step
```{r ASV inference}
make_asv_abund_matrix(
outputs,
overwrite_existing = TRUE)
```

### Step 4-Assign taxonomy step
```{r assign taxonomy step}
assign_tax(
outputs,
asv_abund_matrix,
db_its = "sh_general_release_dynamic_all_04.04.2024.fasta",
db_rps10 = "oomycetedb.fasta",
retrieve_files=TRUE,
tryRC = TRUE,
overwrite_existing=FALSE)
```

### Step 5-convert asv matrix to taxmap and phyloseq objects with one function
```{r convert matrix to other formats}
objs<-convert_asv_matrix_to_objs(outputs, save_outputs=TRUE, overwrite_existing = TRUE)
```

### Step 6-Let's now proceed with some exploratory analysis using taxmap objs. The code is addapted from an analysis done by Zach Foster.

# Based on previous analyses, we will load output matrices directly, combine rps10 and its matrices, and make sure there are no redundant taxa, and then proceed. This demonstration shows that you don't need to rely on the converted phyloseq or taxmap objects if you want more flexibilitywith being able to combine matrices.
```{r Additional analysis 1}
rps10_matrix<-read.csv("~/demulticoder_benchmarking/demulticoder_combined_analysis_rhode/outputs2/final_asv_abundance_matrix_rps10.csv")
its_matrix<-read.csv("~/demulticoder_benchmarking/demulticoder_combined_analysis_rhode/outputs2/final_asv_abundance_matrix_its.csv")
```

```{r}
sessioninfo::session_info()
```

0 comments on commit db1af9b

Please sign in to comment.