Commit 6fa17659 authored by Olivier Rue's avatar Olivier Rue
Browse files

wine rpb2 ok

parent 0b26c50e
Pipeline #47241 passed with stage
in 24 seconds
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -81,6 +81,7 @@ scp orue@genotoul.toulouse.inra.fr:/work/frogsfungi/FungiPubli/Real_mock/METABAR
scp orue@genotoul.toulouse.inra.fr:/work/frogsfungi/FungiPubli/Real_mock/METABARFOOD/REAL/results/DADA2_FROGS/RPB2/filters.fasta .
##########################
biom_to_tsv.py --input-biom affiliation.biom --output-tsv affiliation.tsv --input-fasta filters.fasta
otu_filters.py --input-biom affiliation.biom --input-fasta filters.fasta --contaminant /db/frogs_databanks/assignation/Unite_Fungi_8.2_20200204/Unite_Fungi_8.2_20200204.fasta --output-biom 1.biom --output-fasta 1.fasta --nb-cpus 4
otu_filters.py --input-biom 1.biom --input-fasta 1.fasta --contaminant /db/frogs_databanks/assignation/SILVA_132_LSU/SILVA_132_LSU.fasta --nb-cpus 4 --output-biom 2.biom --output-fasta 2.fasta
otu_filters.py --input-biom 2.biom --input-fasta 2.fasta --contaminant /db/frogs_databanks/assignation/silva_138_SSU/silva_138_SSU.fasta --nb-cpus 4 --output-biom 3.biom --output-fasta 3.fasta
......@@ -96,15 +97,15 @@ biom_to_tsv.py --input-biom affiliation-filtered.biom --output-tsv affiliation-f
affiliation_OTU.py --input-fasta affiliation-filtered.fasta --input-biom affiliation-filtered.biom --nb-cpus 8 --output-biom affiliation.biom --summary affiliation.html --reference D1D2.fasta
biom_to_tsv.py --input-biom affiliation.biom --output-tsv affiliation.tsv
biom_to_tsv.py --input-biom affiliation.biom --output-tsv affiliation2.tsv --input-fasta affiliation-filtered.fasta
head -n 1 4.tsv > final.tsv
awk -F'\t' '{ if ($4 < 80 && $5 > 95 && length($8 > 400)) { print } }' affiliation.tsv >> final.tsv
awk -F'\t' '{ if ($4 < 80 && $5 > 95 && length($8 > 400)) { print } }' affiliation2.tsv >> final.tsv
awk -F'\t' '{print $8}' <(grep -v "^#" final.tsv) > to_keep.lst
head -n 1 4.tsv > affiliation-filtered-final.tsv
grep -f to_keep.lst affiliation-filtered.tsv >> affiliation-filtered-final.tsv
grep -f to_keep.lst affiliation.tsv >> affiliation-filtered-final.tsv
```
......@@ -278,7 +279,7 @@ saveRDS(physeq_rpb2_final,"REAL_MEAT/RPB2_final.rds")
#if (!file.exists("REAL_MEAT/meat_final.rds")){
meat_all_final <- merge_phyloseq(physeq_its1_final, physeq_its2_final, physeq_d1d2_final, physeq_rpb2_final)
sample_data(meat_all_final)$Marker <- factor(sample_data(meat_all_final)$Marker, levels=c("ITS1","ITS2","D1D2","RPB2"))
saveRDS(meat_all_final,"REAL_CHEESE/meat_final.rds")
saveRDS(meat_all_final,"REAL_WINE/meat_final.rds")
#}else{
# meat_all_final <- readRDS("REAL_MEAT/meat_final.rds")
#}
......@@ -408,6 +409,9 @@ awk -F'\t' '{print $8}' <(grep -v "^#" final.tsv) > to_keep.lst
head -n 1 4.tsv > affiliation-filtered-final.tsv
grep -f to_keep.lst affiliation-filtered.tsv >> affiliation-filtered-final.tsv
# pour avoir les séquences à rajouter à to_remove :
grep -v -f to_keep.lst affiliation.tsv | grep -v "^#" | awk -F'\t' '{print $8}'
```
......@@ -987,10 +991,10 @@ scp orue@genologin.toulouse.inra.fr:/work/frogsfungi/FungiPubli/Real_mock/METABA
scp orue@genologin.toulouse.inra.fr:/work/frogsfungi/FungiPubli/Real_mock/METABARFOOD/WINE_REAL/results/DADA2_FROGS/D1D2/affiliation.biom REAL_WINE/D1D2.biom
scp orue@genologin.toulouse.inra.fr:/work/frogsfungi/FungiPubli/Real_mock/METABARFOOD/WINE_REAL/results/DADA2_FROGS/RPB2/affiliation.biom REAL_WINE/RPB2.biom
#scp orue@genologin.toulouse.inra.fr:/work/frogsfungi/FungiPubli/Real_mock/METABARFOOD/BREAD_REAL/results/DADA2_FROGS/ITS1/affiliation.tsv REAL_BREAD/ITS1.tsv
#scp orue@genologin.toulouse.inra.fr:/work/frogsfungi/FungiPubli/Real_mock/METABARFOOD/BREAD_REAL/results/DADA2_FROGS/ITS2/affiliation.tsv REAL_BREAD/ITS2.tsv
#scp orue@genologin.toulouse.inra.fr:/work/frogsfungi/FungiPubli/Real_mock/METABARFOOD/BREAD_REAL/results/DADA2_FROGS/D1D2/affiliation.tsv REAL_BREAD/D1D2.tsv
#scp orue@genologin.toulouse.inra.fr:/work/frogsfungi/FungiPubli/Real_mock/METABARFOOD/BREAD_REAL/results/DADA2_FROGS/RPB2/affiliation.tsv REAL_BREAD/RPB2.tsv
scp orue@genologin.toulouse.inra.fr:/work/frogsfungi/FungiPubli/Real_mock/METABARFOOD/BREAD_REAL/results/DADA2_FROGS/ITS1/affiliation.tsv REAL_BREAD/ITS1.tsv
scp orue@genologin.toulouse.inra.fr:/work/frogsfungi/FungiPubli/Real_mock/METABARFOOD/BREAD_REAL/results/DADA2_FROGS/ITS2/affiliation.tsv REAL_BREAD/ITS2.tsv
scp orue@genologin.toulouse.inra.fr:/work/frogsfungi/FungiPubli/Real_mock/METABARFOOD/BREAD_REAL/results/DADA2_FROGS/D1D2/affiliation.tsv REAL_BREAD/D1D2.tsv
scp orue@genologin.toulouse.inra.fr:/work/frogsfungi/FungiPubli/Real_mock/METABARFOOD/BREAD_REAL/results/DADA2_FROGS/RPB2/affiliation.tsv REAL_BREAD/RPB2.tsv
#scp orue@genologin.toulouse.inra.fr:/work/frogsfungi/FungiPubli/Real_mock/METABARFOOD/CHEESE_REAL/results/DADA2_FROGS/ITS1/multiaff.tsv REAL_CHEESE/ITS1_multiaff.tsv
#scp orue@genologin.toulouse.inra.fr:/work/frogsfungi/FungiPubli/Real_mock/METABARFOOD/CHEESE_REAL/results/DADA2_FROGS/ITS2/multiaff.tsv REAL_CHEESE/ITS2_multiaff.tsv
......@@ -1059,6 +1063,7 @@ if (!file.exists("REAL_WINE/RPB2.rds")) {
}
```
```{r, eval=T}
if (!file.exists("REAL_WINE/wine.rds")){
wine_all <- merge_phyloseq(physeq_its1, physeq_its2, physeq_d1d2, physeq_rpb2)
......@@ -1136,36 +1141,77 @@ x <- list(
)
ggVennDiagram(x,label_alpha = 0) +
scale_fill_gradient(low = "#F4FAFE", high = "#4981BF")
```
### Common species
```{r, eval=T}
x <- list(
ITS1 = as_tibble(tax_table(physeq_its1))$Species %>% as.vector(),
ITS2 = as_tibble(tax_table(physeq_its2))$Species %>% as.vector(),
D1D2 = as_tibble(tax_table(physeq_d1d2))$Species %>% as.vector(),
RPB2 = as_tibble(tax_table(physeq_rpb2))$Species %>% as.vector()
)
ggVennDiagram(x,label_alpha = 0) +
scale_fill_gradient(low = "#F4FAFE", high = "#4981BF")
```
## Manual curation {.tabset}
```{r, eval=F}
tax_table(physeq_its1) <- t
keptTaxa <- setdiff(taxa_names(physeq_its1), to_remove)
physeq_its1_final <- prune_taxa(keptTaxa, physeq_its1)
saveRDS(physeq_its1_final,"REAL_BREAD/ITS1_final.rds")
```{r, eval=T}
#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_d1d2_final <- curation_wine_d1d2(physeq_d1d2)
#saveRDS(physeq_d1d2_final,"REAL_WINE/D1D2_final.rds")
physeq_rpb2_final <- curation_wine_rpb2(physeq_rpb2)
saveRDS(physeq_rpb2_final,"REAL_WINE/RPB2_final.rds")
```
```{r, eval=F}
if (!file.exists("REAL_MEAT/bread_final.rds")){
bread_all_final <- merge_phyloseq(physeq_its1_final, physeq_its2, physeq_d1d2, physeq_rpb2)
sample_data(bread_all_final)$Marker <- factor(sample_data(bread_all_final)$Marker, levels=c("ITS1","ITS2","D1D2","RPB2"))
saveRDS(bread_all_final,"REAL_MEAT/bread_final.rds")
}else{
bread_all_final <- readRDS("REAL_MEAT/bread_final.rds")
}
```{r, eval=T}
#if (!file.exists("REAL_WINE/wine_final.rds")){
wine_all_final <- merge_phyloseq(physeq_its1, physeq_its2, physeq_d1d2, 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{
# wine_all_final <- readRDS("REAL_WINE/wine_final.rds")
#}
```
### Sequencing depth {.tabset}
```{r, eval=F}
df <- sample_data(bread_all_final) %>% as("data.frame") %>%
```{r, eval=T}
df <- sample_data(wine_all_final) %>% as("data.frame") %>%
as_tibble(rownames = "SampleID") %>%
mutate(Final = sample_sums(meat_all_final)) %>%
mutate(Final = sample_sums(wine_all_final)) %>%
rename(Initial = Reads)
ggplot(df %>% pivot_longer(cols = c(Initial, Final), names_to = "Step", values_to = "Reads"),
aes(x = SampleID, y = Reads, fill=Step)) +
......@@ -1179,32 +1225,32 @@ ggplot(df %>% pivot_longer(cols = c(Initial, Final), names_to = "Step", values_t
### Compositions
```{r, eval=F}
p <- plot_composition(physeq = bread_all_final, taxaRank1 = "Kingdom", taxaSet1 = "Fungi", taxaRank2 = "Species", numberOfTaxa = 22, x = "Sample")
```{r, eval=T}
p <- plot_composition(physeq = wine_all_final, taxaRank1 = "Kingdom", taxaSet1 = "Fungi", taxaRank2 = "Species", numberOfTaxa = 22, x = "Sample")
p + facet_grid(". ~ Marker", scales = "free_x", space = "free")
```
### Richness
```{r, eval=F}
p <- plot_richness(physeq = bread_all_final, x = "Marker", color = "Marker", shape = NULL, title = "Alpha diversity graphics", measures = c("Observed", "Chao1", "ACE", "Shannon", "Simpson", "InvSimpson"))
```{r, eval=T}
p <- plot_richness(physeq = wine_all_final, x = "Marker", color = "Marker", shape = NULL, title = "Alpha diversity graphics", measures = c("Observed", "Chao1", "ACE", "Shannon", "Simpson", "InvSimpson"))
p + geom_boxplot() + NULL
```
### $\beta$ diversity
```{r, eval=F}
beta.dist <- distance(bread_all_final, method = "bray")
ord <- ordinate(bread_all_final, method = "MDS", distance = beta.dist)
p <- plot_ordination(physeq = bread_all_final, ordination = ord, type = "samples", axes = c(1, 2), color = "Marker", shape = NULL, label = NULL, title = "Samples ordination graphic, bray-curtis distance")
```{r, eval=T}
beta.dist <- distance(wine_all_final, method = "bray")
ord <- ordinate(wine_all_final, method = "MDS", distance = beta.dist)
p <- plot_ordination(physeq = wine_all_final, ordination = ord, type = "samples", axes = c(1, 2), color = "Marker", shape = NULL, label = NULL, title = "Samples ordination graphic, bray-curtis distance")
p <- p + stat_ellipse(aes_string(group = "Marker"))
p + theme_bw()
```
### Common families
```{r, eval=F}
```{r, eval=T}
x <- list(
ITS1 = as_tibble(tax_table(physeq_its1_final))$Family %>% as.vector(),
ITS2 = as_tibble(tax_table(physeq_its2_final))$Family %>% as.vector(),
......@@ -1217,7 +1263,7 @@ ggVennDiagram(x,label_alpha = 0) +
### Common genus
```{r, eval=F}
```{r, eval=T}
x <- list(
ITS1 = as_tibble(tax_table(physeq_its1_final))$Genus %>% as.vector(),
ITS2 = as_tibble(tax_table(physeq_its2_final))$Genus %>% as.vector(),
......@@ -1227,3 +1273,16 @@ x <- list(
ggVennDiagram(x,label_alpha = 0) +
scale_fill_gradient(low = "#F4FAFE", high = "#4981BF")
```
### Common species
```{r, eval=T}
x <- list(
ITS1 = as_tibble(tax_table(physeq_its1_final))$Species %>% as.vector(),
ITS2 = as_tibble(tax_table(physeq_its2_final))$Species %>% as.vector(),
D1D2 = as_tibble(tax_table(physeq_d1d2_final))$Species %>% as.vector(),
RPB2 = as_tibble(tax_table(physeq_rpb2_final))$Species %>% as.vector()
)
ggVennDiagram(x,label_alpha = 0) +
scale_fill_gradient(low = "#F4FAFE", high = "#4981BF")
```
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment