Commit 00af4935 authored by Olivier Rue's avatar Olivier Rue
Browse files

real samples analysis

parent 1305af2c
Pipeline #48203 passed with stage
in 16 seconds
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
Eco Sample
echantillon1-1 BREAD S1
echantillon1-2 BREAD S1
echantillon1-3 BREAD S1
echantillon2-1 BREAD S2
echantillon2-2 BREAD S2
echantillon2-3 BREAD S2
echantillon3-1 BREAD S3
echantillon3-2 BREAD S3
echantillon3-3 BREAD S3
\ No newline at end of file
Eco SampleID
echantillon1-1 WINE echantillon1-1
echantillon1-2 WINE echantillon1-2
echantillon1-3 WINE echantillon1-3
echantillon2-1 WINE echantillon2-1
echantillon2-2 WINE echantillon2-2
echantillon2-3 WINE echantillon2-3
echantillon3-1 WINE echantillon3-1
echantillon3-2 WINE echantillon3-2
echantillon3-3 WINE echantillon3-3
\ No newline at end of file
No preview for this file type
This diff is collapsed.
......@@ -114,41 +114,246 @@ raw_data <- read.csv2("data/metadata_real_reads.tsv" , sep = "\t", stringsAsFact
```
# MEAT
## Analysis of raw BIOM files {.tabset}
```{r, eval=T}
if (!file.exists("REAL_MEAT/ITS1.rds")) {
biomfile <- "REAL_MEAT/ITS1.biom"
physeq_its1 <- import_frogs(biomfile, taxMethod = "blast")
tax_table(physeq_its1) <- gsub(tax_table(physeq_its1), pattern = "[a-z]__", replacement = "")
metadata <- read.table("REAL_MEAT/metadata.tsv", row.names = 1, header = TRUE, sep = "\t", stringsAsFactors = FALSE)
sample_data(physeq_its1) <- metadata
sample_data(physeq_its1)$Marker <- "ITS1"
sample_data(physeq_its1)$Type <- "Raw"
sample_data(physeq_its1)$Reads <- raw_data %>% filter(Ecosystem == "MEAT") %>% filter(Marker == "ITS1") %>% pull(Reads)
sample_names(physeq_its1) <- glue::glue(paste("{sample_names(physeq_its1)}","ITS1", sep="_"))
saveRDS(physeq_its1,"REAL_MEAT/ITS1.rds")
} else {
physeq_its1 <- readRDS("REAL_MEAT/ITS1.rds")
dir <- paste("REAL",eco, sep="_")
ecos <- c("MEAT")
markers <- c("ITS1","ITS2","D1D2","RPB2")
for(eco in ecos){
for(marker in markers){
#if (!file.exists(file.path(dir,paste0(marker,".rds")))) {
biomfile <- file.path(dir,paste0(marker,".biom"))
physeq <- import_frogs(biomfile, taxMethod = "blast")
tax_table(physeq) <- gsub(tax_table(physeq),pattern = "[a-z]__", replacement = "")
metadata <- read.table(file.path(dir,"metadata.tsv"), row.names = 1, header = TRUE, sep = "\t", stringsAsFactors = FALSE)
sample_data(physeq) <- metadata
sample_data(physeq)$Marker <- marker
sample_data(physeq)$Type <- "Raw"
#sample_data(physeq)$Reads <- raw_data %>% filter(Ecosystem == eco) %>% filter(Marker == marker) %>% pull(Reads)
sample_names(physeq) <- glue::glue(paste("{sample_names(physeq)}",marker,"RAW",sep="_"))
saveRDS(physeq,file.path(dir,paste0(marker,".rds")))
#}
#if (!file.exists(file.path(dir,paste0(marker,"_final.rds")))) {
if(eco == "MEAT"){
if(marker == "ITS1"){
physeq_final <- curation_meat_its1(physeq)
}else if(marker == "ITS2"){
physeq_final <- curation_meat_its2(physeq)
}else if (marker == "D1D2"){
physeq_final <- curation_meat_d1d2(physeq)
}else{
physeq_final <- curation_meat_rpb2(physeq)
}
}else if(eco == "CHEESE"){
if(marker == "ITS1") physeq_final <- curation_cheese_its1(physeq)
if(marker == "ITS2") physeq_final <- curation_cheese_its2(physeq)
if(marker == "D1D2") physeq_final <- curation_cheese_d1d2(physeq)
if(marker == "RPB2") physeq_final <- curation_cheese_rpb2(physeq)
}else if(eco == "BREAD"){
if(marker == "ITS1") physeq_final <- curation_bread_its1(physeq)
if(marker == "ITS2") physeq_final <- curation_bread_its2(physeq)
if(marker == "D1D2") physeq_final <- curation_bread_d1d2(physeq)
if(marker == "RPB2") physeq_final <- curation_bread_rpb2(physeq)
}else if(eco == "WINE"){
if(marker == "ITS1") physeq_final <- curation_wine_its1(physeq)
if(marker == "ITS2") physeq_final <- curation_wine_its2(physeq)
if(marker == "D1D2") physeq_final <- curation_wine_d1d2(physeq)
if(marker == "RPB2") physeq_final <- curation_wine_rpb2(physeq)
}
sample_data(physeq_final)$Type <- "Curated"
#sample_data(physeq_final)$Reads <- sample_sums(physeq_final)
sample_names(physeq_final) <- glue::glue(paste("{sample_data(physeq)$SampleID}",marker,"CURATED", sep="_"))
saveRDS(physeq_final,file.path(dir,paste0(marker,"_final.rds")))
#}
}
}
```
# Sequencing depth {.tabset}
## MEAT {.tabset}
### ITS1
```{r, eval=T}
physeq <- readRDS("REAL_MEAT/ITS1.rds")
physeq_final <- readRDS("REAL_MEAT/ITS1_final.rds")
physeq_all <- merge_phyloseq(physeq, physeq_final)
p <- plot_composition(physeq_all, "Kingdom", "Fungi", "Family", x = "Type") +
scale_y_continuous(expand = expansion(0, 0)) +
scale_x_discrete(expand = expansion(0, 0)) +
facet_grid(~ SampleID)
p$data$Type <- factor(p$data$Type, levels = c("Raw","Curated"))
p
p <- plot_bar(physeq_all, x="Type") + facet_grid(~SampleID)
p$data$Type <- factor(p$data$Type, levels = c("Raw","Curated"))
p
```
### ITS2
```{r, eval=T}
physeq <- readRDS("REAL_MEAT/ITS2.rds")
physeq_final <- readRDS("REAL_MEAT/ITS2_final.rds")
physeq_all <- merge_phyloseq(physeq, physeq_final)
p <- plot_composition(physeq_all, "Kingdom", "Fungi", "Family", x = "Type") +
scale_y_continuous(expand = expansion(0, 0)) +
scale_x_discrete(expand = expansion(0, 0)) +
facet_grid(~ SampleID)
p$data$Type <- factor(p$data$Type, levels = c("Raw","Curated"))
p
p <- plot_bar(physeq_all, x="Type") + facet_grid(~SampleID)
p$data$Type <- factor(p$data$Type, levels = c("Raw","Curated"))
p
```
### D1D2
```{r, eval=T}
physeq <- readRDS("REAL_MEAT/D1D2.rds")
physeq_final <- readRDS("REAL_MEAT/D1D2_final.rds")
physeq_all <- merge_phyloseq(physeq, physeq_final)
p <- plot_composition(physeq, "Kingdom", "Fungi", "Family", x = "Type") +
scale_y_continuous(expand = expansion(0, 0)) +
scale_x_discrete(expand = expansion(0, 0)) +
facet_grid(~ SampleID)
p$data$Type <- factor(p$data$Type, levels = c("Raw","Curated"))
p
p <- plot_composition(physeq_final, "Kingdom", "Fungi", "Family", x = "Type") +
scale_y_continuous(expand = expansion(0, 0)) +
scale_x_discrete(expand = expansion(0, 0)) +
facet_grid(~ SampleID)
p$data$Type <- factor(p$data$Type, levels = c("Raw","Curated"))
p
p <- plot_composition(physeq_all, "Kingdom", "Fungi", "Family", x = "Type") +
scale_y_continuous(expand = expansion(0, 0)) +
scale_x_discrete(expand = expansion(0, 0)) +
facet_grid(~ SampleID)
p$data$Type <- factor(p$data$Type, levels = c("Raw","Curated"))
p
p <- plot_bar(physeq_all, x="Type") + facet_grid(~SampleID)
p$data$Type <- factor(p$data$Type, levels = c("Raw","Curated"))
p
```
### RPB2
```{r, eval=T}
physeq <- readRDS("REAL_MEAT/RPB2.rds")
physeq_final <- readRDS("REAL_MEAT/RPB2_final.rds")
physeq_all <- merge_phyloseq(physeq, physeq_final)
p <- plot_composition(physeq_all, "Kingdom", "Fungi", "Family", x = "Type") +
scale_y_continuous(expand = expansion(0, 0)) +
scale_x_discrete(expand = expansion(0, 0)) +
facet_grid(~ SampleID)
p$data$Type <- factor(p$data$Type, levels = c("Raw","Curated"))
p
p <- plot_bar(physeq_all, x="Type") + facet_grid(~SampleID)
p$data$Type <- factor(p$data$Type, levels = c("Raw","Curated"))
p
```
```{r}
#if (!file.exists(file.path(dir,paste0(marker,".rds")))) {
biomfile <- file.path(dir,paste0(marker,".biom"))
physeq <- import_frogs(biomfile, taxMethod = "blast")
tax_table(physeq) <- gsub(tax_table(physeq), pattern = "[a-z]__", replacement = "")
metadata <- read.table(file.path(dir,"metadata.tsv"), row.names = 1, header = TRUE, sep = "\t", stringsAsFactors = FALSE)
sample_data(physeq) <- metadata
sample_data(physeq)$Marker <- marker
sample_data(physeq)$Type <- "Raw"
sample_data(physeq)$Reads <- raw_data %>% filter(Ecosystem == eco) %>% filter(Marker == marker) %>% pull(Reads)
sample_names(physeq) <- glue::glue(paste("{sample_names(physeq)}",marker,"RAW",sep="_"))
saveRDS(physeq,file.path(dir,paste0(marker,".rds")))
if(eco == "MEAT"){
if(marker == "ITS1") physeq_final <- curation_meat_its1(physeq)
if(marker == "ITS2") physeq_final <- curation_meat_its2(physeq)
if(marker == "D1D2") physeq_final <- curation_meat_d1d2(physeq)
if(marker == "RPB2") physeq_final <- curation_meat_rpb2(physeq)
}else if(eco == "CHEESE"){
if(marker == "ITS1") physeq_final <- curation_cheese_its1(physeq)
if(marker == "ITS2") physeq_final <- curation_cheese_its2(physeq)
if(marker == "D1D2") physeq_final <- curation_cheese_d1d2(physeq)
if(marker == "RPB2") physeq_final <- curation_cheese_rpb2(physeq)
}else if(eco == "BREAD"){
if(marker == "ITS1") physeq_final <- curation_bread_its1(physeq)
if(marker == "ITS2") physeq_final <- curation_bread_its2(physeq)
if(marker == "D1D2") physeq_final <- curation_bread_d1d2(physeq)
if(marker == "RPB2") physeq_final <- curation_bread_rpb2(physeq)
}else if(eco == "WINE"){
if(marker == "ITS1") physeq_final <- curation_wine_its1(physeq)
if(marker == "ITS2") physeq_final <- curation_wine_its2(physeq)
if(marker == "D1D2") physeq_final <- curation_wine_d1d2(physeq)
if(marker == "RPB2") physeq_final <- curation_wine_rpb2(physeq)
}
if(marker == "ITS1"){
physeq_final <- curation_meat_its1(physeq)
}
sample_data(physeq_final)$Type <- "Curated"
sample_data(physeq_final)$Reads <- sample_sums(physeq_final)
sample_names(physeq_final) <- glue::glue(paste("{sample_data(physeq)$Sample}",marker,"CURATED", sep="_"))
saveRDS(physeq_final,file.path(dir,paste0(marker,"_final.rds")))
#} else {
# physeq_its1 <- readRDS("REAL_MEAT/ITS1.rds")
#}
#if (!file.exists("REAL_MEAT/ITS1_final.rds")) {
physeq_its1_final <- curation_meat_its1(physeq_its1)
sample_data(physeq_its1_final)$Type <- "Curated"
sample_data(physeq_its1_final)$Reads <- sample_sums(physeq_its1_final)
sample_names(physeq_its1_final) <- glue::glue(paste("{sample_data(physeq_its1)$Sample}","ITS1","CURATED", sep="_"))
saveRDS(physeq_its1_final,"REAL_MEAT/ITS1_final.rds")
#} else {
# physeq_its1_final <- readRDS("REAL_MEAT/ITS1_final.rds")
#}
if (!file.exists("REAL_MEAT/ITS2.rds")) {
#if (!file.exists("REAL_MEAT/ITS2.rds")) {
biomfile <- "REAL_MEAT/ITS2.biom"
physeq_its2 <- import_frogs(biomfile, taxMethod = "blast")
tax_table(physeq_its2) <- gsub(tax_table(physeq_its2), pattern = "[a-z]__", replacement = "")
metadata <- read.table("REAL_MEAT/metadata.tsv", row.names = 1, header = TRUE, sep = "\t", stringsAsFactors = FALSE)
sample_data(physeq_its2) <- metadata
sample_data(physeq_its2)$Marker <- "ITS2"
sample_data(physeq_its2)$Type <- "Raw"
sample_data(physeq_its2)$Reads <- raw_data %>% filter(Ecosystem == "MEAT") %>% filter(Marker == "ITS2") %>% pull(Reads)
sample_names(physeq_its2) <- glue::glue(paste("{sample_names(physeq_its2)}","ITS2", sep="_"))
saveRDS(physeq_its2,"REAL_MEAT/ITS2.rds")
} else {
physeq_its2 <- readRDS("REAL_MEAT/ITS2.rds")
}
if (!file.exists("REAL_MEAT/D1D2.rds")) {
#} else {
#physeq_its2 <- readRDS("REAL_MEAT/ITS2.rds")
#}
#if (!file.exists("REAL_MEAT/ITS2_final.rds")) {
physeq_its2_final <- curation_meat_its2(physeq_its2)
sample_data(physeq_its2_final)$Type <- "Curated"
sample_data(physeq_its2_final)$Reads <- sample_sums(physeq_its2_final)
sample_names(physeq_its2_final) <- glue::glue(paste("{sample_data(physeq_its2)$Sample}","ITS2","CURATED", sep="_"))
saveRDS(physeq_its2_final,"REAL_MEAT/ITS2_final.rds")
#} else {
# physeq_its2_final <- readRDS("REAL_MEAT/ITS2_final.rds")
#}
#if (!file.exists("REAL_MEAT/D1D2.rds")) {
biomfile <- "REAL_MEAT/D1D2.biom"
physeq_d1d2 <- import_frogs(biomfile, taxMethod = "blast")
tax_table(physeq_d1d2) <- gsub(tax_table(physeq_d1d2), pattern = "[a-z]__", replacement = "")
......@@ -156,36 +361,38 @@ if (!file.exists("REAL_MEAT/D1D2.rds")) {
metadata <- read.table("REAL_MEAT/metadata.tsv", row.names = 1, header = TRUE, sep = "\t", stringsAsFactors = FALSE)
sample_data(physeq_d1d2) <- metadata
sample_data(physeq_d1d2)$Marker <- "D1D2"
sample_data(physeq_d1d2)$Type <- "Raw"
sample_data(physeq_d1d2)$Reads <- raw_data %>% filter(Ecosystem == "MEAT") %>% filter(Marker == "D1D2") %>% pull(Reads)
sample_names(physeq_d1d2) <- glue::glue(paste("{sample_names(physeq_d1d2)}","D1D2", sep="_"))
saveRDS(physeq_d1d2,"REAL_MEAT/D1D2.rds")
} else {
physeq_d1d2 <- readRDS("REAL_MEAT/D1D2.rds")
}
#} else {
# physeq_d1d2 <- readRDS("REAL_MEAT/D1D2.rds")
#}
if (!file.exists("REAL_MEAT/RPB2.rds")) {
#if (!file.exists("REAL_MEAT/RPB2.rds")) {
biomfile <- "REAL_MEAT/RPB2.biom"
physeq_rpb2 <- import_frogs(biomfile, taxMethod = "blast")
tax_table(physeq_rpb2) <- gsub(tax_table(physeq_rpb2), pattern = "[a-z]__", replacement = "")
metadata <- read.table("REAL_MEAT/metadata.tsv", row.names = 1, header = TRUE, sep = "\t", stringsAsFactors = FALSE)
sample_data(physeq_rpb2) <- metadata
sample_data(physeq_rpb2)$Marker <- "RPB2"
sample_data(physeq_rpb2)$Type <- "Raw"
sample_data(physeq_rpb2)$Reads <- raw_data %>% filter(Ecosystem == "MEAT") %>% filter(Marker == "RPB2") %>% pull(Reads)
sample_names(physeq_rpb2) <- glue::glue(paste("{sample_names(physeq_rpb2)}","RPB2", sep="_"))
saveRDS(physeq_rpb2,"REAL_MEAT/RPB2.rds")
} else {
physeq_rpb2 <- readRDS("REAL_MEAT/RPB2.rds")
}
#} else {
# physeq_rpb2 <- readRDS("REAL_MEAT/RPB2.rds")
#}
```
```{r, eval=T}
if (!file.exists("REAL_MEAT/meat.rds")){
#if (!file.exists("REAL_MEAT/meat.rds")){
meat_all <- merge_phyloseq(physeq_its1, physeq_its2, physeq_d1d2, physeq_rpb2)
sample_data(meat_all)$Marker <- factor(sample_data(meat_all)$Marker, levels=c("ITS1","ITS2","D1D2","RPB2"))
saveRDS(meat_all,"REAL_MEAT/meat.rds")
}else{
meat_all <- readRDS("REAL_MEAT/meat.rds")
}
#}else{
# meat_all <- readRDS("REAL_MEAT/meat.rds")
#}
```
......@@ -264,8 +471,14 @@ ggVennDiagram(x,label_alpha = 0) +
physeq_its1_final <- curation_meat_its1(physeq_its1)
sample_data(physeq_its1_final)$Type <- "Curated"
sample_data(physeq_its1_final)$Reads <- sample_sums(physeq_its1_final)
sample_names(physeq_its1_final) <- glue::glue(paste("{sample_names(physeq_its1)}","CURATED", sep="_"))
sample_names(physeq_its1_final) <- glue::glue(paste("{sample_data(physeq_its1)$Sample}","ITS1","CURATED", sep="_"))
toto <- merge_phyloseq(physeq_its1, physeq_its1_final)
p <- plot_composition(physeq = toto, taxaRank1 = "Kingdom", taxaSet1 = "Fungi", taxaRank2 = "Species", numberOfTaxa = 22, x = "Sample")
p <- p + facet_grid(". ~ Sample", scales = "free_x", space = "free")
p + theme(legend.position="bottom")
p
saveRDS(physeq_its1_final,"REAL_MEAT/ITS1_final.rds")
......@@ -1189,8 +1402,8 @@ ggVennDiagram(x,label_alpha = 0) +
physeq_its1_final <- curation_wine_its1(physeq_its1)
saveRDS(physeq_its1_final,"REAL_WINE/ITS1_final.rds")
#physeq_its2_final <- curation_wine_its2(physeq_its2)
#saveRDS(physeq_its2_final,"REAL_WINE/ITS2_final.rds")
physeq_its2_final <- curation_wine_its2(physeq_its2)
saveRDS(physeq_its2_final,"REAL_WINE/ITS2_final.rds")
physeq_d1d2_final <- curation_wine_d1d2(physeq_d1d2)
saveRDS(physeq_d1d2_final,"REAL_WINE/D1D2_final.rds")
......@@ -1203,7 +1416,7 @@ saveRDS(physeq_rpb2_final,"REAL_WINE/RPB2_final.rds")
```{r, eval=T}
#if (!file.exists("REAL_WINE/wine_final.rds")){
wine_all_final <- merge_phyloseq(physeq_its1_final, physeq_its2, physeq_d1d2_final, physeq_rpb2_final)
wine_all_final <- merge_phyloseq(physeq_its1_final, physeq_its2_final, physeq_d1d2_final, physeq_rpb2_final)
sample_data(wine_all_final)$Marker <- factor(sample_data(wine_all_final)$Marker, levels=c("ITS1","ITS2","D1D2","RPB2"))
saveRDS(wine_all_final,"REAL_WINE/wine_final.rds")
#}else{
......
......@@ -11,17 +11,25 @@
<meta name="author" content="Olivier Rué" />
<meta name="date" content="2022-01-12" />
<meta name="date" content="2022-01-18" />
<title>Real samples analysis</title>
<script src="real_samples_files/header-attrs-2.6/header-attrs.js"></script>
<script src="real_samples_files/jquery-1.11.3/jquery.min.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href="real_samples_files/bootstrap-3.3.5/css/bootstrap.min.css" rel="stylesheet" />
<script src="real_samples_files/bootstrap-3.3.5/js/bootstrap.min.js"></script>
<script src="real_samples_files/bootstrap-3.3.5/shim/html5shiv.min.js"></script>
<script src="real_samples_files/bootstrap-3.3.5/shim/respond.min.js"></script>
<style>h1 {font-size: 34px;}
h1.title {font-size: 38px;}
h2 {font-size: 30px;}
h3 {font-size: 24px;}
h4 {font-size: 18px;}
h5 {font-size: 16px;}
h6 {font-size: 12px;}
code {color: inherit; background-color: rgba(0, 0, 0, 0.04);}
pre:not([class]) { background-color: white }</style>
<script src="real_samples_files/jqueryui-1.11.4/jquery-ui.min.js"></script>
<link href="real_samples_files/tocify-1.9.1/jquery.tocify.css" rel="stylesheet" />
<script src="real_samples_files/tocify-1.9.1/jquery.tocify.js"></script>
......@@ -40,11 +48,6 @@
</style>
<style type="text/css">code{white-space: pre;}</style>
<style type="text/css">
pre:not([class]) {
background-color: white;
}
</style>
<script type="text/javascript">
if (window.hljs) {
hljs.configure({languages: []});
......@@ -57,32 +60,6 @@ if (window.hljs) {
<style type="text/css">
h1 {
font-size: 34px;
}
h1.title {
font-size: 38px;
}
h2 {
font-size: 30px;
}
h3 {
font-size: 24px;
}
h4 {
font-size: 18px;
}
h5 {
font-size: 16px;
}
h6 {
font-size: 12px;
}
.table th:not([align]) {
text-align: left;
}
</style>
......@@ -94,10 +71,6 @@ h6 {
margin-left: auto;
margin-right: auto;
}
code {
color: inherit;
background-color: rgba(0, 0, 0, 0.04);
}
img {
max-width:100%;
}
......@@ -113,6 +86,9 @@ button.code-folding-btn:focus {
summary {
display: list-item;
}
pre code {
padding: 0;
}
</style>
......@@ -125,7 +101,6 @@ summary {
max-height: 500px;
min-height: 44px;
overflow-y: auto;
background: white;
border: 1px solid #ddd;
border-radius: 4px;
}
......@@ -254,7 +229,7 @@ div.tocify {
<!-- setup 3col/9col grid for toc_float and main content -->
<div class="row-fluid">
<div class="row">
<div class="col-xs-12 col-sm-4 col-md-3">
<div id="TOC" class="tocify">
</div>
......@@ -265,11 +240,11 @@ div.tocify {
<div class="fluid-row" id="header">
<div id="header">
<div class="btn-group pull-right">
<button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><span>Code</span> <span class="caret"></span></button>
<ul class="dropdown-menu" style="min-width: 50px;">
<div class="btn-group pull-right float-right">
<button type="button" class="btn btn-default btn-xs btn-secondary btn-sm dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><span>Code</span> <span class="caret"></span></button>
<ul class="dropdown-menu dropdown-menu-right" style="min-width: 50px;">
<li><a id="rmd-show-all-code" href="#">Show All Code</a></li>
<li><a id="rmd-hide-all-code" href="#">Hide All Code</a></li>
</ul>
......@@ -279,7 +254,7 @@ div.tocify {
<h1 class="title toc-ignore">Real samples analysis</h1>
<h4 class="author">Olivier Rué</h4>
<h4 class="date">2022-01-12</h4>
<h4 class="date">2022-01-18</h4>
</div>
......@@ -335,7 +310,7 @@ grep -f to_keep.lst affiliation.tsv &gt;&gt; affiliation-filtered-final.tsv</cod
<div id="meat" class="section level1">
<h1>MEAT</h1>
<div id="analysis-of-raw-biom-files" class="section level2 tabset">
<h2 class="tabset">Analysis of raw BIOM files</h2>
<h2>Analysis of raw BIOM files</h2>
<pre class="r"><code>if (!file.exists(&quot;REAL_MEAT/ITS1.rds&quot;)) {
biomfile &lt;- &quot;REAL_MEAT/ITS1.biom&quot;
physeq_its1 &lt;- import_frogs(biomfile, taxMethod = &quot;blast&quot;)
......@@ -343,6 +318,7 @@ grep -f to_keep.lst affiliation.tsv &gt;&gt; affiliation-filtered-final.tsv</cod
metadata &lt;- read.table(&quot;REAL_MEAT/metadata.tsv&quot;, row.names = 1, header = TRUE, sep = &quot;\t&quot;, stringsAsFactors = FALSE)
sample_data(physeq_its1) &lt;- metadata
sample_data(physeq_its1)$Marker &lt;- &quot;ITS1&quot;
sample_data(physeq_its1)$Type &lt;- &quot;Raw&quot;
sample_data(physeq_its1)$Reads &lt;- raw_data %&gt;% filter(Ecosystem == &quot;MEAT&quot;) %&gt;% filter(Marker == &quot;ITS1&quot;) %&gt;% pull(Reads)
sample_names(physeq_its1) &lt;- glue::glue(paste(&quot;{sample_names(physeq_its1)}&quot;,&quot;ITS1&quot;, sep=&quot;_&quot;))
saveRDS(physeq_its1,&quot;REAL_MEAT/ITS1.rds&quot;)
......@@ -400,7 +376,7 @@ if (!file.exists(&quot;REAL_MEAT/RPB2.rds&quot;)) {
meat_all &lt;- readRDS(&quot;REAL_MEAT/meat.rds&quot;)
}</code></pre>
<div id="sequencing-depth" class="section level3 tabset">
<h3 class="tabset">Sequencing depth</h3>
<h3>Sequencing depth</h3>
<pre class="r"><code>df &lt;- sample_data(meat_all) %&gt;% as(&quot;data.frame&quot;) %&gt;%
as_tibble(rownames = &quot;SampleID&quot;) %&gt;%
mutate(Final = sample_sums(meat_all)) %&gt;%
......@@ -460,8 +436,13 @@ ggVennDiagram(x,label_alpha = 0) +
</div>
</div>
<div id="manual-curation" class="section level2 tabset">
<h2 class="tabset">Manual curation</h2>
<h2>Manual curation</h2>
<pre class="r"><code>physeq_its1_final &lt;- curation_meat_its1(physeq_its1)
sample_data(physeq_its1_final)$Type &lt;- &quot;Curated&quot;
sample_data(physeq_its1_final)$Reads &lt;- sample_sums(physeq_its1_final)
sample_names(physeq_its1_final) &lt;- glue::glue(paste(&quot;{sample_names(physeq_its1)}&quot;,&quot;CURATED&quot;, sep=&quot;_&quot;))
saveRDS(physeq_its1_final,&quot;REAL_MEAT/ITS1_final.rds&quot;)
physeq_its2_final &lt;- curation_meat_its2(physeq_its2)
......@@ -480,7 +461,7 @@ saveRDS(meat_all_final,&quot;REAL_MEAT/meat_final.rds&quot;)
# meat_all_final &lt;- readRDS(&quot;REAL_MEAT/meat_final.rds&quot;)
#}</code></pre>
<div id="sequencing-depth-1" class="section level3 tabset">
<h3 class="tabset">Sequencing depth</h3>
<h3>Sequencing depth</h3>
<pre class="r"><code>df &lt;- sample_data(meat_all_final) %&gt;% as(&quot;data.frame&quot;) %&gt;%
as_tibble(rownames = &quot;SampleID&quot;) %&gt;%
mutate(Final = sample_sums(meat_all_final)) %&gt;%
......@@ -590,7 +571,7 @@ grep -f to_keep.lst affiliation-filtered.tsv &gt;&gt; affiliation-filtered-final
# pour avoir les séquences à rajouter à to_remove :
grep -v -f to_keep.lst affiliation.tsv | grep -v &quot;^#&quot; | awk -F&#39;\t&#39; &#39;{print $8}&#39;</code></pre>
<div id="analysis-of-raw-biom-files-1" class="section level2 tabset">
<h2 class="tabset">Analysis of raw BIOM files</h2>
<h2>Analysis of raw BIOM files</h2>
<pre class="r"><code>if (!file.exists(&quot;REAL_CHEESE/ITS1.rds&quot;)) {
biomfile &lt;- &quot;REAL_CHEESE/ITS1.biom&quot;
physeq_its1 &lt;- import_frogs(biomfile, taxMethod = &quot;blast&quot;)
......@@ -655,7 +636,7 @@ if (!file.exists(&quot;REAL_CHEESE/RPB2.rds&quot;)) {
cheese_all &lt;- readRDS(&quot;REAL_CHEESE/cheese.rds&quot;)
}</code></pre>
<div id="sequencing-depth-2" class="section level3 tabset">
<h3 class="tabset">Sequencing depth</h3>
<h3>Sequencing depth</h3>
<pre class="r"><code>df &lt;- sample_data(cheese_all) %&gt;% as(&quot;data.frame&quot;) %&gt;%
as_tibble(rownames = &quot;SampleID&quot;) %&gt;%
mutate(Final = sample_sums(cheese_all)) %&gt;%
......@@ -727,7 +708,7 @@ ggVennDiagram(x,label_alpha = 0) +
</div>
</div>
<div id="manual-curation-1" class="section level2 tabset">
<h2 class="tabset">Manual curation</h2>
<h2>Manual curation</h2>
<pre class="r"><code>physeq_its1_final &lt;- curation_cheese_its1(physeq_its1)
saveRDS(physeq_its1_final,&quot;REAL_CHEESE/ITS1_final.rds&quot;)
......@@ -747,7 +728,7 @@ saveRDS(cheese_all_final,&quot;REAL_CHEESE/cheese_final.rds&quot;)
# cheese_all_final &lt;- readRDS(&quot;REAL_CHEESE/cheese_final.rds&quot;)
#}</code></pre>
<div id="sequencing-depth-3" class="section level3 tabset">
<h3 class="tabset">Sequencing depth</h3>
<h3>Sequencing depth</h3>
<pre class="r"><code>df &lt;- sample_data(cheese_all_final) %&gt;% as(&quot;data.frame&quot;) %&gt;%
as_tibble(rownames = &quot;SampleID&quot;) %&gt;%
mutate(Final = sample_sums(cheese_all_final)) %&gt;%
......@@ -836,7 +817,7 @@ scp orue@genologin.toulouse.inra.fr:/work/frogsfungi/FungiPubli/Real_mock/METABA
#scp orue@genologin.toulouse.inra.fr:/work/frogsfungi/FungiPubli/Real_mock/METABARFOOD/CHEESE_REAL/results/DADA2_FROGS/D1D2/multiaff.tsv REAL_CHEESE/D1D2_multiaff.tsv
#scp orue@genologin.toulouse.inra.fr:/work/frogsfungi/FungiPubli/Real_mock/METABARFOOD/CHEESE_REAL/results/DADA2_FROGS/RPB2/multiaff.tsv REAL_CHEESE/RPB2_multiaff.tsv</code></pre>
<div id="analysis-of-raw-biom-files-2" class="section level2 tabset">
<h2 class="tabset">Analysis of raw BIOM files</h2>
<h2>Analysis of raw BIOM files</h2>
<pre class="r"><code>if (!file.exists(&quot;REAL_BREAD/ITS1.rds&quot;)) {
biomfile &lt;- &quot;REAL_BREAD/ITS1.biom&quot;
physeq_its1 &lt;- import_frogs(biomfile, taxMethod = &quot;blast&quot;)
......@@ -901,7 +882,7 @@ if (!file.exists(&quot;REAL_BREAD/RPB2.rds&quot;)) {
bread_all &lt;- readRDS(&quot;REAL_BREAD/bread.rds&quot;)
}</code></pre>
<div id="sequencing-depth-4" class="section level3 tabset">
<h3 class="tabset">Sequencing depth</h3>
<h3>Sequencing depth</h3>
<pre class="r"><code>df &lt;- sample_data(bread_all) %&gt;% as(&quot;data.frame&quot;) %&gt;%
as_tibble(rownames = &quot;SampleID&quot;) %&gt;%
mutate(Final = sample_sums(bread_all)) %&gt;%
......@@ -961,7 +942,7 @@ ggVennDiagram(x,label_alpha = 0) +
</div>
</div>
<div id="manual-curation-2" class="section level2 tabset">
<h2 class="tabset">Manual curation</h2>
<h2>Manual curation</h2>
<pre class="r"><code>tax_table(physeq_its1) &lt;- t
keptTaxa &lt;- setdiff(taxa_names(physeq_its1), to_remove)
physeq_its1_final &lt;- prune_taxa(keptTaxa, physeq_its1)
......@@ -974,7 +955,7 @@ saveRDS(physeq_its1_final,&quot;REAL_BREAD/ITS1_final.rds&quot;)</code></pre>
bread_all_final &lt;- readRDS(&quot;REAL_MEAT/bread_final.rds&quot;)
}</code></pre>
<div id="sequencing-depth-5" class="section level3 tabset">
<h3 class="tabset">Sequencing depth</h3>
<h3>Sequencing depth</h3>
<pre class="r"><code>df &lt;- sample_data(bread_all_final) %&gt;% as(&quot;data.frame&quot;) %&gt;%
as_tibble(rownames = &quot;SampleID&quot;) %&gt;%
mutate(Final = sample_sums(meat_all_final)) %&gt;%
......@@ -1045,7 +1026,7 @@ scp orue@genologin.toulouse.inra.fr:/work/frogsfungi/FungiPubli/Real_mock/METABA
#scp orue@genologin.toulouse.inra.fr:/work/frogsfungi/FungiPubli/Real_mock/METABARFOOD/CHEESE_REAL/results/DADA2_FROGS/D1D2/multiaff.tsv REAL_CHEESE/D1D2_multiaff.tsv
#scp orue@genologin.toulouse.inra.fr:/work/frogsfungi/FungiPubli/Real_mock/METABARFOOD/CHEESE_REAL/results/DADA2_FROGS/RPB2/multiaff.tsv REAL_CHEESE/RPB2_multiaff.tsv</code></pre>
<div id="analysis-of-raw-biom-files-3" class="section level2 tabset">
<h2 class="tabset">Analysis of raw BIOM files</h2>
<h2>Analysis of raw BIOM files</h2>
<pre class="r"><code>if (!file.exists(&quot;REAL_WINE/ITS1.rds&quot;)) {
biomfile &lt;- &quot;REA