Commit 47d964ac authored by Sebastien Theil's avatar Sebastien Theil
Browse files

Add documentation.

parent 0ab84680
Pipeline #33133 passed with stage
in 12 seconds
...@@ -22,9 +22,13 @@ Imports: ...@@ -22,9 +22,13 @@ Imports:
vctrs, vctrs,
biomformat, biomformat,
Biostrings, Biostrings,
Biobase,
BiocGenerics,
gtools,
ShortRead, ShortRead,
dada2, dada2,
decontam, decontam,
dplyr,
microbiome, microbiome,
DESeq2, DESeq2,
metagenomeSeq, metagenomeSeq,
...@@ -33,11 +37,11 @@ Imports: ...@@ -33,11 +37,11 @@ Imports:
pairwiseAdonis, pairwiseAdonis,
phyloseq, phyloseq,
psadd, psadd,
DESeq2,
VennDiagram, VennDiagram,
digest, digest,
futile.logger, futile.logger,
ggplot2, ggplot2,
glue,
grid, grid,
gridExtra, gridExtra,
vegan, vegan,
...@@ -48,9 +52,14 @@ Imports: ...@@ -48,9 +52,14 @@ Imports:
taxa, taxa,
rmarkdown, rmarkdown,
ranacapa, ranacapa,
reshape2,
doParallel,
foreach,
DECIPHER, DECIPHER,
mixOmics, mixOmics,
venn venn,
htmlwidgets,
scales
Remotes: Remotes:
github::omegahat/XML, github::omegahat/XML,
bioc::3.10/biomformat, bioc::3.10/biomformat,
...@@ -61,11 +70,11 @@ Remotes: ...@@ -61,11 +70,11 @@ Remotes:
bioc::3.10/metagenomeSeq, bioc::3.10/metagenomeSeq,
bioc::3.10/phyloseq, bioc::3.10/phyloseq,
bioc::3.10/microbiome, bioc::3.10/microbiome,
bioc::3.10/DESeq2,
bioc::3.10/DECIPHER, bioc::3.10/DECIPHER,
bioc::3.10/mixOmics, bioc::3.10/mixOmics,
github::pmartinezarbizu/pairwiseAdonis/pairwiseAdonis, github::pmartinezarbizu/pairwiseAdonis/pairwiseAdonis,
github::cpauvert/psadd, github::cpauvert/psadd,
github::gauravsk/ranacapa, github::gauravsk/ranacapa,
github::grunwaldlab/metacoder, github::grunwaldlab/metacoder,
github::mixOmicsTeam/mixOmics github::mixOmicsTeam/mixOmics,
github::mikelove/DESeq2
...@@ -237,10 +237,10 @@ ASVenn_fun <- function(data = data, output = "./ASVenn/", rank = "ASV", ...@@ -237,10 +237,10 @@ ASVenn_fun <- function(data = data, output = "./ASVenn/", rank = "ASV",
#' #'
#' @param TF list containing vectors to plot. #' @param TF list containing vectors to plot.
#' @param mode = 1: length(TF)<=5, mode = 2 5<length(TF)<7 #' @param mode = 1: length(TF)<=5, mode = 2 5<length(TF)<7
#' @param TITRE #' @param TITRE Plot title.
#' @param output #' @param output Output path.
#' @param refseq1 #' @param refseq1 Reference sequences.
#' @param alltax #' @param alltax Taxonomy table.
#' #'
#' #'
#' @return Exports a venn diagram with corresponding tabulated file. #' @return Exports a venn diagram with corresponding tabulated file.
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#' @param verbose Verbose level. (1: quiet, 3: verbal) #' @param verbose Verbose level. (1: quiet, 3: verbal)
#' @param rank Taxonomy rank to merge features that have same taxonomy at a certain taxonomic rank (among rank_names(data), or 'ASV' for no glom) #' @param rank Taxonomy rank to merge features that have same taxonomy at a certain taxonomic rank (among rank_names(data), or 'ASV' for no glom)
#' @param comp Comparison to test. Comma separated and comparisons are informed with a tilde (A~C,A~B,B~C). If empty, test all combination. #' @param comp Comparison to test. Comma separated and comparisons are informed with a tilde (A~C,A~B,B~C). If empty, test all combination.
#' @param returnval Boolean for function to return values.
#' #'
#' @return Export final CSV files, barplot with top significant ASV and Venn Digramm. #' @return Export final CSV files, barplot with top significant ASV and Venn Digramm.
#' #'
......
...@@ -41,6 +41,7 @@ rarefaction <- function(data = data, col = NULL, step = 100, ggplotly = TRUE){ ...@@ -41,6 +41,7 @@ rarefaction <- function(data = data, col = NULL, step = 100, ggplotly = TRUE){
#' @param Fact1 Variable used to change X axis tick labels and color (when split = FALSE) #' @param Fact1 Variable used to change X axis tick labels and color (when split = FALSE)
#' @param split if TRUE make a facet_wrap like grouped by Ord1 (default FALSE) #' @param split if TRUE make a facet_wrap like grouped by Ord1 (default FALSE)
#' @param relative Plot relative (TRUE, default) or raw abundance plot (FALSE) #' @param relative Plot relative (TRUE, default) or raw abundance plot (FALSE)
#' @param outfile Output html file.
#' #'
#' @return Returns barplots in an interactive plotly community plot #' @return Returns barplots in an interactive plotly community plot
#' #'
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#' @param group Choose which level of the factor, if NULL generate a list for each level. #' @param group Choose which level of the factor, if NULL generate a list for each level.
#' @param freq frequence threshold of microbiome::core_members function #' @param freq frequence threshold of microbiome::core_members function
#' @param prev prevalence threshold of microbiome::core_members function #' @param prev prevalence threshold of microbiome::core_members function
#' @param rank Taxonomy rank.
#' #'
#' @importFrom microbiome transform core_members #' @importFrom microbiome transform core_members
#' #'
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#' @param taxtable Tabulated taxonomy table file path. #' @param taxtable Tabulated taxonomy table file path.
#' @param seq Tabulated sequence file path. #' @param seq Tabulated sequence file path.
#' @param metadata Tabulated metadata file path. #' @param metadata Tabulated metadata file path.
#' @param generateTree Boolean to generate the phylogenetic tree.
#' @param output Output directory #' @param output Output directory
#' @param returnval Boolean to return values in console or not. #' @param returnval Boolean to return values in console or not.
#' #'
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#' @param amplicon Choose amplipcon "16S" or "ITS" #' @param amplicon Choose amplipcon "16S" or "ITS"
#' @param path Read files folder path #' @param path Read files folder path
#' @param outpath output .Rdata file name #' @param outpath output .Rdata file name
#' @param pool option for dada function (FALSE, TRUE or "pseudo"), default is "pseudo". See ? dada. #' @param dadapool option for dada function (FALSE, TRUE or "pseudo"), default is "pseudo". See ? dada.
#' @param f_trunclen Forward read tuncate length (only for paired end 16S) #' @param f_trunclen Forward read tuncate length (only for paired end 16S)
#' @param r_trunclen Reverse read tuncate length (only for paired end 16S) #' @param r_trunclen Reverse read tuncate length (only for paired end 16S)
#' @param f_primer Forward primer sequence (only for ITS) #' @param f_primer Forward primer sequence (only for ITS)
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#' #'
#' @param data a phyloseq object (output from decontam or generate_phyloseq) #' @param data a phyloseq object (output from decontam or generate_phyloseq)
#' @param output Output directory #' @param output Output directory
#' @param correc If TRUE, correct metadata to replace most common special characters (eg. é -> e), save the new file in meta_stampOK.tsv. #' @param correc If TRUE, correct metadata to replace most common special characters, save the new file in meta_stampOK.tsv.
#' #'
#' @return Export 2 text files ready to use with STAMP. #' @return Export 2 text files ready to use with STAMP.
#' #'
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#' #'
#' #'
#' @param dada_res Results of dada2_fun() #' @param dada_res Results of dada2_fun()
#' @param taxtable Results of assign_taxo_fun() #' @param tax.table Results of assign_taxo_fun()
#' @param tree Results of generate_tree_fun() #' @param tree Results of generate_tree_fun()
#' @param metadata Path of metadata file (tab separated with header) #' @param metadata Path of metadata file (tab separated with header)
#' @param output Output directory #' @param output Output directory
......
...@@ -3,7 +3,9 @@ ...@@ -3,7 +3,9 @@
#' #'
#' #'
#' @param dada_res Results of dada2_fun() #' @param dada_res Results of dada2_fun()
#' @param output Output directory #' @param output Output directory.
#' @param psobj Phyloseq object with sequences.
#' @param verbose Verbosity level.
#' @param returnval Boolean to return values in console or not. #' @param returnval Boolean to return values in console or not.
#' #'
#' @return Return a formatted tree object ready to use in phyloseq. #' @return Return a formatted tree object ready to use in phyloseq.
......
...@@ -136,8 +136,8 @@ check_tax_fun <- function(taxtable = taxtable, output = NULL, rank = 7, verbose= ...@@ -136,8 +136,8 @@ check_tax_fun <- function(taxtable = taxtable, output = NULL, rank = 7, verbose=
#' @param taxtable data.frame #' @param taxtable data.frame
#' @param seqs path to fasta file or readDNAStringSet #' @param seqs path to fasta file or readDNAStringSet
#' @param prunedb maximum number of sequences per unique taxa. #' @param prunedb maximum number of sequences per unique taxa.
#' @param outputDIR #' @param outputDIR Output directory.
#' @output
#' @return List with taxonomy table and corresponding sequences. #' @return List with taxonomy table and corresponding sequences.
#' #'
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#' @param dna A ‘DNAStringSet’ of unaligned sequences. #' @param dna A ‘DNAStringSet’ of unaligned sequences.
#' @param asv_names sequences IDs in same order. #' @param asv_names sequences IDs in same order.
#' @param confidence Bootstrap threshold 0...100 #' @param confidence Bootstrap threshold 0...100
#' @param ncpu Number of cpu to use
#' #'
#' @return return taxonomic assignment of given sequences. #' @return return taxonomic assignment of given sequences.
#' @import futile.logger #' @import futile.logger
...@@ -14,10 +15,10 @@ ...@@ -14,10 +15,10 @@
#' @export #' @export
idTaxa_assign = function(db_file, dna, asv_names, confidence){ idTaxa_assign = function(db_file, dna, asv_names, confidence, ncpu = NULLS){
flog.info(paste('Using database ',db_file,sep='')) flog.info(paste('Using database ',db_file,sep=''))
toto <- load(db_file) toto <- load(db_file)
ids <- IdTaxa(dna, trainingSet, strand="both", processors=NULL, verbose=TRUE) ids <- IdTaxa(dna, trainingSet, strand="both", processors=ncpu, verbose=TRUE)
names(ids) <- asv_names names(ids) <- asv_names
flog.info("Confidence filtering...") flog.info("Confidence filtering...")
IDCONF = as.numeric(confidence) IDCONF = as.numeric(confidence)
......
...@@ -97,12 +97,12 @@ phy2cyto_fun <- function(data = data, output = "./cytoscape/", column1 = NULL, r ...@@ -97,12 +97,12 @@ phy2cyto_fun <- function(data = data, output = "./cytoscape/", column1 = NULL, r
LINKS = cbind(rep(asv, length(srcs)), glue("type_{srcs}"), srcs) LINKS = cbind(rep(asv, length(srcs)), glue("type_{srcs}"), srcs)
} }
} else{ } else{
#sinon partage et création d'un lien pour chaque environnement source. #sinon partage et creation d'un lien pour chaque environnement source.
LINKS = NULL LINKS = NULL
for(rep in reps){ for(rep in reps){
sdat3 = sdat2[sdat2[,repl]==rep,] sdat3 = sdat2[sdat2[,repl]==rep,]
srcs = as.character(unique(sdat3[,column1])) srcs = as.character(unique(sdat3[,column1]))
# Lien seulement si l'asv présent dans même sample à 2 environnements ou plus # Lien seulement si l'asv present dans meme sample a 2 environnements ou plus
if(length(srcs)>1){ if(length(srcs)>1){
link = cbind(rep(asv, length(srcs)), glue("type_{srcs}"), srcs) link = cbind(rep(asv, length(srcs)), glue("type_{srcs}"), srcs)
# print(glue("{rep} {srcs} envs")) # print(glue("{rep} {srcs} envs"))
......
#' subset_fastx #' subset_fastx
#' #'
#' Allows subset fastq or fasta files at a given threshold. This fonction can convert fastq to fasta. #' Allows subset fastq or fasta files at a given threshold. This function can convert fastq to fasta.
#' #'
#' @param path Path to the fastq files directory #' @param path Path to the fastq files directory
#' @param format fasta or fastq format are allowed. #' @param format fasta or fastq format are allowed.
...@@ -36,7 +36,7 @@ subset_fastx <- function(path = NULL, format = "fastq", outformat = "fastq", out ...@@ -36,7 +36,7 @@ subset_fastx <- function(path = NULL, format = "fastq", outformat = "fastq", out
writeXStringSet(X, glue::glue("{output}/{L2[i]}.{outformat}"), format = outformat, compress=compress) writeXStringSet(X, glue::glue("{output}/{L2[i]}.{outformat}"), format = outformat, compress=compress)
return("Done") return("Done")
} }
if(length(X)>nbseq){ if(length(X)>nbseq){
if(random){ if(random){
if(!is.null(seed)){set.seed(seed)} if(!is.null(seed)){set.seed(seed)}
......
...@@ -18,7 +18,13 @@ VENNFUN( ...@@ -18,7 +18,13 @@ VENNFUN(
\item{mode}{= 1: length(TF)<=5, mode = 2 5<length(TF)<7} \item{mode}{= 1: length(TF)<=5, mode = 2 5<length(TF)<7}
\item{alltax}{} \item{TITRE}{Plot title.}
\item{output}{Output path.}
\item{refseq1}{Reference sequences.}
\item{alltax}{Taxonomy table.}
} }
\value{ \value{
Exports a venn diagram with corresponding tabulated file. Exports a venn diagram with corresponding tabulated file.
......
...@@ -38,6 +38,8 @@ aggregate_fun( ...@@ -38,6 +38,8 @@ aggregate_fun(
\item{rank}{Taxonomy rank to merge features that have same taxonomy at a certain taxonomic rank (among rank_names(data), or 'ASV' for no glom)} \item{rank}{Taxonomy rank to merge features that have same taxonomy at a certain taxonomic rank (among rank_names(data), or 'ASV' for no glom)}
\item{comp}{Comparison to test. Comma separated and comparisons are informed with a tilde (A~C,A~B,B~C). If empty, test all combination.} \item{comp}{Comparison to test. Comma separated and comparisons are informed with a tilde (A~C,A~B,B~C). If empty, test all combination.}
\item{returnval}{Boolean for function to return values.}
} }
\value{ \value{
Export final CSV files, barplot with top significant ASV and Venn Digramm. Export final CSV files, barplot with top significant ASV and Venn Digramm.
......
...@@ -10,7 +10,8 @@ assign_taxo_fun( ...@@ -10,7 +10,8 @@ assign_taxo_fun(
id_db = "/PathToDB/UNITE_idtaxa.Rdata", id_db = "/PathToDB/UNITE_idtaxa.Rdata",
confidence = 50, confidence = 50,
verbose = 1, verbose = 1,
returnval = TRUE returnval = TRUE,
ncpu = NULL
) )
} }
\arguments{ \arguments{
...@@ -25,6 +26,8 @@ assign_taxo_fun( ...@@ -25,6 +26,8 @@ assign_taxo_fun(
\item{verbose}{Verbose level. (1: quiet, 3: verbal)} \item{verbose}{Verbose level. (1: quiet, 3: verbal)}
\item{returnval}{Boolean to return values in console or not.} \item{returnval}{Boolean to return values in console or not.}
\item{ncpu}{Number of cpus to use.}
} }
\value{ \value{
Return a taxonomy table with multiple ancestor checking and incongruence checking when 2 databases are used. Return a taxonomy table with multiple ancestor checking and incongruence checking when 2 databases are used.
......
...@@ -29,6 +29,8 @@ bars_fun( ...@@ -29,6 +29,8 @@ bars_fun(
\item{split}{if TRUE make a facet_wrap like grouped by Ord1 (default FALSE)} \item{split}{if TRUE make a facet_wrap like grouped by Ord1 (default FALSE)}
\item{relative}{Plot relative (TRUE, default) or raw abundance plot (FALSE)} \item{relative}{Plot relative (TRUE, default) or raw abundance plot (FALSE)}
\item{outfile}{Output html file.}
} }
\value{ \value{
Returns barplots in an interactive plotly community plot Returns barplots in an interactive plotly community plot
......
...@@ -23,6 +23,8 @@ core_soft_fun( ...@@ -23,6 +23,8 @@ core_soft_fun(
\item{freq}{frequence threshold of microbiome::core_members function} \item{freq}{frequence threshold of microbiome::core_members function}
\item{prev}{prevalence threshold of microbiome::core_members function} \item{prev}{prevalence threshold of microbiome::core_members function}
\item{rank}{Taxonomy rank.}
} }
\description{ \description{
Define core microbiome, soft micriome and transitory microbiome. Define core microbiome, soft micriome and transitory microbiome.
......
...@@ -23,6 +23,8 @@ csv2phyloseq_fun( ...@@ -23,6 +23,8 @@ csv2phyloseq_fun(
\item{metadata}{Tabulated metadata file path.} \item{metadata}{Tabulated metadata file path.}
\item{generateTree}{Boolean to generate the phylogenetic tree.}
\item{output}{Output directory} \item{output}{Output directory}
\item{returnval}{Boolean to return values in console or not.} \item{returnval}{Boolean to return values in console or not.}
......
Supports Markdown
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