Title: | Targeted Differential and Global Enrichment Analysis of Taxonomic Rank by Shared Asvs |
---|---|
Description: | Targeted differential and global enrichment analysis of taxonomic rank by shared ASVs (Amplicon Sequence Variant), for high-throughput eDNA sequencing of fungi, bacteria, and metazoan. Actually works in two steps: I) Targeted differential analysis from QIIME2 data and II) Global analysis by Taxon Mann-Whitney U test analysis from targeted analysis (I) (I) Estimate variance-mean dependence in count/abundance ASVs data from high-throughput sequencing assays and test for differential represented ASVs based on a model using the negative binomial distribution. (II) NCBITaxon_MWU uses continuous measure of significance (such as fold-change or -log(p-value)) to identify NCBITaxon that are significantly enriches with either up- or down-represented ASVs. If the measure is binary (0 or 1) the script will perform a typical 'NCBITaxon enrichment' analysis based Fisher's exact test: it will show NCBITaxon over-represented among the ASVs that have 1 as their measure. On the plot, different fonts are used to indicate significance and color indicates enrichment with either up (red) or down (blue) regulated ASVs. No colors are shown for binary measure analysis. The tree on the plot is hierarchical clustering of NCBITaxon based on shared ASVs. Categories with no branch length between them are subsets of each other. The fraction next to the category name indicates the fraction of 'good' ASVs in it; 'good' ASVs are the ones exceeding the arbitrary absValue cutoff (option in taxon_mwuPlot()). For Fisher's based test, specify absValue=0.5. This value does not affect statistics and is used for plotting only. The original idea was for genes differential expression analysis from Wright et al (2015) <doi:10.1186/s12864-015-1540-2>; adapted here for taxonomic analysis. The 'Anaconda' package makes it possible to carry out these analyses by automatically creating several graphs and tables and storing them in specially created subfolders. You will need your QIIME2 pipeline output for each kingdom (eg; Fungi and/or Bacteria and/or Metazoan): i) taxonomy.tsv, ii) taxonomy_RepSeq.tsv, iii) ASV.tsv and iv) SampleSheet_comparison.txt (the latter being created by you). |
Authors: | Pierre-Louis Stenger [cre, aut] |
Maintainer: | Pierre-Louis Stenger <[email protected]> |
License: | GPL (>= 2) |
Version: | 0.1.5 |
Built: | 2025-03-09 05:43:01 UTC |
Source: | https://github.com/plstenger/anaconda |
This function create a new folder named Bacteria and set your working directory into this folder. Please, run setwd("Bacteria") after this function.
Bacteria(nothing)
Bacteria(nothing)
nothing |
It's important not to write anything between the brackets, a new folder named Bacteria will be created and your working directory will be set into this folder, depending of the selected Kingdom. |
A new folder named Bacteria will be created and your working directory will be set into this folder, depending of the selected Kingdom.
## Not run: Bacteria() # Please, run setwd("Bacteria") after this function.
## Not run: Bacteria() # Please, run setwd("Bacteria") after this function.
clusteringGOs from DESeq2 analysis pipeline
clusteringGOs(gen2go, div, cutHeight)
clusteringGOs(gen2go, div, cutHeight)
gen2go |
from DESeq2 analysis pipeline |
div |
div |
cutHeight |
cutHeight |
a clustering GO
## Not run: clusteringGOs()
## Not run: clusteringGOs()
Used in heatmap_samples_hclust(), heatmap_samples_matrix(), PCA_data_dasva() and get_dasva() functions.
dasva_raw_input(sampleTable, directory = ".", design, ignoreRank = FALSE, ...)
dasva_raw_input(sampleTable, directory = ".", design, ignoreRank = FALSE, ...)
sampleTable |
Depending of the heatmap_samples_hclust(), heatmap_samples_matrix(), PCA_data_dasva() and get_dasva() functions. |
directory |
directory |
design |
design |
ignoreRank |
ignoreRank |
... |
... |
object
## Not run: dasva_raw <- dasva_raw_input(sampleTable = sampleTable, directory = targeted_analysis_dir, design= ~ condition) ## End(Not run)
## Not run: dasva_raw <- dasva_raw_input(sampleTable = sampleTable, directory = targeted_analysis_dir, design= ~ condition) ## End(Not run)
Create a Database for Bacteria kingdom for Global analysis by Taxon_MWU analysis from targeted analysis. Please, run setwd("02_Global_analysis") after this function.
database_bacteria_creation(nothing)
database_bacteria_creation(nothing)
nothing |
It's important not to write anything between the brackets, the database will create itself. |
A data frame file named database_bacteria_package_all.tab created from the taxonomy_all_bacteria_QIIME2_and_NCBI_format.txt file and your own taxonomy_RepSeq.tsv file. database_bacteria_creation()
# It is important not to write anything between the brackets, the database will create itself. ## Not run: database_bacteria_creation() # Please, run setwd("02_Global_analysis") after this function.
# It is important not to write anything between the brackets, the database will create itself. ## Not run: database_bacteria_creation() # Please, run setwd("02_Global_analysis") after this function.
Create a Database for Fungi kingdom for Global analysis by Taxon_MWU analysis from targeted analysis only from rarefied ASVs. Please, run setwd("02_Global_analysis") after this function.
database_fungi_creation(nothing)
database_fungi_creation(nothing)
nothing |
It's important not to write anything between the brackets, the database will create itself. |
A data frame file named database_fungi_package_all.tab created from the taxonomy_all_bacteria_QIIME2_and_NCBI_format.txt file and your own taxonomy.tsv file.
# It is important not to write anything between the brackets, the database will create itself. ## Not run: database_fungi_creation() # Please, run setwd("02_Global_analysis") after this function.
# It is important not to write anything between the brackets, the database will create itself. ## Not run: database_fungi_creation() # Please, run setwd("02_Global_analysis") after this function.
Create a Database for Fungi kingdom for Global analysis by Taxon_MWU analysis from targeted analysis. Please, run setwd("02_Global_analysis") after this function.
database_fungi_creation_RepSeq(nothing)
database_fungi_creation_RepSeq(nothing)
nothing |
It's important not to write anything between the brackets, the database will create itself. |
A data frame file named database_fungi_package_all.tab created from the taxonomy_all_bacteria_QIIME2_and_NCBI_format.txt file and your own taxonomy_RepSeq.tsv file.
# It is important not to write anything between the brackets, the database will create itself. ## Not run: database_fungi_creation_RepSeq() # Please, run setwd("02_Global_analysis") after this function.
# It is important not to write anything between the brackets, the database will create itself. ## Not run: database_fungi_creation_RepSeq() # Please, run setwd("02_Global_analysis") after this function.
Create a Database for metazoan kingdom for Global analysis by Taxon_MWU analysis from targeted analysis. Please, run setwd("02_Global_analysis") after this function.
database_metazoan_creation(nothing)
database_metazoan_creation(nothing)
nothing |
It's important not to write anything between the brackets, the database will create itself. |
A data frame file named database_metazoan_package_all.tab created from the taxonomy_all_metazoan_QIIME2_and_NCBI_format.txt file and your own taxonomy_RepSeq.tsv file. database_metazoan_creation()
# It is important not to write anything between the brackets, the database will create itself. ## Not run: database_metazoan_creation() # Please, run setwd("02_Global_analysis") after this function.
# It is important not to write anything between the brackets, the database will create itself. ## Not run: database_metazoan_creation() # Please, run setwd("02_Global_analysis") after this function.
Ficher Test from RBGOA
fisherTest(gotable)
fisherTest(gotable)
gotable |
from gomwuStats from RBGOA |
fisherTest
## Not run: fisherTest()
## Not run: fisherTest()
Apply logP on both positive and negative ASVs FC
format_input(x)
format_input(x)
x |
Object from the Differential ASV abundance (DASVA) analysis |
an input for the input_global_analysis() function
## Not run: format_input(x)
## Not run: format_input(x)
This function create a new folder named Fungi and set your working directory into this folder. Please, run setwd("Fungi") after this function.
Fungi(nothing)
Fungi(nothing)
nothing |
It's important not to write anything between the brackets, a new folder named Fungi will be created and your working directory will be set into this folder, depending of the selected Kingdom. |
A new folder named Fungi will be created and your working directory will be set into this folder, depending of the selected Kingdom.
## Not run: Fungi() # plaese, run setwd("Fungi") after this function.
## Not run: Fungi() # plaese, run setwd("Fungi") after this function.
Prepare Object for Fungi Guilds for Fungi kingdom for targeted analysis
funguild_input_targeted(x)
funguild_input_targeted(x)
x |
Object from the Differential ASV abundance (DASVA) analysis |
An Object used for Fungi Guilds informations for Fungi kingdom for targeted analysis from the Differential ASV abundance (DASVA) analysis
## Not run: get_funguilds_targeted(res_forest_vs_long_fallow_guilds)
## Not run: get_funguilds_targeted(res_forest_vs_long_fallow_guilds)
Obtain Bacterial Traits for Bacteria kingdom for targeted analysis
get_bactotraits_targeted(x)
get_bactotraits_targeted(x)
x |
Object from the Differential ASV abundance (DASVA) analysis |
A data frame file with Bacterial Traits informations for Bacteria kingdom for targeted analysis from the Differential ASV abundance (DASVA) analysis
## Not run: get_bactotraits_targeted(res_forest_vs_long_fallow)
## Not run: get_bactotraits_targeted(res_forest_vs_long_fallow)
Creates the DASVA object. Fit a Gamma-Poisson Generalized Linear Model, dispersion estimates for Negative Binomial distributed data, "parametric", local" or "mean"
get_dasva(fitType = "")
get_dasva(fitType = "")
fitType |
Fit a Gamma-Poisson Generalized Linear Model, dispersion estimates for Negative Binomial distributed data, "parametric", local" or "mean" |
DASVA object
## Not run: dasva <- get_dasva(fitType="parametric") dasva <- get_dasva(fitType="local") dasva <- get_dasva(fitType="mean") ## End(Not run)
## Not run: dasva <- get_dasva(fitType="parametric") dasva <- get_dasva(fitType="local") dasva <- get_dasva(fitType="mean") ## End(Not run)
get Fungi Guilds from taxon_list_drawer Object
get_funguilds(taxon_list_drawer)
get_funguilds(taxon_list_drawer)
taxon_list_drawer |
object from get_taxon_list_drawer() function |
funguilds Object
## Not run: funguilds <- get_funguilds(taxon_list_drawer)
## Not run: funguilds <- get_funguilds(taxon_list_drawer)
Obtain Fungi Guilds for Fungi kingdom for targeted analysis
get_funguilds_targeted(x)
get_funguilds_targeted(x)
x |
Object from the funguild_input_targeted() output. |
A data frame file with Fungi Guilds informations for Fungi kingdom for targeted analysis from the Differential ASV abundance (DASVA) analysis
## Not run: get_funguilds_targeted(res_forest_vs_long_fallow_guilds)
## Not run: get_funguilds_targeted(res_forest_vs_long_fallow_guilds)
Created sub directory "Targeted_analysis" if not already exist. Then, create one file by condition into it, and then upload the taxonomy file. Please, run setwd("01_Targeted_analysis") after this function.
get_input_files(nothing)
get_input_files(nothing)
nothing |
It's important not to write anything between the brackets, all inputs will be adapted automatically. |
taxo
## Not run: taxo <- get_input_files() # please, run setwd("01_Targeted_analysis") after this function.
## Not run: taxo <- get_input_files() # please, run setwd("01_Targeted_analysis") after this function.
get link guilds from taxon_list and funguilds Objects
get_link_guilds(taxon_list, funguilds)
get_link_guilds(taxon_list, funguilds)
taxon_list |
object from taxon_mwu_list() function |
funguilds |
object from get_funguilds() function |
link_guilds Object
## Not run: link_guilds <- get_link_guilds(taxon_list, funguilds)
## Not run: link_guilds <- get_link_guilds(taxon_list, funguilds)
get taxonomic list drawer
get_taxon_list_drawer(taxon_list)
get_taxon_list_drawer(taxon_list)
taxon_list |
object from taxon_mwu_list() function |
taxon_list_drawer Object and "taxon_list_drawer_input.txt" file
## Not run: taxon_list_drawer <- get_taxon_list_drawer(taxon_list)
## Not run: taxon_list_drawer <- get_taxon_list_drawer(taxon_list)
For Clustering step. Fill directly the annotation_col variable of the pheatmap() function
heatmap_condition(nothing)
heatmap_condition(nothing)
nothing |
It's important not to write anything between the brackets, all inputs will be adapted automatically. |
Fill directly the annotation_col variable of the pheatmap() function
For Clustering step. Create the log2.norm.counts object.
heatmap_data_dasva(nothing)
heatmap_data_dasva(nothing)
nothing |
It's important not to write anything between the brackets, all inputs will be adapted automatically. |
Create the log2.norm.counts object.
Adapt hclust for heatmap sample to sample analysis
heatmap_samples_hclust(nothing)
heatmap_samples_hclust(nothing)
nothing |
It's important not to write anything between the brackets, all inputs will be adapted automatically. |
hclust object for the heatmap.2() function
## Not run: hc <- heatmap_samples_hclust()
## Not run: hc <- heatmap_samples_hclust()
Adapt samples matrix for heatmap sample to sample analysis
heatmap_samples_matrix(nothing)
heatmap_samples_matrix(nothing)
nothing |
It's important not to write anything between the brackets, all inputs will be adapted automatically. |
samples matrix object for the heatmap.2() function
## Not run: mat <- heatmap_samples_matrix()
## Not run: mat <- heatmap_samples_matrix()
Adding taxonomy in the pheatmap plot, instead of ASVs codes
heatmap_taxo(nothing)
heatmap_taxo(nothing)
nothing |
It's important not to write anything between the brackets, all inputs will be adapted automatically. |
log2.norm.counts_taxo used fro adding taxonomy in the pheatmap plot, instead of ASVs codes
## Not run: log2.norm.counts_taxo <- heatmap_taxo()
## Not run: log2.norm.counts_taxo <- heatmap_taxo()
Input files creation for each condition for Global analysis by Taxon_MWU analysis from targeted analysis (I)
input_global_analysis(x)
input_global_analysis(x)
x |
Object from the Differential ASV abundance (DASVA) analysis |
Input Object for Global analysis by Taxon_MWU analysis from targeted analysis (I)
## Not run: input_global_analysis(res_forest_vs_long_fallow)
## Not run: input_global_analysis(res_forest_vs_long_fallow)
This function create a new folder named Metazoan and set your working directory into this folder. Please, run setwd("Metazoan") after this function.
Metazoan(nothing)
Metazoan(nothing)
nothing |
It's important not to write anything between the brackets, a new folder named Metazoan will be created and your working directory will be set into this folder, depending of the selected Kingdom. |
A new folder named Metazoan will be created and your working directory will be set into this folder, depending of the selected Kingdom.
## Not run: Metazoan() # plaese, run setwd("Metazoan") after this function.
## Not run: Metazoan() # plaese, run setwd("Metazoan") after this function.
Move the file in the good folders. Depending on the previous Kingdom selection (e.g., Fungi 'Fungi()', Bacteria 'Bacteria()', etc.)
move_files(nothing)
move_files(nothing)
nothing |
It's important not to write anything between the brackets, files will move in the good folders, depending of the selected Kingdom before. |
Move the file in the good folders.
## Not run: move_files()
## Not run: move_files()
Mann-Whitney U Test from RBGOA
mwuTest(gotable, Alternative)
mwuTest(gotable, Alternative)
gotable |
from gomwuStats from RBGOA |
Alternative |
from gomwuStats from RBGOA |
mwuTest
## Not run: mwuTest()
## Not run: mwuTest()
Compute the PCA (Pincipal Component Analysis) data.
PCA_data_dasva(nothing)
PCA_data_dasva(nothing)
nothing |
It's important not to write anything between the brackets, all inputs will be adapted automatically. |
data. The PCA (Pincipal Component Analysis) data.
Create a plot of Dispersion ASV
plotDispASVs( object, ymin, CV = FALSE, genecol = "black", fitcol = "red", finalcol = "dodgerblue", legend = TRUE, xlab, ylab, log = "xy", cex = 0.45, ... )
plotDispASVs( object, ymin, CV = FALSE, genecol = "black", fitcol = "red", finalcol = "dodgerblue", legend = TRUE, xlab, ylab, log = "xy", cex = 0.45, ... )
object |
Corresponding to the DASVA (Differential ASV abundance) object |
ymin |
ymin |
CV |
CV |
genecol |
genecol |
fitcol |
fitcol |
finalcol |
finalcol |
legend |
legend |
xlab |
xlab |
ylab |
ylab |
log |
log |
cex |
cex |
... |
... |
A plot of Dispersion ASV
## Not run: plotDispASVs(dasva)
## Not run: plotDispASVs(dasva)
Custom MA plots for the Differential ASV abundance (DASVA) analysis. defining a new function to plot all ASVs and not only log2FoldChange > 2
plotMA.dasva( object, alpha, main = "", xlab = "mean of normalized counts", ylim, MLE = FALSE, verbose = TRUE, ... )
plotMA.dasva( object, alpha, main = "", xlab = "mean of normalized counts", ylim, MLE = FALSE, verbose = TRUE, ... )
object |
Object from the Differential ASV abundance (DASVA) analysis |
alpha |
alpha |
main |
main |
xlab |
xlab |
ylim |
ylim |
MLE |
MLE |
verbose |
verbose |
... |
... |
A MA plot
## Not run: plotMA.dasva(rXXX, main="XXX", ylim=c(-20,20))
## Not run: plotMA.dasva(rXXX, main="XXX", ylim=c(-20,20))
Custom plotPCA function to plot PC1 et PC3
plotPCA.san(object, intgroup = "condition", ntop = 500, returnData = FALSE)
plotPCA.san(object, intgroup = "condition", ntop = 500, returnData = FALSE)
object |
An object use for the PCA |
intgroup |
intgroup |
ntop |
ntop |
returnData |
returnData |
A PCA
## Not run: plotPCA.san(object)
## Not run: plotPCA.san(object)
Create a plot of Sparsity ASV
plotSparsityASV(x, normalized = TRUE, ...)
plotSparsityASV(x, normalized = TRUE, ...)
x |
Corresponding to the DASVA (Differential ASV abundance) object |
normalized |
normalized |
... |
... |
A plot of Sparsity ASV
## Not run: plotSparsityASV(dasva)
## Not run: plotSparsityASV(dasva)
Imports conditions information from your SampleSheet_comparison.txt file, with focus on samplesInfo.
samplesInfo(nothing)
samplesInfo(nothing)
nothing |
It's important not to write anything between the brackets, comparisons will create themselves. |
a data.frame with conditions information from your SampleSheet_comparison.txt file, with focus on samplesInfo.
## Not run: samplesInfo <- samplesInfo()
## Not run: samplesInfo <- samplesInfo()
Imports conditions information from your SampleSheet_comparison.txt file, with focus on iput files.
target_file(nothing)
target_file(nothing)
nothing |
It's important not to write anything between the brackets, comparisons will create themselves. |
a data.frame with conditions information from your SampleSheet_comparison.txt file
## Not run: target_file <- target_file()
## Not run: target_file <- target_file()
taxon Mann-Whitney U list for taxonomic analysis
taxon_mwu_list( inFile, goAnnotations, goDivision, level1 = 0.1, level2 = 0.05, level3 = 0.01, absValue = -log(0.05, 10), adjusted = TRUE, txtsize = 1, font.family = "sans", treeHeight = 0.5, colors = NULL )
taxon_mwu_list( inFile, goAnnotations, goDivision, level1 = 0.1, level2 = 0.05, level3 = 0.01, absValue = -log(0.05, 10), adjusted = TRUE, txtsize = 1, font.family = "sans", treeHeight = 0.5, colors = NULL )
inFile |
inFile - results object from the DASVA analysis |
goAnnotations |
parallel to goAnnotations from gomwuStats from RBGOA. Here, "database_bacteria_package_all.tab" if Bacteria, "database_fungi_package_all.tab" if Fungi |
goDivision |
parallel to goAnnotations from gomwuStats from RBGOA. Here, "TR" = taxonomic Rank, don't change this |
level1 |
level1 |
level2 |
level2 |
level3 |
level3 |
absValue |
absValue |
adjusted |
adjusted |
txtsize |
txtsize |
font.family |
font.family |
treeHeight |
treeHeight |
colors |
colors |
List for the statistical analysis for taxonomic rank
## Not run: taxon_list <- taxon_mwu_list(input, ...)
## Not run: taxon_list <- taxon_mwu_list(input, ...)
taxon mwuPlot for taxonomic analysis
taxon_mwuPlot( inFile, goAnnotations, goDivision, level1 = 0.1, level2 = 0.05, level3 = 0.01, absValue = -log(0.05, 10), adjusted = TRUE, txtsize = 1, font.family = "sans", treeHeight = 0.5, colors = NULL, verbose = TRUE )
taxon_mwuPlot( inFile, goAnnotations, goDivision, level1 = 0.1, level2 = 0.05, level3 = 0.01, absValue = -log(0.05, 10), adjusted = TRUE, txtsize = 1, font.family = "sans", treeHeight = 0.5, colors = NULL, verbose = TRUE )
inFile |
inFile - results object from the DASVA analysis |
goAnnotations |
parallel to goAnnotations from gomwuStats from RBGOA. Here, "database_bacteria_package_all.tab" if Bacteria, "database_fungi_package_all.tab" if Fungi |
goDivision |
parallel to goAnnotations from gomwuStats from RBGOA. Here, "TR" = taxonomic Rank, don't change this |
level1 |
level1 |
level2 |
level2 |
level3 |
level3 |
absValue |
absValue |
adjusted |
adjusted |
txtsize |
txtsize |
font.family |
font.family |
treeHeight |
treeHeight |
colors |
colors |
verbose |
verbose |
taxon mwuPlot and goods "Table_02_taxon_mwuPlot.txt"
## Not run: taxon_mwuPlot(input,...)
## Not run: taxon_mwuPlot(input,...)
taxon Mann-Whitney U Plot with Fungi Guilds added
taxon_mwuPlot_guilds( inFile, goAnnotations, goDivision, level1 = 0.1, level2 = 0.05, level3 = 0.01, absValue = -log(0.05, 10), adjusted = TRUE, txtsize = 1, font.family = "sans", treeHeight = 0.5, colors = NULL, verbose = TRUE )
taxon_mwuPlot_guilds( inFile, goAnnotations, goDivision, level1 = 0.1, level2 = 0.05, level3 = 0.01, absValue = -log(0.05, 10), adjusted = TRUE, txtsize = 1, font.family = "sans", treeHeight = 0.5, colors = NULL, verbose = TRUE )
inFile |
inFile - results object from the DASVA analysis |
goAnnotations |
parallel to goAnnotations from gomwuStats from RBGOA. Here, "database_bacteria_package_all.tab" if Bacteria, "database_fungi_package_all.tab" if Fungi |
goDivision |
parallel to goAnnotations from gomwuStats from RBGOA. Here, "TR" = taxonomic Rank, don't change this |
level1 |
level1 |
level2 |
level2 |
level3 |
level3 |
absValue |
absValue |
adjusted |
adjusted |
txtsize |
txtsize |
font.family |
font.family |
treeHeight |
treeHeight |
colors |
colors |
verbose |
verbose |
List for the statistical analysis for taxonomic rank
## Not run: taxon_mwuPlot_guilds(input, ...)
## Not run: taxon_mwuPlot_guilds(input, ...)
mwuStats from RBGOA adapted for taxonomic analysis
taxon_mwuStats( input, goDatabase, goAnnotations, goDivision, Alternative = "t", adjust.multcomp = "BH", clusterCutHeight = 0.25, largest = 0.1, smallest = 5, perlPath = "perl", verbose = TRUE )
taxon_mwuStats( input, goDatabase, goAnnotations, goDivision, Alternative = "t", adjust.multcomp = "BH", clusterCutHeight = 0.25, largest = 0.1, smallest = 5, perlPath = "perl", verbose = TRUE )
input |
input |
goDatabase |
goDatabase |
goAnnotations |
goAnnotations |
goDivision |
goDivision |
Alternative |
Alternative |
adjust.multcomp |
adjust.multcomp |
clusterCutHeight |
clusterCutHeight |
largest |
largest |
smallest |
smallest |
perlPath |
perlPath |
verbose |
verbose |
Statistical analysis for taxonomic rank
## Not run: taxon_mwuStats(input, ...)
## Not run: taxon_mwuStats(input, ...)