# Differential expression analysis of RNA-Seq data
#
# mRNA expression
# miRNA expression
#
# INPUT:   count files generated by HTSeq for mRNA sequencing data
#          miRNA expression table file from CAP-miRSEQ expression_reports.sh output [mature_miRNA_expression.xls]
#
# OUTPUT:  multiple tables and plots
#
# AUTHOR:  Vidal Fey <vidal.fey@utu.fi>
# DATE:    27 August 2015


############################################################################
## miRNA expression part:
##
## # USAGE: differential_expression.R <Mature_miRNA_expression.xls> <output dir> <analysis name> <samples (s1,s2)> <groups (g1,g2)> <pairs (optional)>
##
## Description:
## R script to calculate the differential expression of miRNA using edgeR
##
## Author: Jared Evans
## Date: 5/22/14
## Modified: Vidal Fey, 150827
##
## Parameters:
## <expr.file> - character, name of miRNA expression table file from CAP-miRSEQ expression_reports.sh output [mature_miRNA_expression.xls]
## <out.dir> - Directory where differential expression results should be written to
## <analysis.name> - unique identifier for this analysis that will be prepended to output filenames
## <samples)> - character vector of sample names
## <groups> - character vector of groups the above samples belong to (in the same order as samples)
## <pairs> - Optional character vector of names indicating how samples are paired ie timepoint1 and timepoint2 of same sample
##
############################################################################

#' @keywords internal
"_PACKAGE"
#' @title Differential expression analysis of RNA-Seq data
#' @name diffwrap
#' @description This package provides functionality for differential expression analysis of read counts from mRNA sequencing data or miRNA expression values
#' generated by the CAP-miRSEQ 'expression_reports.sh' script. The workflow follows the 'edgeR'-'limma' expression data analysis pipeline providing options
#' for different approaches, such as "pure" 'edgeR', 'voom' or paired samples. The functions in the package generate text files with differential expression lists,
#' optionally annotated with information from 'biomart', expression summary plots as well as several QC plots.
#' @author Vidal Fey <vidal.fey@gmail.com>, Meeri Pekkarinen <meeri.pekkarinen@gmail.com>, Reija Hieta <reija.hieta@geneviatechnologies.com>, Bogdan Iancu <bogdan.iancu@abo.fi>, Adrien Janssens <Adrien.RFM.Janssens@proton.me>
#' Maintainer: Vidal Fey <vidal.fey@gmail.com>
#' @details \tabular{ll}{
#' Package: \tab diffwrap\cr
#' Type: \tab Package\cr
#' Initial version: \tab 0.1-0\cr
#' Created: \tab 2015-08-27\cr
#' License: \tab GNU GPL v3 \cr
#' LazyLoad: \tab yes\cr
#' }
#' The package contains utilities and methods for differential expression analysis of RNA-Seq data.
#' It comes with a wrapper function, "diffExpr", performing all steps of the analysis. Most sub-functions are exported and can be called by the user, as well, if desired.
#' These functions may be applicable to different kinds of data/input, rely, however, on the conventions set for this package.
#'
#' @section Acknowledgements:
#' This work was largely supported by university-level strategic and profiling area funding schemes at University of Turku
#' and Tampere University. Downstream analysis functionality including all pathway analyses and visualisations as well as some
#' DGE visualisations and helper functions were created or further developed at Genevia Technologies Oy.
#'
#' @concept differential gene expression
#' @concept RNA-seq
#' @concept pathway analysis
#' @concept limma
#' @concept edgeR
#' @concept linear modelling

## usethis namespace: start
#' @importFrom grDevices as.raster colorRampPalette dev.list dev.off pdf rainbow
#' @importFrom graphics hist layout legend par rasterImage text
#' @importFrom stats IQR as.dendrogram as.dist dist hclust model.matrix p.adjust prcomp predict qchisq quantile relevel var
#' @importFrom utils head read.table read.delim write.table
#' @importFrom methods new is
#' @importFrom Hmisc rcorr
#' @importFrom data.table as.data.table
#' @importFrom convertid convertId2 convert.bm
#' @import plyr
#' @import edgeR
#' @import limma
#' @import RColorBrewer
#' @import ggplot2
#' @importFrom pheatmap pheatmap
#' @importFrom ltm biserial.cor
#' @importFrom ggrepel geom_text_repel geom_label_repel
#' @importFrom grid grid.newpage grid.draw
#' @importFrom openxlsx write.xlsx
#' @importFrom purrr map2 reduce
#' @importFrom dplyr select inner_join full_join anti_join
#' @importFrom venn venn
#' @importFrom VennDiagram venn.diagram
## Packages used only in optional features (enrichment, 3D and network plots) are in
## 'Suggests' and accessed conditionally with requireNamespace() + pkg:: qualified calls:
## clusterProfiler, gprofiler2, topGO, igraph, scatterplot3d, readxl, WriteXLS.
## usethis namespace: end
NULL
#'

NULL
